symfony: [WebProfilerBundle] Unable to generate a URL for the named route "_profiler_open_file"

Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 4.0.7

After updating to 4.0.7 I am getting this error:

$ bin/console cache:clear --env=test

In srcTestDebugProjectContainerUrlGenerator.php line 106:

  Unable to generate a URL for the named route "_profiler_open_file" as such route does not exist.

@javiereguiluz pointed me to https://github.com/symfony/symfony/pull/26626, so I guess it is connected to that. Didn’t have time to investigate more so I just downgraded to 4.0.6 and it works as expected.

Update: Disabled WebProfilerBundle in test env as I do not need it and 4.0.7 works.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, you have to change the file config/bundles.php et remove the ‘test’ => true for the profiler :

Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true],

And remove the file config/packages/test/web_profiler.yaml

And it works… for now !

Not sure if we’re just weird, but every project I upgrade to 4.0.7 here is now failing CI tests because of this, even a recently started one with just a handful of packages and a single functional test checking that get('/') returns 200.

Considering big projects are doing stuff like https://github.com/pamil/Sylius/commit/65fe5f12aa482a8c2a4b0880fc0b4ce5e1090ac8 I’d recommend releasing a 4.0.8 shortly, and possibly even yanking 4.0.7.

If I see correctly, 4.0.8 is tagged, so you can upgrade 😄