Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Upon updating to 4.0-beta3 (via composer), our site crashes with the error below. Still investigating, but I'm initially assuming it has something to do with #3018331: Install fails if module Menu Trail by Path is installed, as the error references code introduced to ContextServiceProvider.php in that issue. Perhaps a cache rebuild would help, but I can't easily do that as Drush is also failing with a similar error.
We do not use Menu Trail by Path.
The website encountered an unexpected error. Please try again later.
Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in Drupal::getContainer() (line 130 of /var/www/docroot/core/lib/Drupal.php).
Drupal::getContainer() (Line: 158)
Drupal::service('menu.active_trail') (Line: 19)
Drupal\context\ContextServiceProvider->alter(Object) (Line: 30)
Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass->process(Object) (Line: 140)
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object) (Line: 789)
Symfony\Component\DependencyInjection\ContainerBuilder->compile() (Line: 1335)
Drupal\Core\DrupalKernel->compileContainer() (Line: 916)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 477)
Drupal\Core\DrupalKernel->boot() (Line: 707)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff.txt | 684 bytes | paulocs |
#10 | context-ContainerNotInitializedException-3170929-9.patch | 848 bytes | paulocs |
#3 | context-service_provider_bootstrapping_problem-3170929-3.patch | 910 bytes | AaronBauman |
Comments
Comment #2
AaronBaumanCame here to report same.
Getting this error after updating from 4.0-beta2 to beta3
Downgrading back to beta2 fixed the issue.
Also not using menu trail by path
Comment #3
AaronBaumanI'm assuming the problem is calling Drupal::service while the service definitions are being compiled.
Let's see if a simple string compare works instead.
Comment #5
AaronBaumanComment #6
justcaldwellThanks @AaronBauman -- #3 corrected the issue for me, and Context seems to be functioning as expected. I can't speak to whether or how this change might affect the original issue.
Comment #7
fishfin CreditAttribution: fishfin as a volunteer commentedGot the same error today morning on beta3, reverted back to beta2 version. I got errors in Drupal, update.php as well as `drush cache:clear`.
Comment #8
paulocsThanks! I'll fix it and create a new release.
Comment #9
andy-blumPatch in #3 works for me
Comment #10
paulocsHello, I created a new patch because patch #3 removes the functionality committed on issue #3018331: Install fails if module Menu Trail by Path is installed.
Please review it.
Cheers, Paulo.
Comment #12
paulocsComment #13
AaronBaumanLGTM
Comment #15
paulocsFixed in dev branch!
New release will be created.
Thanks!
Comment #16
paulocsNew 8.x-4.0-beta4 release was created.
See: https://www.drupal.org/project/context/releases/8.x-4.0-beta4
Cheers, Paulo.
Comment #17
Stephen OllmanI can confirm that after doing an initial update to 4.0-beta3 and getting a WSO,D, appling 4.0-beta4 correct the issue.