I just have upgraded to symfony 2.7, and have a annoying behaviour.
Some connections in my config.yml are optionables, and describe foreign databases that are not intended to be used in every prod instances.
When doing a cache:clear , it seems that now every connections are checked, even if I don't want them to be active on a particular server.
When setting the --no-warmup option, the problem occurs half the time
php app/console cache:clear --env=prod --no-warmup --verbose
See Question&Answers more detail:os[DoctrineDBALExceptionConnectionException]
An exception occured in driver: SQLSTATE[42000] [1049] Unknown database 'bal_syncrho_database'Exception trace: () at /var/www/ror3/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:103 DoctrineDBALDriverAbstractMySQLDriver->convertException() at /var/www/ror3/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:133 DoctrineDBALDBALException::driverException() at /var/www/ror3/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php:47 DoctrineDBALDriverPDOMySqlDriver->connect() at /var/www/ror3/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:360 DoctrineDBALConnection->connect() at /var/www/ror3/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:429 DoctrineDBALConnection->getDatabasePlatformVersion() at /var/www/ror3/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:389 DoctrineDBALConnection->detectDatabasePlatform() at /var/www/ror3/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:328 DoctrineDBALConnection->getDatabasePlatform() at /var/www/ror3/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:763 DoctrineORMMappingClassMetadataFactory->getTargetPlatform() at /var/www/ror3/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:616 DoctrineORMMappingClassMetadataFactory->completeIdGeneratorMapping() at /var/www/ror3/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:174 DoctrineORMMappingClassMetadataFactory->doLoadMetadata() at /var/www/ror3/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:332 DoctrineCommonPersistenceMappingAbstractClassMetadataFactory->loadMetadata() at /var/www/ror3/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78 DoctrineORMMappingClassMetadataFactory->loadMetadata() at /var/www/ror3/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:216 DoctrineCommonPersistenceMappingAbstractClassMetadataFactory->getMetadataFor() at /var/www/ror3/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:115 DoctrineCommonPersistenceMappingAbstractClassMetadataFactory->getAllMetadata() at /var/www/ror3/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php:69 SymfonyBridgeDoctrineCacheWarmerProxyCacheWarmer->warmUp() at /var/www/ror3/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:48 SymfonyComponentHttpKernelCacheWarmerCacheWarmerAggregate->warmUp() at /var/www/ror3/app/bootstrap.php.cache:2641 SymfonyComponentHttpKernelKernel->initializeContainer() at /var/www/ror3/app/bootstrap.php.cache:2411 SymfonyComponentHttpKernelKernel->boot() at /var/www/ror3/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70 SymfonyBundleFrameworkBundleConsoleApplication->doRun() at /var/www/ror3/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:120 SymfonyComponentConsoleApplication->run() at
/var/www/ror3/app/console:27