I had this error while running phpunit on a symphony project
Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException: You have requested a non-existent parameter "secret_parameter".
The parameter was in a .html.twig file. I attempted to suppress the error by removing the line with "secret_parameter".
The string "secret_parameter" is no longer in my project.
However, if I try to run phpunit, I still get the same error.
Why is that?
I have tried running this line to clear the cache but it has not helped:
php bin/console cache:clear
The full stacktrace of my error is:
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:84
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:200
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:171
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:161
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:161
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:161
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:45
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:104
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:571
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:510
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:132
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:145
/home/jon/NetBeansProjects/spankthatmonkey/tests/HelloWorld/UserBundle/Entity/UserRepositoryTest.php:23
When you do
php bin/console cache:clear
you are clearing the cache for the dev environement.
Phpunit use the test environnement.
You should do
php bin/console cache:clear --env=test
Related
I was using everyday assetic in work (OS: Win7) but today i was runned command: php bin/console assetic:watch and get this error:
[Symfony\Component\Debug\Exception\ContextErrorException] Notice: unserialize(): Error at offset 0 of 25228 bytes
I was try clear cache - don't help.
I not delete any file and in repository that file not exist and this project is on 3 machines (don't have access now only to 1) and everywhere it works...
Nothing was updated or installed to project so far as i know.
So helped delete all files with prefix assetic_watch_* in %LOCALAPPDATA%\Temp\
bin/console assetic:watch --force also cleared for me.
I am trying to generate a new bundle for the OroCRM (Symfony2), but when I am trying to run the following
php app/console cache:clear
this error occur
Fatal error: Call to a member function getProperties() on null in /var/www/platform-application/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaValidator.php on line 239
try this:
sudo php app/console cache:clear
or this:
sudo php app/console cache:clear --force
When I run this command php app/console translation:update es GWDAdminBundle --force --prefix="__" at the terminal I get the following error message:
[Twig_Error_Syntax]
Unexpected token "name" of value "View" ("end of print statement" expected) at line 31
I don't which file is throwing this error, when I look at the log there is nothing remotely close to this, I suspect that it is one of my view files but how do I begin looking? Any ideas?
Many thanks to kix! I was able to debug all of my twig files with the following command:
php app/console twig:lint src/
I have a symfony project. Whenever I run the build command using doctrine keyword I am getting the following error.
Task "doctrine" is ambiguous (doctrine:create-db, doctrine:clean).
Please do tell me, what I am getting this error and how can it be resolved
Somewhere you must executing
$ app/console doctrine
which causes this error. You have to explicitly run task(s), eg.
$ app/console doctrine:create-db
$ app/console doctrine:clean
I'm using Behat,mink in my Symfony2 project,so I follow those tutorials to make installation :
http://extensions.behat.org/symfony2/ , http://extensions.behat.org/symfony2/migrating_from_2.3_to_2.4.html
but when I run this command php behat.phar --init "#YouBundleName",I get this very strange error :
PHP Warning: require(Behat\MinkExtension\Extension): failed to open stream: No such file or directory in phar:///var/www/project/behat.phar/src/Behat/Behat /Extension/ExtensionManager.php on line 112
PHP Fatal error: require(): Failed opening required 'Behat\MinkExtension\Extension' (include_path='.:/usr/share/php:/usr/share/pear') in phar:///var/www/project/behat.phar/src/Behat/Behat/Extension/ExtensionManager.php on line 112
I'm sure I installed the last version of behat and mink mentionned in the second link above and then I made php composer.phar unpdate and cache clear too,but still the same error?
I had the same problem. Forgot you need to install behat/mink-extension as well as behat/mink. For example you might need to run:
php composer.phar require behat/mink-extension:*
Worked for me.
By the way, looks like you got confused by the two installation methods, phar vs composer. I'd go with the composer route because it's easier to update and manage versions. This would mean running php bin/behat ... instead of php behat.phar ....