"Fatal error: Allowed memory size of ... bytes exhausted" when saving form display after 8.x-1.4 upgrade

Created on 2 August 2022, over 2 years ago
Updated 29 April 2024, 8 months ago

Problem/Motivation

When upgrading from 8.x-1.3 to 8.x-1.4, I found that saving a form display that uses "Link with target" to produce essentially a WSOD, just displaying

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in /var/www/web/core/lib/Drupal/Core/Config/TypedConfigManager.php on line 160

After reverting to 8.x-1.3, the error doesn't happen. Or if keeping 8.x-1.4 but switching to non-link_target widgets, the error doesn't happen.

Steps to reproduce

* Go to the "Manage form display" page for a content type
* Make sure there's a link field with widget set to "Link with target" set
* Save form.

Proposed resolution

I don't quite fully understand all that #3224872: Wrong config schema definition is about/doing, but I can say that "unpatching" the change for it seems to prevent the WSOD / memory error (whereas undoing the change for #3292201: Notice on form display didn't have any effect, so doesn't seem to be the cause). Unsure what the solution is that resolves the spirit of #3224872: Wrong config schema definition without causing this issue.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇸United States maxstarkenburg Washington, DC

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇪🇸Spain einarulfhednar

    Hi, I'm using Drupal version 9.5.8 and #5 works.

    Thank you very much.

  • 🇩🇪Germany broon Potsdam

    Patch #5 works fine, please commit to module repo.

  • 🇮🇳India amitgoyal

    Patch #5 works fine, please release it.

  • 🇺🇸United States mkindred

    Patch #5 works for me. Thanks!

  • 🇺🇸United States Poindexterous

    Also confirming that Patch #5 works for me. Thanks very much for this patch.

  • Oh wow, thank you for the patch!

    I met this bug when updated link_target to the latest version and then ran drush site:install --existing-config. PHP ate 72GB 😱 of ram and then died without a word 😅

  • 🇺🇸United States lexfunk

    Patch #5 works with Drupal 9.5.10, please consider a new release.

  • 🇺🇸United States neorush

    Confirming patch #5 fixes same issue on Drupal 10.1.6, would be nice to update the release.

  • Merge request !4fix schema → (Open) created by tommyvca
  • 🇫🇷France ericdsd France

    Both MR and patch works fine, took me at least one day to figure out what was the cause as the server always fall before we can know what module was responsible, thanks a lot for the patch.
    It would be awesome to have a release for that, but i'm not sure the module is still supported, maybe it should be flagged as seeking co-maintainer.

  • 🇺🇸United States JeffC518

    Confirmed that patch #5 works - I was in the bowels of the Drupal\Core\Config classes for a while trying to figure this one out. Mainly because it manifested in nginx as a 502 Gateway Error - so no PHP error logs.

    This was showing up like this in nginx.log when attempting to manage form display for an events content type:

    *878 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xx.xx.x, server: REDACTED.local, request: "GET /admin/structure/types/manage/events/form-display HTTP/1.1

    In my case, I'm upgrading a Drupal 8 site -> 9 -> 10, so I had no YML files to patch yet. I wrote a function to update the config tables if anyone is interested.

    Note that this can disrupt any drush updb maintenance as well. This is where I received the memory exhausted error that led me here. If you increase the PHP memory limit to a ridiculous amount like I did (4G), you get something like this instead:

    >  [notice] Update started: system_post_update_sort_all_config
    > Killed

    Thanks for the patch.

    • mandclu committed 80a95681 on 8.x-1.x
      Issue #3301444 by tommyvca: "Fatal error: Allowed memory size of ......
  • 🇨🇦Canada mandclu

    Merged in, and will roll a new release shortly.

  • Status changed to Fixed 8 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024