Just got something similar to this issue. At first, I thought it's because of 2 Events but then, when I narrowed down to only one event which is PreLoad Content Entity With this event, I immediately got 503 error :
Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Also, try drush cr and got "Segmentation fault"
Also try with -any- , Content: Article and many more to make it more specific but always got 503 Error if I put this event in the model.
Below is the error I got from Server log :
[Tue Apr 18 18:05:46.970961 2023] [proxy_fcgi:error] [pid 17691:tid 140248491009792] (104)Connection reset by peer: [client x.x.x.x:0] AH01075: Error dispatching request to :
- 🇩🇪Germany jurgenhaas Gottmadingen
I can't reproduce this. Is this happening when you just add that event or is there also any action happening afterwards in the ECA model?
- 🇩🇪Germany mxh Offenburg
We've encountered the same problem using the "Load content entity" event. It was used by accident, but when saving the model it broke the whole site. The only exist problem was using the kill switch as documented here: https://ecaguide.org/eca/troubleshooting/
I think that event is extremely dangerous, maybe we should consider removing it? Or we need a solid mechanic for that event that it doesn't lead to that problem.
- 🇩🇪Germany jurgenhaas Gottmadingen
Hmm, are we talking about
PreLoad Content Entity
orLoad Content Entity
?I have a model that contains both, and I don't see any crash. Therefore, my question, is there any action following the event or is it just the presence of the event.
@jurgenhaas, I just added "PreLoad Content Entity", and save it, once I saved, my site went down immediately. Need kill switch to get back online.
Also, just tested "Load Content Entity", site went down too but with different error :
[Tue Apr 18 19:06:41.571995 2023] [proxy_fcgi:error] [pid 17693:tid 140248440653568] [client x.x.x.x:0] AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /xxx/domains/xx.xxx.com/public_html/core/lib/Drupal/Core/Cache/DatabaseBackend.php on line 167'
- 🇩🇪Germany mxh Offenburg
I don't remember exactly, but I think it was just the presence of the event that led to the error. I think it was then the error as @abx posted in #10.
- 🇩🇪Germany jurgenhaas Gottmadingen
I'm having a hard time reproducing this. Can we make this somehow reproducible?
- 🇩🇪Germany mxh Offenburg
At least I get an error (a different one) on a fresh Drupal installation having some ECA modules installed: Created one start event with "Load content entity" for entity type User, and having one successor action "Display a message to the user".
The error I get then is:
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "eca.service.condition", path: "eca.service.condition". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Think the problem most likely occurs when using the load event on user entities.
I think I just found what cause this problem. (In my case) It's about Log Level. I can set to anything except "Debug". If I set Log Level to "Debug", then, error will appear.
- 🇩🇪Germany jurgenhaas Gottmadingen
Confirmed, the log level set to debug is causing this. I'll have a look.
- last update
over 1 year ago 284 pass - @jurgenhaas opened merge request.
- Status changed to Needs review
over 1 year ago 9:27am 19 April 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
The debug log ended up in a recursion, i.e. there is a chance that getting data from the token system, an entity needs to get loaded, and that triggers another "Entity: load" event, which again triggers a debug log.
This MR adds a simple recursion prevention mechanism and it seems to be working here,
Just tested patch #16 and I don't get any error with Log Level "Debug" anymore.
Thanks jurgenhaas,
- 🇩🇪Germany jurgenhaas Gottmadingen
If we got this one to RTBC, it may be time for another release for ECA 1.1.x
I think I found another problem after patched. If I put Preload Content Entity / Load Content Entityinto the model, it's still working, but once I point it to an action. (Here is Display A Message to The User) The only text to display is "Test". Then, the error below appear :
[Wed Apr 19 17:53:52.516161 2023] [proxy_fcgi:error] [pid 10665:tid 140248222541568] [client xxx.xxx.xxx.xxx:0] AH01071: Got error 'PHP message: Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceCircularReferenceException: "Circular reference detected for service "eca.service.condition", path: "eca.service.condition"." at /xxx/xx.xxx.com/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php line 147', referer: https://xx.xxx.com/
- Status changed to Needs work
over 1 year ago 11:41am 19 April 2023 - 🇩🇪Germany mxh Offenburg
Yes, the problem is that the
eca.service.condition
service is being loaded for evaluating the event to apply, and it is loading a user entity within its constructor:$this->currentUser = $entity_type_manager->getStorage('user')->load($account_proxy->id());
Thus we'll get a recursion on service instantiation on that circumstance.
- 🇩🇪Germany jurgenhaas Gottmadingen
This
currentUser
is only used for conditions, that have anentity:user
context definition data type. AFAIK tell, that's not used anywhere, and we should be able to remove this from the conditions services. What do you think? - last update
over 1 year ago 284 pass - @mxh opened merge request.
- Status changed to Needs review
over 1 year ago 6:18pm 19 April 2023 - 🇩🇪Germany mxh Offenburg
Yes, it looks like a leftover from back when we used core condition plugins. Created MR348 that removes the current user as suggested in #22. Then the error from #20 should be gone, at least that's the case on my environment ATM.
- Status changed to RTBC
over 1 year ago 8:35pm 19 April 2023 Just tested by applied both patches (#16, #23) , no more error. Everything seems to work great now.
Thanks mxh, jurgenhaas
- 🇩🇪Germany jurgenhaas Gottmadingen
Thanks @mxh for cleaning this up. I tend to keep the service declaration as is for the 1.1.x branch, just to not break stuff if the cache didn't get rebuild immediately. But for 1.2, we take the full cleanup. Hope that's OK?
- last update
over 1 year ago 284 pass -
jurgenhaas →
committed eb831079 on 1.2.x authored by
mxh →
Issue #3332070 by jurgenhaas, mxh, NicholasS, abx: WSOD when adding...
-
jurgenhaas →
committed eb831079 on 1.2.x authored by
mxh →
- last update
over 1 year ago 284 pass -
jurgenhaas →
committed 6a1a9d31 on 1.2.x
Issue #3332070 by jurgenhaas, mxh, NicholasS, abx: WSOD when adding...
-
jurgenhaas →
committed 6a1a9d31 on 1.2.x
- 🇩🇪Germany mxh Offenburg
Yes it's fine, then the constructor arguments also need to remain the same.
-
jurgenhaas →
committed 3f4017b7 on 1.1.x
Issue #3332070: Only partially back port MR!348
-
jurgenhaas →
committed 3f4017b7 on 1.1.x
-
jurgenhaas →
committed bee88638 on 1.1.x authored by
mxh →
Issue #3332070 by jurgenhaas, mxh, NicholasS, abx: WSOD when adding...
-
jurgenhaas →
committed bee88638 on 1.1.x authored by
mxh →
-
jurgenhaas →
committed 7f47dd7b on 1.1.x
Issue #3332070 by jurgenhaas, mxh, NicholasS, abx: WSOD when adding...
-
jurgenhaas →
committed 7f47dd7b on 1.1.x
- Status changed to Fixed
over 1 year ago 8:02am 20 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.