Problem/Motivation

After upgrading to Gutenberg 8.x-2.5 and running clear cache I get the following error:

Symfony\Component\DependencyInjection\Exception\RuntimeException: You have requested a non-existent parameter "app.root". in [error]
./vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php:37
Stack trace:
#0 ./vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(60):
Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue(Object(Symfony\Component\DependencyInjection\Definition),
true)
#1 ./vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php(30):
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue(Array, true)
#2 ./vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(39):
Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue(Array, true)
#3 ./vendor/symfony/dependency-injection/Compiler/Compiler.php(140):
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->process(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#4 ./vendor/symfony/dependency-injection/ContainerBuilder.php(789):
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Drupal\Core\DependencyInjection\ContainerBuilder))
#5 ./core/lib/Drupal/Core/DrupalKernel.php(1335):
Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#6 ./core/lib/Drupal/Core/DrupalKernel.php(916): Drupal\Core\DrupalKernel->compileContainer()
#7 ./core/lib/Drupal/Core/DrupalKernel.php(477): Drupal\Core\DrupalKernel->initializeContainer()
#8 ./core/includes/utility.inc(38): Drupal\Core\DrupalKernel->boot()
#9 phar:///usr/local/bin/drush/commands/core/cache.drush.inc(302): drupal_rebuild(Object(Composer\Autoload\ClassLoader),
Object(Symfony\Component\HttpFoundation\Request))
#10 phar:///usr/local/bin/drush/includes/command.inc(422): drush_cache_rebuild()
#11 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#12 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command()
#13 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#14 phar:///usr/local/bin/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#15 phar:///usr/local/bin/drush/includes/startup.inc(465): drush_main()
#16 phar:///usr/local/bin/drush/includes/startup.inc(369): drush_run_main(false, '/', 'Phar detected. ...')
#17 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#18 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#19 {main}

Steps to reproduce

  1. Run on Drupal 8.9.20
  2. Upgrade Gutenberg 8.x-2.5
  3. run clear cache (i.e. drush cr)

Proposed resolution

I'm not really sure how to fix this. I tried changing '%app.root%' in gutenberg.services.yml back to '@app.root' but I was still getting the error. I also tried to load app.root via the ContainerInterface in BlocksLibraryManager.php (because at that point I couldn't really think where else there might be a problem) but I was still getting errors.

I was looking at this as reference for more information about the change of app.root from a service to a container: https://www.drupal.org/node/3080612

Not sure if this matters, but an additional detail is that my Drupal 8 project is a multi-site installation.

Remaining tasks

Pinpoint what's the cause of the bug

User interface changes

NA

API changes

NA

Data model changes

NA

Comments

aseabrook created an issue. See original summary.

i-trokhanenko’s picture

I have the same issue.

aseabrook’s picture

Priority: Major » Critical
marcofernandes’s picture

We missed to change Gutenberg 2.5 core_version_requirement to 9 || 10.

For those using Drupal 8.x, my recommendation is to stay in Gutenberg 2.4, Drupal 8 is no longer supported and version 2.6+ of Drupal Gutenberg will drop support for Drupal 8.

Still, I tried the workaround changing %app.root% to @app.root and it worked.
I tested installing Drupal 8.9.20 and Drupal Gutenberg 2.4. Then upgraded DG to 2.5 and the error appeared. Changed %app.root% to @app.root at the gutenberg.services.yml file, cleared the cache and no more error.

I'm considering doing a release (2.6) just to revert %app.root% to @app.root to facilitate whoever is still using Drupal 8. But keep in mind that 2.7 will drop support for Drupal 8 - this time we'll change the core requirements 😉

marcofernandes’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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