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)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justcaldwell created an issue. See original summary.

AaronBauman’s picture

Came 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

AaronBauman’s picture

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

Status: Needs review » Needs work
AaronBauman’s picture

Status: Needs work » Needs review
justcaldwell’s picture

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

fishfin’s picture

Got 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`.

paulocs’s picture

Thanks! I'll fix it and create a new release.

andy-blum’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #3 works for me

paulocs’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
848 bytes
684 bytes

Hello, 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.

Status: Needs review » Needs work
paulocs’s picture

Status: Needs work » Needs review
AaronBauman’s picture

LGTM

  • paulocs committed 5bc4325 on 8.x-4.x
    Issue #3170929 by paulocs, AaronBauman, justcaldwell, fishfin, andy-blum...
paulocs’s picture

Status: Needs review » Fixed

Fixed in dev branch!

New release will be created.
Thanks!

paulocs’s picture

New 8.x-4.0-beta4 release was created.
See: https://www.drupal.org/project/context/releases/8.x-4.0-beta4

Cheers, Paulo.

Stephen Ollman’s picture

I can confirm that after doing an initial update to 4.0-beta3 and getting a WSO,D, appling 4.0-beta4 correct the issue.

Status: Fixed » Closed (fixed)

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