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'

Issue fork gin_lb-3427805

Command icon 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

mr.pomelov created an issue. See original summary.

esQmo’s picture

You have to update both gin and gin toolbar
composer require drupal/gin_toolbar:^1.0@rc drupal/gin:^3.0@rc
fixed mine that way without roling back

grimreaper’s picture

Status: Needs work » Active

Hi,

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.

grimreaper’s picture

I 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.

grimreaper’s picture

Version: 1.0.0-rc6 » 1.0.x-dev
Assigned: mr.pomelov » grimreaper

grimreaper’s picture

Link 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.

grimreaper’s picture

Status: Active » Needs review

I don't understand PHPStan https://git.drupalcode.org/project/gin_lb/-/jobs/1129623:

Negated boolean expression is always false.

grimreaper’s picture

Assigned: grimreaper » Unassigned

Please try with the MR change.

grimreaper’s picture

Thanks 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.

joelpittet’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Thanks @Grimreaper, this allowed me to deploy after this change without a 500 error regarding that missing service.

  • Grimreaper committed 4035038a on 1.0.x
    Issue #3427805 by Grimreaper, mr.pomelov, joelpittet, mglaman: You have...
grimreaper’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @joelpittet for the RTBC.

Merged.

I will try to do another issue before asking for a new release to unblock people.

Status: Fixed » Closed (fixed)

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