I wanted to test the latest version of ECA in a fresh install of Drupal 9.3.0. I've first composer required ECA 1.0.x-dev. bpmn_io 1.0.x-dev and Context Stack Beta1.
I've then selected ECA Core, ECA Content, ECA BPMN, ECA Base and BPMN.IO for ECA on the Extend page and hit install. Then I got the notice that Context Stack is a dependency and it is getting installed as well. Which lead right into the following fatal error:
Fatal error: Method Drupal\context_stack\ContextStackTrait::__sleep() cannot take arguments in /var/www/html/web/modules/contrib/context_stack/src/ContextStackTrait.php on line 157
When checking the Extend page afterwards Context Stack is shown installed while the other modules (ECA Core, ECA Content, ECA BPMN, ECA Base and BPMN.IO for ECA) are shown as not installed. I've then uninstalled Context Stack and composer required Context Stack 1.0.x-dev.
I've then went back to the Extend page and only selected Context Stack to install. But again I ran into the identical fatal error from before.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | contextstacktrait_sleep.pdf | 72.15 KB | rkoller |
Comments
Comment #2
mxh commentedThanks for the bug report. Please give some details about your app environment, specifically
If available, please provide a full trace of the logged error. The one-liner doesn't help me reproducing the problem.
Patches that fix the problem are always welcome.
Comment #3
rkollerI am running the install locally in DDEV. The project is set to PHP 8.0.13, nginx/1.20.2 and mysql Ver 15.1 Distrib 10.5.12-MariaDB. After a restart the fatal error is happening on every page load now. So i am unable to access the logging settings.
Unfortunately I am not a developer and never performed a full trace (also uncertain if it is still possible at this point when every page is leading to a white screen). But i've tried the following. Activated xdebug in ddev and added
xdebug_start_trace()in line 157 andxdebug_stop_trace()in line 185 of theContextStackTrait.phpfile(see contextstacktrait_sleep.pdf). Please let me know if that helps and is what you were looking for or if i have to target other parts of the code.and i did one additional test since you've asked about the php version i am using in particular. i've changed the php version from 8.0.13 to 7.4.26 for the ddev project. after a restart the fatal error was gone.
Comment #4
mxh commentedI just want to see the full error message, it's usally logged with its stack trace already within the webserver logs. But thanks for trying to get to the trace :)
I'll try to reproduce the error by using your mentioned PHP version, it's probably a change between the major PHP versions that now doesn't like arguments on magic methods anymore.
Comment #5
mxh commentedConfirming that this error is coming from a change introduced in PHP8: https://wiki.php.net/rfc/magic-methods-signature
Will fix the wrong signatures.
Comment #8
mxh commentedI fixed the wrong signatures. If you have some time, I'd highly appreciate a review from you by testing the latest state of 1.0.x-dev.
Comment #9
rkollerWhile being on 7.4.26 I've uninstalled all ECA modules and Context Stack. I've then set the error message display to "All messages, with backtrace information" for the site. When you've pushed your two commits to the dev branch I've changed back to 8.0.13 and then tried to install the ECA modules and Context Stack modules at once that lead to the fatal error before. It is working now without any complaints.
But I've did one last check and tried to uninstall all the aformentioned modules again. The ECA and bpmn.io related uninstalled without any complaints. But Context Stack ran into an error (is that the kind of stack trace you were looking for which is more helpful in contrast to the one i've posted yesterday?):
I'll set the issue to needs work - but not sure if the error is related to the wrong signatures and the newly introduced changes or if it is unrelated.
Comment #10
mxh commentedThanks for the review.
Yes exactly, thanks!
Could you maybe test it once more, without changing environment settings or anything like that, just navigate through /admin/modules and use the installation and uninstallation process there? And if you encounter the above noted error again, please give me the steps how I can reproduce the error, as I'm currently having a hard time trying to reproduce that error.
Comment #11
rkollerhm i haven't changed anything. the only change to the environment was by switching back to php 8.0.13 and by changing the error display. aside that i haven't changed anything. or do you refer to something else in regards of changing the environment settings?
and the steps are straightforward and are reproducible ( i am able to install and uninstall context stack again and again and the error takes place on uninstall - tried now 6 times in a row overall always the identical result). the steps:
- if you are on
admin/modulesand neither ECA, bpmn.io nor Context Stack is installed simply select Context Stack and install the module- go to
admin/modules/uninstalland select context stack and uninstall- confirm the uninstall
- the aforementioned error takes place but i am able to go directly to
admin/modules/again (just pasted the path in the addressbar) and get the status message that the selected modules have been uninstalled (even though the error page turned up)additionally i've tried something else afterwards:
- reinstalled the context stack module and went to
admin/modules/uninstall, then did adrush cr(since the error message is about caching), then selected the context stack module for uninstall, confirmed the uninstall and the error showed up again. :/Comment #12
mxh commentedI cannot reproduce the error using a standard installation profile of D9.3 with PHP 7.4, installing Context Stack via UI and uninstalling right afterwards. I debugged the assertion code and it doesn't assert to be false, neither when clicking on confirmation button nor after the module got uninstalled.
Some factors that might lead to our different obersvations:
Marking this one here as fixed, will create a follow-up issue regarding the error in #9.
Comment #13
mxh commentedHere is the follow-up: #3257050: AssertionError: Failed to assert that "context_stack:account:..." are valid cache contexts.