container not initialized yet

Created on 11 February 2024, about 1 year ago

Drupal 10.2.3 upgrade status now sthrows

PHP Fatal error: Drupal\Core\DependencyInjection\ContainerNotInitializedException thrown while calling __toString on a Drupal\Core\StringTranslation\TranslatableMarkup object in /var/www/public_html/core/lib/Drupal.php on line 169: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.

Some calls were to Symfony\Core - some to Drupal\Core - I changed them all to Drupal\Core in Drupal.php - it runs but not fix

I found this sample issue patch from another module that just moves the container initialization, but no cigar https://www.drupal.org/files/issues/2020-09-15/context-ContainerNotIniti... β†’

πŸ› Bug report
Status

Active

Version

10.2 ✨

Component
OtherΒ  β†’

Last updated about 4 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States bobburns

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bobburns
  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Can you turn on verbose debugging via settings.php and provide a stack trace?

  • πŸ‡ΊπŸ‡ΈUnited States bobburns

    Set the config in settings.php but no stack trace beyond this below showed

    PHPStan command failed:
    /usr/bin/php /var/www/public_html/vendor/bin/phpstan analyse --memory-limit=1500M --error-format=json --configuration=/tmp/upgrade_status/deprecation_testing.neon /var/www/public_html/modules/dynamic_entity_reference

    Command output:
    Empty.

    Command error:
    PHP Fatal error: Drupal\Core\DependencyInjection\ContainerNotInitializedException thrown while calling __toString on a Drupal\Core\StringTranslation\TranslatableMarkup object in /var/www/public_html/core/lib/Drupal.php on line 170: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in /var/www/public_html/core/lib/Drupal/Component/Utility/ToStringTrait.php on line 20 Fatal error: Drupal\Core\DependencyInjection\ContainerNotInitializedException thrown while calling __toString on a Drupal\Core\StringTranslation\TranslatableMarkup object in /var/www/public_html/core/lib/Drupal.php on line 170: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in /var/www/public_html/core/lib/Drupal/Component/Utility/ToStringTrait.php on line 20

  • Status changed to Closed: duplicate about 1 year ago
  • This looks like a duplicate.

  • πŸ‡ΊπŸ‡ΈUnited States bobburns

    and yet it was not fixed in rhe duplicate wither

  • πŸ‡¨πŸ‡¦Canada netgeek123

    This is STILL an issue. I have updated from 10.4 to 11.1 as recomended and upgrade status gave the green light. Now, those whole this is throwing random errors to do with \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.....

    As I was googling I noticed this has been an issue when updating for a very very very very very long time. Though, the first time I have run into this issue. So, I am at a loss. I have disabled all the themes and modules to the bare core and stable them. It still throws errors, There must be a way to fix this?

Production build 0.71.5 2024