Problem/Motivation

When updating to 2.6 we notice this error (You have requested a non-existent parameter "app.root".)

Steps to reproduce

  • Run composer update
  • After update all my websites went down. (503 Service Temporarily Unavailable)
  • After investigation we notice blazy module was updated
  • blazy module will be updated from 2.5 to 2.6 (2.6 was released on 7 Feb 2022)
  • Even on drush cr and drush updb the below errir was showing up:
    You have requested a non-existent parameter "app.root".

Symfony\Component\DependencyInjection\Definition Object
(
[class:Symfony\Component\DependencyInjection\Definition:private] => Drupal\blazy\BlazyManager
[file:Symfony\Component\DependencyInjection\Definition:private] =>
[factory:Symfony\Component\DependencyInjection\Definition:private] =>
[shared:Symfony\Component\DependencyInjection\Definition:private] => 1
[deprecated:Symfony\Component\DependencyInjection\Definition:private] =>
[deprecationTemplate:Symfony\Component\DependencyInjection\Definition:private] =>
[properties:Symfony\Component\DependencyInjection\Definition:private] => Array
(
[_serviceId] => blazy.manager
)
[calls:Symfony\Component\DependencyInjection\Definition:private] => Array
(
[0] => Array
(
[0] => setRoot
[1] => Array
(
[0] =>
)
)
[1] => Array
(
[0] => setLanguageManager
[1] => Array
(
[0] => Symfony\Component\DependencyInjection\Reference Object
(
[id:Symfony\Component\DependencyInjection\Reference:private] => language_manager
[invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1
)
)
)
)
[instanceof:Symfony\Component\DependencyInjection\Definition:private] => Array
(
)
[autoconfigured:Symfony\Component\DependencyInjection\Definition:private] =>
[configurator:Symfony\Component\DependencyInjection\Definition:private] =>
[tags:Symfony\Component\DependencyInjection\Definition:private] => Array
(
[_provider] => Array
(
[0] => Array
(
[provider] => blazy
)
)
)
[public:Symfony\Component\DependencyInjection\Definition:private] => 1
[private:Symfony\Component\DependencyInjection\Definition:private] =>
[synthetic:Symfony\Component\DependencyInjection\Definition:private] =>
[abstract:Symfony\Component\DependencyInjection\Definition:private] =>
[lazy:Symfony\Component\DependencyInjection\Definition:private] =>
[decoratedService:Symfony\Component\DependencyInjection\Definition:private] =>
[autowired:Symfony\Component\DependencyInjection\Definition:private] =>
[autowiringTypes:Symfony\Component\DependencyInjection\Definition:private] => Array
(
)
[changes:Symfony\Component\DependencyInjection\Definition:private] => Array
(
[class] => 1
[autoconfigured] => 1
)
[bindings:Symfony\Component\DependencyInjection\Definition:private] => Array
(
)
[errors:Symfony\Component\DependencyInjection\Definition:private] => Array
(
[0] => You have requested a non-existent parameter "app.root".
)
[arguments:protected] => Array
(
[0] => Symfony\Component\DependencyInjection\Reference Object
(
[id:Symfony\Component\DependencyInjection\Reference:private] => entity.repository
[invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1
)
[1] => Symfony\Component\DependencyInjection\Reference Object
(
[id:Symfony\Component\DependencyInjection\Reference:private] => entity_type.manager
[invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1
)
[2] => Symfony\Component\DependencyInjection\Reference Object
(
[id:Symfony\Component\DependencyInjection\Reference:private] => module_handler
[invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1
)
[3] => Symfony\Component\DependencyInjection\Reference Object
(
[id:Symfony\Component\DependencyInjection\Reference:private] => renderer
[invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1
)
[4] => Symfony\Component\DependencyInjection\Reference Object
(
[id:Symfony\Component\DependencyInjection\Reference:private] => config.factory
[invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1
)
[5] => Symfony\Component\DependencyInjection\Reference Object
(
[id:Symfony\Component\DependencyInjection\Reference:private] => cache.default
[invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1
)
)
)

Proposed resolution

  • Only solution i could find is to lock blazy on 2.5
  • run composer update completed and the error disappeared
  • All websites started to work again.
  • Root cause of the issue is still unknown. Any assistance on this topic will be helpful.
CommentFileSizeAuthor
#10 3263027-app-root-10.patch10.31 KBgausarts

Comments

kobusvw created an issue. See original summary.

gausarts’s picture

Thank you.

What is your Drupal version?

The `app.root` service won't be gone till D10:
https://www.drupal.org/node/3080612

The only leftover of `app.root` was in the test which was just fixed 5 hours ago:
https://git.drupalcode.org/project/blazy/-/commit/c57bfaff00ee7b421799b5...

I doubt tests cause issues on updates :)

The only sub-modules which still held this service were Slick and Splide which were also just fixed.

gausarts’s picture

> You have requested a non-existent parameter
Ah, not service, but parameter. That message was pretty similar.

Your Drupal must be below D9, then :)
Try upgrading Drupal first till we provide BC layer.

gausarts’s picture

Title: Release 2.6 - app.root error » Incompatible with Drupal 8, release 2.6 - app.root error
Status: Needs work » Active
gausarts’s picture

FWIW, D8 had EOL for months :)

TBD, two possible solutions:

The only thing that reverted the first was sub-modules haven't been all updated to remove D8.

mably’s picture

Same here, our D8 instances crashed on update.

This latest version should definitely indicate that it requires Drupal 9+.

Lost a few hours on this.

gausarts’s picture

@mably, sorry for inconvenience :)

Next time, please understand one thing:
If I release modules after weekend, it means:

  • I am testing the water,
  • not being confident,
  • need third eyes to catch misses,
  • not ready for massive weekend warriors' attacks.

If you want to help, you are welcome to test them out. If not ready for breakages, please follow weekend warriors path.
This also helps me laser-focus my bug-buster instinct due to nearing weekend, normally where hot fix releases are.

If I release a day or on weekend, I am being confident to welcome weekend warriors.

As far as my experiences, whenever I want to update or upgrade things, I always do two things:

  • I use DEV environments to test them out to not disrupt production.
  • Only if any issues, I use the modules' search boxes seeing if I am not alone.

Back to the OP, I am still thinking about the two options mentioned above.
If anyone are willing to help, I currently don't have D8 to test it out, see the link above for sample from CDN module.

Patches are welcome. Thanks.

bogdog400’s picture

Just wanted to say that this new version is crashing my Drupal 8 site after composer upgrade too.

To debug it, I put in a print_r command in the Symfony injection code to print out the $value in DefinitionErrorExceptionPass.

Any thoughts or suggestions, let me know.

Thx for the upgrade.

Symfony\Component\DependencyInjection\Definition Object ( [class:Symfony\Component\DependencyInjection\Definition:private] => Drupal\blazy\BlazyManager [file:Symfony\Component\DependencyInjection\Definition:private] => [factory:Symfony\Component\DependencyInjection\Definition:private] => [shared:Symfony\Component\DependencyInjection\Definition:private] => 1 [deprecated:Symfony\Component\DependencyInjection\Definition:private] => [deprecationTemplate:Symfony\Component\DependencyInjection\Definition:private] => [properties:Symfony\Component\DependencyInjection\Definition:private] => Array ( [_serviceId] => blazy.manager ) [calls:Symfony\Component\DependencyInjection\Definition:private] => Array ( [0] => Array ( [0] => setRoot [1] => Array ( [0] => ) ) [1] => Array ( [0] => setLanguageManager [1] => Array ( [0] => Symfony\Component\DependencyInjection\Reference Object ( [id:Symfony\Component\DependencyInjection\Reference:private] => language_manager [invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1 ) ) ) ) [instanceof:Symfony\Component\DependencyInjection\Definition:private] => Array ( ) [autoconfigured:Symfony\Component\DependencyInjection\Definition:private] => [configurator:Symfony\Component\DependencyInjection\Definition:private] => [tags:Symfony\Component\DependencyInjection\Definition:private] => Array ( [_provider] => Array ( [0] => Array ( [provider] => blazy ) ) ) [public:Symfony\Component\DependencyInjection\Definition:private] => 1 [private:Symfony\Component\DependencyInjection\Definition:private] => [synthetic:Symfony\Component\DependencyInjection\Definition:private] => [abstract:Symfony\Component\DependencyInjection\Definition:private] => [lazy:Symfony\Component\DependencyInjection\Definition:private] => [decoratedService:Symfony\Component\DependencyInjection\Definition:private] => [autowired:Symfony\Component\DependencyInjection\Definition:private] => [autowiringTypes:Symfony\Component\DependencyInjection\Definition:private] => Array ( ) [changes:Symfony\Component\DependencyInjection\Definition:private] => Array ( [class] => 1 [autoconfigured] => 1 ) [bindings:Symfony\Component\DependencyInjection\Definition:private] => Array ( ) [errors:Symfony\Component\DependencyInjection\Definition:private] => Array ( [0] => You have requested a non-existent parameter "app.root". ) [arguments:protected] => Array ( [0] => Symfony\Component\DependencyInjection\Reference Object ( [id:Symfony\Component\DependencyInjection\Reference:private] => entity.repository [invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1 ) [1] => Symfony\Component\DependencyInjection\Reference Object ( [id:Symfony\Component\DependencyInjection\Reference:private] => entity_type.manager [invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1 ) [2] => Symfony\Component\DependencyInjection\Reference Object ( [id:Symfony\Component\DependencyInjection\Reference:private] => module_handler [invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1 ) [3] => Symfony\Component\DependencyInjection\Reference Object ( [id:Symfony\Component\DependencyInjection\Reference:private] => renderer [invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1 ) [4] => Symfony\Component\DependencyInjection\Reference Object ( [id:Symfony\Component\DependencyInjection\Reference:private] => config.factory [invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1 ) [5] => Symfony\Component\DependencyInjection\Reference Object ( [id:Symfony\Component\DependencyInjection\Reference:private] => cache.default [invalidBehavior:Symfony\Component\DependencyInjection\Reference:private] => 1 ) ) ) The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\RuntimeException: You have requested a non-existent parameter "app.root". in Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue() (line 37 of /var/www/html/bas4/vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php).
Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue() (Line: 60)
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue() (Line: 30)
Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue() (Line: 39)
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->process() (Line: 140)
Symfony\Component\DependencyInjection\Compiler\Compiler->compile() (Line: 789)
Symfony\Component\DependencyInjection\ContainerBuilder->compile() (Line: 1335)
Drupal\Core\DrupalKernel->compileContainer() (Line: 916)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 42)
Drupal\Core\Update\UpdateKernel->initializeContainer() (Line: 477)
Drupal\Core\DrupalKernel->boot() (Line: 65)
Drupal\Core\Update\UpdateKernel->handle() (Line: 28)
gausarts’s picture

Immediate solution till a new hot fix is as the OP said:
> Only solution i could find is to lock blazy on 2.5

gausarts’s picture

Status: Active » Needs review
StatusFileSize
new10.31 KB

Let's see if any misses.

Be sure to run update or clear cache in the least due to changing service arguments.

Let me know if this works for your D8. Thanks.

  • gausarts committed 2d518f9 on 8.x-2.x
    Issue #3263027 by gausarts, kobusvw, mably, bogdog400: Incompatible with...
gausarts’s picture

Status: Needs review » Fixed

We got a new hot fix release to catch up this weekend.

Feel free to re-open if the issue still stands.

Committed. Thank you for contribution.

bogdog400’s picture

I just ran "composer upgrade" and it brought Blazy from 2.5 to 2.6 on my Drupal 8.9.20 site without a problem.

Thx.

bogdog400’s picture

Wait. I spoke too soon. A few pages that broke before are now fine. But then I discovered that some other pages were still broken. And asking drush to updb wasn't working either.

So I tried to apply the patch and got this response:

--2022-02-09 13:01:08--  https://www.drupal.org/files/issues/2022-02-09/3263027-app-root-10.patch
Resolving www.drupal.org (www.drupal.org)... 151.101.210.217
Connecting to www.drupal.org (www.drupal.org)|151.101.210.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10562 (10K) [text/plain]
Saving to: ‘3263027-app-root-10.patch’

3263027-app-root-10.patch          100%[================================================================>]  10.31K  --.-KB/s    in 0s      

2022-02-09 13:01:08 (57.8 MB/s) - ‘3263027-app-root-10.patch’ saved [10562/10562]

root@rptest:/var/www/html/bas4/web/modules/contrib/blazy# git apply *.patch
error: patch failed: tests/src/Traits/BlazyKernelTestTrait.php:43
error: tests/src/Traits/BlazyKernelTestTrait.php: patch does not apply

And here's the error after applying the patch. The main content pages are still failing:


Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException: You have requested a non-existent parameter "app.root". in Drupal\Component\DependencyInjection\Container->getParameter() (line 328 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Drupal\blazy\Plugin\Filter\BlazyFilterBase::create() (Line: 21)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 76)
Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 81)
Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (Line: 76)
Drupal\filter\FilterPluginCollection->initializePlugin() (Line: 54)
Drupal\filter\FilterPluginCollection->getAll() (Line: 83)
Drupal\filter\FilterPluginCollection->sort() (Line: 144)
Drupal\filter\Entity\FilterFormat->filters() (Line: 105)
Drupal\filter\Element\ProcessedText::preRenderText()
call_user_func_array() (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 781)
Drupal\Core\Render\Renderer->doCallback() (Line: 372)
Drupal\Core\Render\Renderer->doRender() (Line: 200)
Drupal\Core\Render\Renderer->render() (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 80)
__TwigTemplate_75d0f22c622b65a9a3faa55e5675cc7340927d2b8e5857c35a80223a6fab4f63->doDisplay() (Line: 453)
Twig\Template->displayWithErrorHandling() (Line: 420)
Twig\Template->display() (Line: 432)
Twig\Template->render() (Line: 64)
twig_render_template() (Line: 384)
Drupal\Core\Theme\ThemeManager->render() (Line: 431)
Drupal\Core\Render\Renderer->doRender() (Line: 444)
Drupal\Core\Render\Renderer->doRender() (Line: 200)
Drupal\Core\Render\Renderer->render() (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 142)
__TwigTemplate_e0759b726fa08deaadeb4eec48e304f5db7ccef4c0332fd87900e018affc4560->doDisplay() (Line: 453)
Twig\Template->displayWithErrorHandling() (Line: 420)
Twig\Template->display() (Line: 432)
Twig\Template->render() (Line: 64)
twig_render_template() (Line: 384)
Drupal\Core\Theme\ThemeManager->render() (Line: 431)
Drupal\Core\Render\Renderer->doRender() (Line: 200)
Drupal\Core\Render\Renderer->render() (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 57)
Drupal\Core\StackMiddleware\Session->handle() (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)

gausarts’s picture

error: patch failed: tests/src/Traits/BlazyKernelTestTrait.php:43
error: tests/src/Traits/BlazyKernelTestTrait.php: patch does not apply

Looks like you have different Blazy codebase than the expected patch?

The patch in #10 wouldn't apply if it were the same as yours. But it did.

To avoid that, try requiring @dev, not applying the patch.

Let me know.

bogdog400’s picture

Well, I solved my problem by stripping out the last few modules that were preventing me from upgrading this site to 9.3.5. Sorry I can't help debug this any more. Thanks for the attention and for continuing to support the module.

drp_distruptor’s picture

Applying patch #10 solved my problem, and saved my day.
PS. As the comment #15, also my instance return the error on the test:

error: patch failed: tests/src/Traits/BlazyKernelTestTrait.php:43
error: tests/src/Traits/BlazyKernelTestTrait.php: patch does not apply
gausarts’s picture

Hm, not sure about that failing patch, then :)

As per https://www.drupal.org/node/2663268/qa:
> PHP 7.3 & MySQL 5.7, D8.9.20 run-tests.sh fatal error disabled, testing configuration no longer available

Looks like a won't fix for D8, but not D9+.
IMHO, we shouldn't worry about D8 tests unless anyone have compelling reasons to re-enact EOLed D8 test bot :)

sershevchyk’s picture

I have the same problem with Drupal 8.9.20. I can't apply patch #10.

drp_distruptor’s picture

@sershevchyk why can't you apply the patch? What is the problem?

tanmayk’s picture

I too got the error while applying the patch. But blazy module seems updated with the changes in patch. Odd.
Could be composer issue? Never seen such behavior before though.

liberatr’s picture

Locking to 2.5 is the only thing I was able to do to get Drupal to bootstrap - I am upgrading a site from an old 8.7.x codebase to 8.9.20 -- once database update is complete, then site can bootstrap with no issues.

thirstysix’s picture

It's fixed with composer require 'drupal/blazy:2.x-dev@dev'
Drupal 8.9.20
Blazy 2.x-dev

I faced the same issue. When i run the composer update..
vendor/bin/drush cr
I have removed vendor folder & removed composer.lock file also.. ran again the composer update. but it shows the below error.
In DefinitionErrorExceptionPass.php line 37:
You have requested a non-existent parameter "app.root".
And I tried /vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php
& print the value a print_r($value) right above the error
& the error is related to Blazy as they mentioned one of the other forums
I have updated the DEV blazy module.. It works, Cheers :)

logeshvaran’s picture

@ThirstySix Thanks!

I updated the Blazy Dev Module. Its working fine

dd 85’s picture

Hello!
Drupal core 8.9.20
Encountered this error when upgrading from Blazy 8.x-2.5 to Blazy 8.x-2.6
Dev version of Blazy 8.x-2.6+15-dev has fixed this bug perfectly.
Thanks.

Status: Fixed » Closed (fixed)

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