-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
ParameterNotFoundException: You have requested a non-existent parameter "kernel.bundles_metadata" #21646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This parameter was introduced in 2.7.23, 2.8.16, 3.1.9 and 3.2.2 versions. It's created and managed by Symfony ... so it should be created automatically when building the container. Are you doing some advanced things with the container in your app? |
Hi Sir, nope. I am using 2.7.24 version, what I did is just deleted the cache in the prod and then suddenly I got that error. My application is deployed at Apache server. |
@javiereguiluz is it possible to update the vendor folder sir? |
If you have the proper permissions for the |
@javiereguiluz did that sir but then still getting this kernel.bundle_metadata. |
The quick temporary solution is to install the last Symfony version that doesn't include that parameter. Open Then, try to reproduce the error in your local computer. As I said before, this parameter is something that Symfony creates and manages itself automatically ... so Symfony developers should not care about it. |
@kimbab14 Can you please show the output of |
If you don't want to show all packages you are using, for whatever reason, the output of |
using symfony 3.1.10 got the same problem, using centos with apache 2.4, php 5.6.30 (some hosting, i don' have access to a shell... so i don't have composer available) , when i'm in dev ambient (i edited app_dev.php so i can run it in production server), i have no problem at all. I deleted everything inside var/cache/ but in production, i get this error. can't recreate the error on my local, because in my local i have debian, apache 2.4, php 7 so no problems at all. |
I encounter this problem once Running the following command seems to fix it |
Dev in windows 10 with php 7.1.1 (xampp):
|
Amazon Linux AMI 2016.09.1 symfony 3.2.3 => same error |
Anyone willing to provide the output of |
Sorry mistake in my previous message. Not 3.1.2 but 3.2.1: Xampp with php 7.1.1 and |
|
Can you check which bundle is trying to access the parameter? #19586 wasn't part of Symfony version >= 3.2.2 (which also means that no internal Symfony code is accessing this parameter). |
Edit: I think my issue was due to Symfony's Kernel.php being open in my sublime text instance when I upgraded, which would explain why reinstalling worked. I encountered this issue when upgrading Symfony from 3.0.0 to 3.2.2 in my dev environment. I was able to get around it by deleting the The environment remained the same before and after, PHP 7.0.14 with Apache 2.4.23.
|
I am a nooby and dont know how I can check which bundle is trying to access, maybe the complete error helps you? Otherwise please provide how I can check... sorry PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException: You have requested a non-existent parameter "kernel.bundles_metadata". in /var/www/xxxxxxx_1.0/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:100\nStack trace:\n#0 /var/www/xxxxxxx_1.0/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php(56): Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->get('kernel.bundles_...')\n#1 /var/www/xxxxxxx_1.0/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(130): Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag->get('kernel.bundles_...')\n#2 /var/www/xxxxxxx_1.0/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php(972): Symfony\Component\DependencyInjection\Container->getParameter('kernel.bundles_...')\n#3 /var/www/xxxxxxx_1.0/vendor/symfony/symfony/src/Symfony/Bundle/Framewor in /var/www/xxxxxxx_1.0/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php on line 100 |
This looks weird as the code from the FrameworkBundle triggering the issue was not part of the 3.2.1 release. Can you show what happens when you run |
I have just deleted the vendor folder and reinstall everything with symfony 3.2.4 and still the error printed by @jeecode. Only in prod env. composer show:
|
Loading composer repositories with package information
[Symfony\Component\Debug\Exception\ContextErrorException] cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exc 8000 eption [RuntimeException]
cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|- install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] []...
Loading composer repositories with package information
[Symfony\Component\Debug\Exception\ContextErrorException] cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception [RuntimeException]
cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|- |
It's possible that you run into some issues with existing Opcache. Do you experience the issue only when accessing the application over the web or on the CLI as well? Did you make sure to clear the Opcache? |
I am only having the problem on my web-server (in prod environment), locally there is no problem (dev + prod). I am always clearing my cache via remote on the webserver: Locally I just delete the dev or prod directory in /var/cache/. The problem first arised today after clearing the cache, since then I cleared the cache several times for sure but only the downgrade to version 3.2.1 made the error disappear. |
Deleting the cache may not be enough. Try to also clear your Opcache (doing that whenever you deploy your application is a good idea). But note that your CLI and web server environment do not share the Opcache and that you will need to clear them separately (reloading PHP FPM may be the easiest way to do so). |
Yep, that was it! Works now: First I had to delete everything in the cache directory via: Then use the symfony command to clean the cache: [OK] Cache for the "prod" environment (debug=false) was successfully cleared. Important! Then the [RuntimeException] So from now on I will always clean my cache like that: Or maybe even from now on the I didn't use |
Not working for me with symfony 3.2.4 in local (windows 10 with xampp php 7.1.1) |
@Laurent001 What steps did you perform besides clearing the cache? @jeecode The steps you describe are not related to Opcache, but only to Symfony's application cache. And not clearing that cache is indeed a bad idea especially when classes from the framework that have been updated in the |
|
Please make sure to also clear your Opcache to be actually sure that your issue is not related to it (see also #21646 (comment)). |
I have just checked and opcache was not enable in my php 7.1.1. |
Confirming issue on v2.8.17. |
Can anyone of you provide a reproducable example (best based on the Symfony Standard Edition)? And did you all make sure to clear the Opcace (or other similar bytecode caches)? Bear in mind that PHP-FPM (or the PHP Apache module) do not use the same Opcache as the PHP executable on the CLI uses. |
I had same issue in prod with Symfony 2.8.16, resolved by moving back to 2.8.15 |
I have installed a debian jessie (VM) with php 7.0 and symfony 3.2.4. Windows 10 as host. I restart apache, flush opcache but I still have the problem.
|
I don't know how we could help you without a reproducable project. However, could please try to debug why the getKernelParameters() method doesn't seem to get called in your case when the cache is empty or produce the wrong result? |
Fixed ! My guess: app_dev.php: app.php: |
Got the same issue after a composer update
|
so this is not really an "issue", but was introduced in v3.2.2 via fef3146. This changes need a fresh
|
Confirming issue on v2.8.18. |
Did you rebuilt the |
@xabbuh How do I rebuild the bootstrap.php.cache file? I did clear the Opcache |
@xabbuh I copied the |
I am closing the issue as it turns out that in all cases where it was possible to reproduce the issue some kind of cache (being it Opcache or the |
Resolved by clearing opcache after deleting app/bootstrap.php.cache, app/console cache:clear, manually deleting cache files etc. didn't work.
|
I had the same issue. Locally, I updated to Symfony 3.1.10 via composer, and then uploaded the project to the prod environment. Here I received the o.g. Error message. Accessing the app_dev.php the error did not appear. It did not help to clear the cache (file system, console, etc.) Solution: I uploaded the |
On Symfony 2.8.22, I had the issue after removing cache directory.
|
symfony 2.8.30 - deleting |
I'm getting this problem when upgrading from v3.4.2 to v3.4.11. I can't find any |
Im my case i had to install
Before i run above command i removed the cache as well so this could be helping as well to fix it. |
Uh oh!
There was an error while loading. Please reload this page.
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.
The text was updated successfully, but these errors were encountered: