Oro Platform Error - symfony

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

Related

Command "make:entity" is not defined. Symfony 4.4

when I run
php bin/console make:entity
the output is
[critical] Error thrown while running command ""make:entity"". Message: "Command "make:entity" is not defined.
Did you mean one of these?
make:admin:crud
make:admin:dashboard
make:admin:migration"

Why Travis-CI and composer execute query during clear:cache (Symfony)

I try to configure Travis-ci with symfony (not easy !). When I run composer install, just after download all package, composer try to clear the cache, and execute a SQL query (why?), and, don't find the table (the migration command is after). I don't understand, why composer try to execute a query.
This is the code in travisci.yml:
install:
- cp .env.dist .env
- mysql -e 'create database testing;'
- composer install
after_install:
- php ./bin/console doctrine:migrations:diff
- php ./bin/console doctrine:migrations:migrate --no-interaction
#- php bin/console doctrine:migrations:migrate
#- php bin/console doctrine:fixtures:load -n --env=test
#- ./vendor/bin/simple-phpunit install
- ./bin/phpunit install
and the result :
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! // Clearing the cache for the dev environment with debug
!! // true
!!
!!
!! In AbstractMySQLDriver.php line 62:
!!
!! An exception occurred while executing 'SELECT t0.id AS id_1, t0.created AS
!! created_2, t0.updated AS updated_3, t0.name AS name_4, t0.source AS source_
!! 5 FROM twig_template t0 WHERE t0.name = ? LIMIT 1' with params [{}]:
!!
!! SQLSTATE[42S02]: Base table or view not found: 1146 Table 'testing.twig_tem
!! plate' doesn't exist
!!
!!
!! In PDOStatement.php line 144:
!!
!! SQLSTATE[42S02]: Base table or view not found: 1146 Table 'testing.twig_tem
!! plate' doesn't exist
!!
!!
!! In PDOStatement.php line 142:
!!
!! SQLSTATE[42S02]: Base table or view not found: 1146 Table 'testing.twig_tem
!! plate' doesn't exist
!!
or here in details: https://travis-ci.org/Dannebicque/intranetV3/builds/455840273
Thanks for your help
David

ParameterNotFoundException has been removed, but I still get the error?

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

symfony2.7 FOS USER error on prod

I just try to connect on my website using the app.php with
new AppKernel('prod', false);
and i got an error 500 when login and stay blocked on /login_check.
But if i change it to:
new AppKernel('prod', true);
its work with no problem!!
So i check the prod.log of symfony and here what i found:
[2015-06-24 13:47:11] php.CRITICAL: Fatal Compile Error: require(): Failed opening required '/var/www/html/crm/app/cache/prod/doctrine/orm/Proxies/__CG__dmMembreBundleEntityMembreAuth.php' (include_path='.:/usr/share/pear:/usr/share/php') {"type":64,"file":"/var/www/html/crm/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php","line":209,"level":6143,"stack":[{"function":"getProxyDefinition","type":"->","class":"Doctrine\\Common\\Proxy\\AbstractProxyFactory","file":"/var/www/html/crm/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php","line":119,"args":[]},{"function":"getProxy","type":"->","class":"Doctrine\\Common\\Proxy\\AbstractProxyFactory","file":"/var/www/html/crm/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php","line":2677,"args":[]},{"function":"createEntity","type":"->","class":"Doctrine\\ORM\\UnitOfWork","file":"/var/www/html/crm/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php","line":138,"args":[]},{"function":"hydrateRowData","type":"->","class":"Doctrine\\ORM\\Internal\\Hydration\\SimpleObjectHydrator","file":"/var/www/html/crm/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php","line":48,"args":[]},{"function":"hydrateAllData","type":"->","class":"Doctrine\\ORM\\Internal\\Hydration\\SimpleObjectHydrator","file":"/var/www/html/crm/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php","line":140,"args":[]},{"function":"hydrateAll","type":"->","class":"Doctrine\\ORM\\Internal\\Hydration\\AbstractHydrator","file":"/var/www/html/crm/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php","line":756,"args":[]},{"function":"load","type":"->","class":"Doctrine\\ORM\\Persisters\\BasicEntityPersister","file":"/var/www/html/crm/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php","line":196,"args":[]},{"function":"findOneBy","type":"->","class":"Doctrine\\ORM\\EntityRepository","file":"/var/www/html/crm/vendor/friendsofsymfony/user-bundle/Doctrine/UserManager.php","line":68,"args":[]},{"function":"findUserBy","type":"->","class":"FOS\\UserBundle\\Doctrine\\UserManager","file":"/var/www/html/crm/vendor/friendsofsymfony/user-bundle/Model/UserManager.php","line":92,"args":[]},{"function":"findUserByUsername","type":"->","class":"FOS\\UserBundle\\Model\\UserManager","file":"/var/www/html/crm/vendor/friendsofsymfony/user-bundle/Model/UserManager.php","line":108,"args":[]},{"function":"findUserByUsernameOrEmail","type":"->","class":"FOS\\UserBundle\\Model\\UserManager","file":"/var/www/html/crm/vendor/friendsofsymfony/user-bundle/Security/EmailUserProvider.php","line":21,"args":[]},{"function":"findUser","type":"->","class":"FOS\\UserBundle\\Security\\EmailUserProvider","file":"/var/www/html/crm/vendor/friendsofsymfony/user-bundle/Security/UserProvider.php","line":45,"args":[]},{"function":"loadUserByUsername","type":"->","class":"FOS\\UserBundle\\Security\\UserProvider","file":"/var/www/html/crm/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php","line":83,"args":[]},{"function":"retrieveUser","type":"->","class":"Symfony\\Component\\Security\\Core\\Authentication\\Provider\\DaoAuthenticationProvider","file":"/var/www/html/crm/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php","line":70,"args":[]},{"function":"authenticate","type":"->","class":"Symfony\\Component\\Security\\Core\\Authentication\\Provider\\UserAuthenticationProvider","file":"/var/www/html/crm/app/cache/prod/classes.php","line":3077,"args":[]},{"function":"authenticate","type":"->","class":"Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager","file":"/var/www/html/crm/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php","line":96,"args":[]},{"function":"attemptAuthentication","type":"->","class":"Symfony\\Component\\Security\\Http\\Firewall\\UsernamePasswordFormAuthenticationListener","file":"/var/www/html/crm/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php","line":146,"args":[]},{"function":"handle","type":"->","class":"Symfony\\Component\\Security\\Http\\Firewall\\AbstractAuthenticationListener","file":"/var/www/html/crm/app/cache/prod/classes.php","line":2992,"args":[]},{"function":"onKernelRequest","type":"->","class":"Symfony\\Component\\Security\\Http\\Firewall","file":"/var/www/html/crm/app/cache/prod/classes.php","line":2245,"args":[]},{"function":"call_user_func:{/var/www/html/crm/app/cache/prod/classes.php:2245}","file":"/var/www/html/crm/app/cache/prod/classes.php","line":2245,"args":[]},{"function":"doDispatch","type":"->","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","file":"/var/www/html/crm/app/cache/prod/classes.php","line":2178,"args":[]},{"function":"dispatch","type":"->","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","file":"/var/www/html/crm/app/cache/prod/classes.php","line":2339,"args":[]},{"function":"dispatch","type":"->","class":"Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher","file":"/var/www/html/crm/app/bootstrap.php.cache","line":3083,"args":[]},{"function":"handleRaw","type":"->","class":"Symfony\\Component\\HttpKernel\\HttpKernel","file":"/var/www/html/crm/app/bootstrap.php.cache","line":3056,"args":[]},{"function":"handle","type":"->","class":"Symfony\\Component\\HttpKernel\\HttpKernel","file":"/var/www/html/crm/app/bootstrap.php.cache","line":3207,"args":[]},{"function":"handle","type":"->","class":"Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel","file":"/var/www/html/crm/app/bootstrap.php.cache","line":2429,"args":[]},{"function":"handle","type":"->","class":"Symfony\\Component\\HttpKernel\\Kernel","file":"/var/www/html/crm/web/app.php","line":28,"args":[]},{"function":"{main}","file":"/var/www/html/crm/web/app.php","line":0,"args":[]}]} []
[2015-06-24 13:47:11] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening required '/var/www/html/crm/app/cache/prod/doctrine/orm/Proxies/__CG__dmMembreBundleEntityMembreAuth.php' (include_path='.:/usr/share/pear:/usr/share/php')" at /var/www/html/crm/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 209 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 0): Compile Error: require(): Failed opening required '/var/www/html/crm/app/cache/prod/doctrine/orm/Proxies/__CG__dmMembreBundleEntityMembreAuth.php' (include_path='.:/usr/share/pear:/usr/share/php') at /var/www/html/crm/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209)"} []
Off course i first think about chmod on my cache directory but evrything is on 777 recursivly... and working like a charm if i dont set the debug on false!
So if anyone have an idea...
Found the answer
Before go on prod, we need to warm the prod cache to completely delete so before delete of the cache folder we have to execute this command:
php app/console cache:warmup --env=prod --no-debug
and after:
rm -rf app/cache/*; chmod -R 777 app/cache
And that's all folks!

Symfony console error

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

Resources