Problem/Motivation
After upgrading from the version gin_lb 1.0.0-rc5 to gin_lb 1.0.0-rc6 i get an error
"Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "gin_lb.context_validator"." at /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/DependencyInjection/Container.php line 157"
because of the error, it is not even possible to execute update.php
Drupal 9.5.11
PHP 8.1.17
Proposed resolution
I solved the problem by rolling back to the old version of the module:
composer require 'drupal/gin_lb:1.0-rc5'
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Capture d’écran du 2024-03-22 11-01-28.png | 321.4 KB | grimreaper |
| #7 | Capture d’écran du 2024-03-22 11-01-16.png | 299.83 KB | grimreaper |
| #7 | Capture d’écran du 2024-03-22 11-00-54.png | 257.23 KB | grimreaper |
| #7 | Capture d’écran du 2024-03-22 11-00-34.png | 221.6 KB | grimreaper |
Issue fork gin_lb-3427805
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
esQmo commentedYou have to update both gin and gin toolbar
composer require drupal/gin_toolbar:^1.0@rc drupal/gin:^3.0@rcfixed mine that way without roling back
Comment #3
grimreaperHi,
This service had been introduced in 1.0.0-rc6: https://git.drupalcode.org/project/gin_lb/-/compare/1.0.0-rc5...1.0.0-rc...
I have not encountered the problem because I always do my updates with CLI: Composer + Drush (updb) and clearing cache with Drush everytime.
I think an update hook to ensure container cache are flushed needs to be implemented. But if the error also prevents to access update.php, for people using update.php to do their updates, update hook or not it will not be possible to execute the update hook I guess. Or if an update hook is present, update.php will be ok.
Comment #4
grimreaperI have tested and being able to reproduce the bug.
Asked on Slack the best way to solve this.
If there is a better solution than having optional service. And how to clear the cache.
Comment #5
grimreaperComment #7
grimreaperLink to Slack question and answers: https://drupal.slack.com/archives/CJ93UNJP4/p1711028844896989
Following it, I have created a MR with the update hook that will just invalide the service container: https://git.drupalcode.org/project/gin_lb/-/merge_requests/84
Unfortunately, I am not able to get the fatal error anymore on the update.php. I witnessed it, but I am not sure of the conditions to reproduce it.
Here are some screenshots of the hooks called during the display of update.php. to see the stacktrace.
I will try to make the service optional to ease the update.
Comment #8
grimreaperI don't understand PHPStan https://git.drupalcode.org/project/gin_lb/-/jobs/1129623:
Comment #9
grimreaperPlease try with the MR change.
Comment #11
grimreaperThanks to @mglaman for the reply on Slack.
Until https://github.com/mglaman/phpstan-drupal/issues/668 is fixed it is normal to ignore the PHPStan error.
Comment #12
joelpittetThanks @Grimreaper, this allowed me to deploy after this change without a 500 error regarding that missing service.
Comment #14
grimreaperThanks @joelpittet for the RTBC.
Merged.
I will try to do another issue before asking for a new release to unblock people.