Problem/Motivation

I've tried the following. I've created a boolean parameter in eca_parameters (admin/config/workflow/eca/parameters). After that i've locked the collection from within eca_parameters. after that i've added a different parameter type which was successfully created (unfortunately i am not sure anymore which). After that i wanted to unlock the collection again. the page load took unusually long and ended in:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/web/core/lib/Drupal/Core/Database/StatementWrapper.php on line 95

i then went to admin/config/parameters and clicked the edit ECA collection button. i ran into a slightly different error:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1003520 bytes) in /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php on line 114

i am still able to edit the global collection and apply the same steps. create a parameter, lock the global collection, add another parameter, and finally successfully unlock the collection again. same for an entirely new collection i was able to create and apply those steps. everything behaves as expected. the only collection having a problem is the eca one.

if i take a look into the logs i get the following warning pretty frequently

Location	https://ecatest.ddev.site/admin/config/parameters
Referrer	https://ecatest.ddev.site/admin/config/parameters/global/lock
Message	Theme hook big_pipe_interface_preview not found.

but it always refers to the global/lock not anything with eca in the route what i would have expected. its a bit odd. no idea how i could debug that further :(

i am running an install of drupal 10.1.x-dev in ddev locally with php8.2 & mariadb 10.5. aside that i am running eca 1.1.x-dev, bpmn 1.1.x-dev, eca parameters 1.0.0, eca parameters ui 1.0.0, parameters 1.0.0 and parameters ui 1.0.0 and danse 2.2.x-dev@dev

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

rkoller created an issue. See original summary.

rkoller’s picture

after some sleep i've retried to access the eca collection via the parameters tab in eca. the computer was shut down over night. so after starting up colima and the ddev project i got the following on the first try:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php on line 524

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/web/core/lib/Drupal/Core/Database/StatementWrapper.php on line 95

Warning: Undefined array key 0 in /var/www/html/web/core/lib/Drupal/Core/Utility/Error.php on line 122

Warning: Undefined array key "file" in /var/www/html/web/core/includes/errors.inc on line 77

Warning: Undefined array key "line" in /var/www/html/web/core/includes/errors.inc on line 78

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/web/core/lib/Drupal/Core/Database/StatementWrapper.php on line 95

when accessing the eca collection via the parameters collection list edit button afterwards i got again the following:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1003520 bytes) in /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php on line 114

also the same short fatal error when i tried to access the collection via the parameters tab in eca a second time.

mxh’s picture

Title: Fatal error after trying to unlock the ECA collection » Memory limit exceeded after trying to unlock the ECA collection
Version: 1.0.0 » 1.0.x-dev
Status: Active » Postponed (maintainer needs more info)

I can't reproduce this, also not with the ECA collection.

What I need is in which order which types of parameters were added.
Alternatively, you could upload the file "parameters.collection.eca.yml" of your exported configuration, for example with drush cex. Or via UI at /admin/config/development/configuration/single/export, where you can choose "Parameters collection" -> "ECA (eca)" and upload its contents as a text file here (please don't copy-paste into the comment, because its formatting is not helpful for reading).

rkoller’s picture

okaaaay i havent thought about exporting the config. but that was still working. excellent idea!

<code>uuid: 79a946db-8298-42ec-9b19-e51c72bb224b
langcode: en
status: true
dependencies:
  config:
    - parameters.collection.eca
_core:
  default_config_hash: rtC3O6Xz0u5W0G0kCAyDFbZwO2xFwT5mbwE6KqAt4ls
id: eca
label: ECA
locked: false
deletable: false
parameters:
  boolvalue:
    name: boolvalue
    label: boolvalue
    description: 'bool value'
    type: boolean
    weight: 1
    value: true
  try:
    name: try
    label: try
    description: eserf
    type: reference
    weight: 2
    target_id: eca
    target_name: boolvalue

it was the referenced parameter parameter type. back then the steps were as described in the issue summary. i've created the boolean value. then locked the eca collection. then added the referenced parameter one. saved and then tried to unlock the collection. and from that point on i ran into the issues.

i've tried now on another page to simply add the referenced parameter, used eca as the target collection, and used all as the target parameter. after that i tried to lock the collection and directly ran into the error (so it doesnt matter in which way it is to lock or to unlock the collection).

mxh’s picture

Assigned: Unassigned » mxh
Status: Postponed (maintainer needs more info) » Active

Ah, the reference one :) Now I can reproduce and will have a look.

  • mxh committed 59b7ca63 on 1.0.x
    Issue #3339083 by rkoller, mxh: Memory limit exceeded after trying to...
mxh’s picture

Assigned: mxh » Unassigned
Status: Active » Needs review

I've pushed a possible fix into 1.0.x. If you could try it out for the specific collection posted in #4 (and maybe others) that would be helpful.

I've changed the form to add referenced parameters in the way, that someone cannot reference to all parameters of the same collection again. But that's part of the form validation. So if you already did this on another site, this fix doesn't cover that (the configuration needs to be manually deleted then).

mxh’s picture

rkoller’s picture

i've tried to lock and unlock the collection in the project i first ran into the issue. it works now without exceeding the memory limit. and the - all - got removed if you trying to add a parameter within the target collection you are in. i would suggest two extra steps.
first would it be possible to have conditional description for the target parameter select field? because in case the parameter is added to the same collection the -all- option got removed with your fix. In that case the current description When choosing - All - then all parameters of the whole target collection are being referenced. is misleading and potentially confusing.
and i would also update the error message by providing a suggestion how to fix the error when save is clicked while the -select- option is selected. if a user hasn't created a parameter yet and creates a referenced parameter as the first parameter then the target parameter select list has -select- as the only option. if you click save there with for example eca as the target collection you get 1 error has been found: Target collection as the error message. maybe change the error to something like the following in case no parameters are available for the selected target collection yet: The target collection doesn't contain any parameter to select from yet. Create a parameter first.. If there are one or more parameters available and the users selected -select- anyway by accident use something like that: No parameter selected in the target collection.

  • mxh committed 5897e49a on 1.0.x
    Issue #3339083 by rkoller, mxh: Memory limit exceeded after trying to...
mxh’s picture

Thanks for providing the valuable feedback. I've totally overlooked the description with the -All- selection. I've pushed another commit that addresses #9. Hope this is what you had in mind.

mxh’s picture

Status: Needs review » Fixed

Assuming to be fixed, feel free to re-open if not.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rkoller’s picture

woops sorry for the late reply. too many things in parallel the last few weeks. i thiiink i've tested it back then and simply forgot to reply in the issue in the end. but wanted to make sure and quickly retest tonight. but ran into another error in another module when i've updated the outdated composer dependencies of my test install. :/ will provide a feedback as soon as i am able to access my site and am able to retest.

mxh’s picture

No worries, report back anytime you want.