Apache Error occurs under certain conditions

Created on 29 October 2024, 4 months ago

Hello, I am facing the following problem:

The following conditions cause an Apache error and the site to go down:

1. The Webform has a limit on submissions per user.
2. The Webform contains Computed Twig elements.

If User-A submits a Webform and the limit is reached, when another user edits User A's post (e.g. admin), the site becomes unresponsive after clicking the save button.

The following is recorded in the Apache Error log:

Parent: child process 14024 exited with status 3221225725 -- Restarting

This occurs in both Windows XAMPP and Linux environments.

The following does not cause the problem:

  1. The submitter (User A) edits his own submission.
  2. The limit on submissions per user is not set.
  3. Computed Twig elements are not included.

Below is a simple YAML source to reproduce the problem.

radio_button:
  '#type': radios
  '#title': 'Radio Button'
  '#options':
    1: '1'
    2: '2'
    3: '3'
  '#options_display': side_by_side
twig:
  '#type': computed_twig
  '#title': Twig
  '#template': '{{ "Hello" }}'
  '#store': true

I am using webform module 6.2.7 on Drupal 10.2.10 .

Any help would be appreciated.

πŸ› Bug report
Status

Active

Version

6.2

Component

Code

Created by

πŸ‡―πŸ‡΅Japan Ryo Ichiyama

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Ryo Ichiyama
  • In seeking to reproduce this I got this at the last step:

    Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/docroot/modules/contrib/metatag/src/MetatagManager.php on line 289
    
    Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0
    
    Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0
    

    Is it possible what you are seeing is this memory exhaustion?

  • By uninstalling metatag, the problem no longer occurs. Let's confirm that.

  • πŸ‡―πŸ‡΅Japan Ryo Ichiyama

    Thank you very much for your verification.

    The error log of my Linux server did not contain any information related to the metatag module, but after uninstalling the metatag module, it started working normally!

    For reference, the error log of the Linux server is as follows.

    (70007)The timeout specified has expired: AH01075: Error dispatching request to : (polling), referer: https://MYDOMAIN/admin/webform/manage/MYURLALIAS/submission/980/edit

    And as you can see in your log, the memory usage of Apache & PHP-FPM increases.

    If this is not a problem with the Webform module, I will close this case. What do you think?

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Can you please confirm the version of Metatag that is being used, which Metatag submodules are being used, and whether you're also using Schema.org Metatag and its submodules?

  • Metatag 2.0.2 is the only metatag-related module installed on the site where memory exhausted.

  • πŸ‡―πŸ‡΅Japan Ryo Ichiyama

    Thanks for your reply.

    I have the following modules installed on my site:

    • Metatag 2.0.2
    • Metatag: Mobile & UI Adjustments

    Schema.org Metatag module is not installed.

  • Status changed to Postponed: needs info about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States cindytwilliams Nashville, TN

    This is happening for me as well when I upgrade metatag from version 1.26.0 => 2.1.0 and then edit a webform submission:

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/web/modules/contrib/metatag/src/MetatagManager.php on line 289
    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0
  • πŸ‡ΊπŸ‡ΈUnited States redeight

    I've been trying to figure out this issue for a while now. I have confirmed that uninstalling Metatag fixes the issue I was having.

    On to the weird.... I'm running some custom code that loads and modifies webform submissions. In my case, with metatag installed, it gets stuck in an infinite foreach loop.

    Specifically on webform (version 6.2.9) /src/WebformSubmissionStorage.php line 1438.

    foreach ($submissions_data as $sid => $submission_data) {

    $submissions_data is an array and in my case only contains one element (a single webform submission's data). stepping through, it goes all the way through the interior of the foreach loop, then ends up back on the foreach line and sets $sid and $submission_data to the exact same values as last time, jumps into the interior and works through setting values that were already set. It does this without end until PHP runs out of memory or throws an exception for calling too many functions or something like that. In debugging I was able to set a breakpoint and forcibly set the $submissions_data array to be null after it ran through a couple times and that causes it to finally leave the foreach loop. Everything else then proceeds as expected.

    Uninstalling the metatag module and running through the debugging breakpoint again hits the same foreach loop but DOESN'T get stuck....

    I'm so far beyond my ability to understand what is happening here. If there is any information I can give that might help either Metatag or Webform developers fix this issue, I'm more than willing to keep plugging on this issue.

  • πŸ‡©πŸ‡ͺGermany butch.coolidge Reutlingen

    We're experiencing the same problem here.

    - Drupal 10.3
    - Webform 6.2.9
    - Metatag 2.1.0 (Submodules activated: Dublin Core + Advanced, Favicons, Mobile & UI, Open Graph, Views)
    - Schema.org 3.0.3

    Editing Webform submissions works fine as long as there is no "Computed twig" or "Computed token" field in the webform.

    Adding a "computed twig" field to the webform makes it impossible to edit the submission, even if the computed twig is something "easy" like

    {% set a = 'test' %}
    {% if a == 1 %}
    asdf
    {% else %}
    xyz
    {% endif %}

    so that it would return "xyz".

    This "computed twig" returns the following error in our logfile:
    AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www//modules/metatag/src/MetatagManager.php on line 289;

    Maybe there is a way to suppress the "computing" of this "computed twig" field on editing a submission?

Production build 0.71.5 2024