Error 500 (Max Memory Allocated) in new Drupal 8 Installation after changing Display Settings
Asked Answered
T

2

6

I have set up a fresh instance of Drupal 8 and installed two modules:

  • Paragraphs (8.x-1.12)
  • Entity Reference Revisions (8.x-1.9)

I have also installed the Barrio theme (Barrio 5.5.1.)

Then I have gone ahead and created a new content type with two fields (both Paragraph Revisions.) When trying to add a new page by navigating to Content -> Add, everything works fine until I go ahead and make any modifications to the Form Display or Display Settings of the Content Type. Once modifications have been made, regardless which modifications, I get an error 500 upon adding a page of said Content Type.

The relevant log entries:

var/www/vhosts/some-website.com/httpdocs/core/lib/Drupal/Core/Field/WidgetBase.php on line 510', referer: https://some-website.com/node/add/

[Thu Jun 24 16:33:28.779959 2021] [proxy_fcgi:error] [pid 10213:tid 140020013704960] [client 91.249.132.211:43799] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 135168 bytes) in /var/www/vhosts/some-website.com/httpdocs/core/lib/Drupal/Core/Field/WidgetBase.php on line 510'

[Thu Jun 24 16:36:33.558731 2021] [proxy_fcgi:error] [pid 10213:tid 140019649947392] [client 91.249.132.211:62936] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 135168 bytes) in /var/www/vhosts/some-website.com/httpdocs/modules/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php on line 821', referer: https://some-website.com/node/add/

[Thu Jun 24 16:36:55.127020 2021] [proxy_fcgi:error] [pid 10213:tid 140019616376576] [client 91.249.132.211:63829] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 135168 bytes) in /var/www/vhosts/some-website.com/httpdocs/core/lib/Drupal/Core/Field/WidgetBase.php on line 510'

I have already tried increasing the memory limit to extreme values, but without success. I am currently using PHP v7.3.28 as well as Drupal core 8.9.16. The installation is running on a Linux server through Plesk.

Does anyone have a clue what could be wrong?

Triggerfish answered 24/6, 2021 at 14:57 Comment(4)
Not an answer, but the errors that are being reported are not indicative of a system related memory issue, but rather indicative of a PHP function that is not performing as expected. I.e. your attempts to increase memory limits are not the solution. Look to the application's functions/methods that are creating the error. Unfortunately there is too little to act on here to give you a proper response.Achene
If you are using the Entity Reference Revisions with a field that's cardinality is set to 1 (I assume paragraphs does this as you can add as many as you want), then you could try this patch: https://www.drupal.org/project/drupal/issues/3137275.patchGinni
I tried the patch, but the issue is still appearing. Thanks anyway!Triggerfish
256M is not a 'extreme value', are you sure increasing the memory limit was successful? What if you set it to -1 to disable it?Indispose
N
1

Your memory is set to less than 256MB which is what it tried to allocate - (268435456 + 135168) / 1024 / 1024

You mentioned,

I have already tried increasing the memory limit to extreme values, but without success.

In a comment,

Yes, definitely successful and no change, regardless of the value set

If you go to /admin/reports/status, is that reporting the 256MB or is it reporting the higher, extreme, value that you're are setting up.

If it's not displaying, go to /admin/reports/status/php and look for Loaded Configuration File. That value will point to the php.ini file you should be modifying.

Make sure you are modifying that file.

If that is the file you are modifying, I'd just try restarting the whole server. Either you are only restarting Apache and PHP is not running as a module or there's something else going on like there being an upper limit or the value being overridden in another location.

Noggin answered 17/7, 2021 at 17:41 Comment(0)
C
-1

Just a question (that could be your answer as well): did your server is shared? Does it have enough memory to run the application or at least have enough memory to execute the primary installation commands?

I had the same issue on Magento, but it's because the server it's shared and when I tried using some CI/CD script to deploy the application on the server the composer was breaking due to the memory heap.

But anyway the issue could be following reasons:

  • Your server doesn't have enough memory.
  • The php.ini configuration is setting a maximum memory cap of usage.

Sometimes could be too the library since is taking soo long to install (due to internet connections or the online repository facing issues) and the PHP is hanging waiting for the installation to done and since it takes more time more memory is being used.

Anyway, the error indicates that for the operation that you're trying to do you don't have enough memory for the same.

Cannes answered 2/7, 2021 at 8:38 Comment(1)
There's definitely more than enough memory available and I have also checked the php.ini for anything that I thought could be related to the issue. I'll try installing the system manually on a non-Plesk system now, just to narrow down the problem a little more.Triggerfish

© 2022 - 2024 — McMap. All rights reserved.