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
Related
I have command:
php bin/console doctrine:schema:validate -e prod
When I run it, I'm getting error
"Call to a member function listSpatialIndexes() on null".
Please, help me by explain why it happens and how to fix it.
Additionally, the command "php bin/console doctrine:schema:validate -e dev", ends with the error
"[ERROR] The database schema is not in sync with the current mapping
file."
The problem was that variable server_version in pgsql in doctrine.yaml didn't exist. To resolve the problem, add
pgsql:
...
server_version: <insert your server version here, in my case 11.3>
You can see server's version by adding echo($this->getServerVersion()) and then exit(1) in the line 452 in vendor's file vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php.
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
Excuse my english, i am french. I have a error when i install fos User bundle of symfony2.
I follow all instructions on this page : http://symfony.com/doc/current/bundles/FOSUserBundle/index.html
When i do this command : php bin/console doctrine:schema:update --force, i have a error.
This is my error :
Fatal error: Class 'Symfony\Component\Console\Input\ArgvInput' not found in C:\P
rogram Files\EasyPHP-DevServer-14.1VC9\Ecommerce\app\console on line 19
Help me please
It's late but it could help others people who are facing the same problem.
It seems like you are missing a component. I would suggest trying a "composer update" (I don't think it will work) in this case, i will be a bit more brutal and delete my vendor folder and reinstall everything with a "composer install".
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 am on part Updating the blog entity where i need to load the fixtures with command:
$ php app/console doctrine:fixtures:load
but i get an error:
php app/console doctrine:fixtures:load
> purging database
> loading Blogger\BlogBundle\DataFixtures\ORM\BlogFixtures
> loading Blogger\BlogBundle\DataFixtures\ORM\CommentFixtures
[ErrorException]
Warning: file_put_contents(/home/helloises/symfony2/Symfony/app/cache/dev/doctrine/orm/Proxies/Blogge rBlogBundleEntityBlogProxy.php): failed to open stream: Permission denied in
/home/helloises/symfony2/Symfony/vendor/doctrine/lib/Doctrine/ORM/Proxy/ProxyFactory.php
line 155
please help?
thanks
This is a permission error:
You don't have the write permission in the app/cache/dev/doctrine/orm/Proxies directory of your project so doctrine fails to create its proxy classes.
Maybe you gave the write permission to your HTTP server user (so the web works) but not to the user you used to execute the command.
See the Setting up Permissions paragraph in http://symfony.com/doc/current/book/installation.html#configuration-and-setup