symfony: ParameterNotFoundException: You have requested a non-existent parameter "kernel.bundles_metadata"

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

I tried deleting the Symfony cache because it is giving me an error and now my web page doesn’t want to start and i am getting the following error: PHP Fatal error: Uncaught Symfony\\Component\\DependencyInjection\\Exception\\ParameterNotFoundException: You have requested a non-existent parameter "kernel.bundles_metadata".

Any help is appreciated as I am trying to sort it out now for 2 days.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 49 (19 by maintainers)

Commits related to this issue

Most upvoted comments

I encounter this problem once

Running the following command seems to fix it composer run post-install-cmd

On Symfony 2.8.22, I had the issue after removing cache directory. Then regenerating the bootstrap.php.cache using the following command resolved the issue -

composer run-script post-update-cmd

so this is not really an “issue”, but was introduced in v3.2.2 via https://github.com/symfony/symfony/commit/fef3146b3b68db7f367f766e046e6ee624ef51fe. This changes need a fresh bootstrap.php.cache. So check your composer update commands or deployment for:

Generating autoload files
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap

Fixed ! I went to the symfony page to see the master branch (github). I copied/pasted app.dev.php and app.php in my debian to start from scratch. After minor customisation (IP), everything is ok with 3.2.4.

My guess: I am using php 7 and now there is a condition to check php version to load or not some caches:

app_dev.php: $kernel = new AppKernel('dev', true); if (PHP_VERSION_ID < 70000) { $kernel->loadClassCache(); }

app.php: $loader = require __DIR__.'/../app/autoload.php'; if (PHP_VERSION_ID < 70000) { include_once __DIR__.'/../var/bootstrap.php.cache'; }

@javiereguiluz did that sir but then still getting this kernel.bundle_metadata.

If you have the proper permissions for the cache/ folder, in theory you could do a rm -fr app/cache/* and then Symfony would recreate the production cache automatically.