PropelBundle icon indicating copy to clipboard operation
PropelBundle copied to clipboard

SF2.7 / SF2.8 + Propel1 / Bad propel init on first call after clear:cache

Open lionelbzv opened this issue 9 years ago • 4 comments

Env:

        "symfony/symfony": "2.7.*" or "2.8.*",
        "propel/propel-bundle": "1.4.*",

The first time I call a page or a SF command line after having clear the cache, I've got this error:

  [PropelException]                                                                      
  No connection information in your runtime configuration file for datasource [default]  


Exception trace:
 () at /var/www/project.test.2.8/vendor/propel/propel1/runtime/lib/Propel.php:583
 Propel::getMasterConnection() at /var/www/project.test.2.8/vendor/propel/propel1/runtime/lib/Propel.php:561
 Propel::getConnection() at /var/www/project.test.2.8/vendor/propel/propel-bundle/Propel/PropelBundle/Security/Acl/MutableAclProvider.php:55
 Propel\PropelBundle\Security\Acl\MutableAclProvider->__construct() at /var/www/project.test.2.8/app/cache/dev/appDevDebugProjectContainer.php:2368
 appDevDebugProjectContainer->getSecurity_Acl_ProviderService() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:312
 Symfony\Component\DependencyInjection\Container->get() at /var/www/project.test.2.8/app/cache/dev/appDevDebugProjectContainer.php:2310
 appDevDebugProjectContainer->getSecurity_Access_DecisionManagerService() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:312
 Symfony\Component\DependencyInjection\Container->get() at /var/www/project.test.2.8/app/cache/dev/appDevDebugProjectContainer.php:2420
 appDevDebugProjectContainer->getSecurity_AuthorizationCheckerService() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:312
 Symfony\Component\DependencyInjection\Container->get() at /var/www/project.test.2.8/app/cache/dev/appDevDebugProjectContainer.php:3562
 appDevDebugProjectContainer->getTwigService() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:312
 Symfony\Component\DependencyInjection\Container->get() at /var/www/project.test.2.8/app/cache/dev/appDevDebugProjectContainer.php:571
 appDevDebugProjectContainer->getCacheWarmerService() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:312
 Symfony\Component\DependencyInjection\Container->get() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:523
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:133
 Symfony\Component\HttpKernel\Kernel->boot() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/project.test.2.8/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:123
 Symfony\Component\Console\Application->run() at /var/www/project.test.2.8/app/console:29

If I recall the page or the command line, it works fine.

Someone have ideas? Thanks.

lionelbzv avatar Aug 13 '15 13:08 lionelbzv

PropelBundle initializes configuration in boot method in PropelBundle.php which seems to be too late in some scenerio. I ran into the same problem when I use propel query in constructor of service that is passed to twig as global variable. Check this out for more details: http://stackoverflow.com/questions/34298976/does-symfony-2-8-load-bundles-and-services-in-correct-order-during-warmup

karasq avatar Dec 15 '15 22:12 karasq

thanks for theses explanations, but as say ryan, "In short: this looks like a quirk of Propel to me, but someone who knows more about Propel might know a way to forcefully "boot" it. Propel is special because of the static context it uses."

So, anybody in the Propel core team have advices about this "boot" issue?

lionelbzv avatar Dec 17 '15 10:12 lionelbzv

Same problem w. a fresh new project in SF2.8, any help welcome.

lionelbzv avatar Jan 22 '16 14:01 lionelbzv

Can you provide an installation with the problem? A PR on https://github.com/havvg/symfony-propel-edition would be awesome :)

havvg avatar Jan 23 '16 16:01 havvg