EasyAdminBundle: After manual deleting cache got error
Describe the bug I removed the cache/dev folder and now I get the error:
[16-Jul-2020 15:03:43 UTC] PHP Warning: Uncaught ErrorException: Warning: require(/var/www/back-end/var/cache/dev/easyadmin/routes-dashboard.php): failed to open stream: No such file or directory in /var/www/back-end/vendor/easycorp/easyadmin-bundle/src/Registry/DashboardControllerRegistry.php:26
All tries to warmup cache give the same error
To Reproduce
rm -rf var/cache/*
php bin/console cache:warmup
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 21
Hello. Hours debugging helps figure out what’s going on. How to reproduce: Step 1. Install profiler.
composer require --dev symfony/profiler-packIf profiler is installed framework-bundle usesvendor/symfony/framework-bundle/Resources/config/cache_debug.xmlinsteadvendor/symfony/framework-bundle/Resources/config/cache.xml.cache_debug.xmlenabledcache_pool_clearer.cache_warmer(Symfony\Bundle\FrameworkBundle\CacheWarmer\CachePoolClearerCacheWarmer) service with tagkernel.cache_warmerand priority64. Step 2. Create doctrine event subscriber. Create class that have\Twig\Environmentdependence in constructor and tagdoctrine.event_subscriberStep 3.rm -rf var/cache && php bin/console c:waFirst cache warmer
cache_pool_clearer.cache_warmerrequiresvalidator.mapping.cache_warmerthat requiresdoctrine.orm.default_entity_managerthat requiresdoctrine.dbal.default_connectionthat requires our new doctrine event subscriber that requires twig that requires (as extension)\EasyCorp\Bundle\EasyAdminBundle\Router\CrudUrlGeneratorthat requires\EasyCorp\Bundle\EasyAdminBundle\Registry\DashboardControllerRegistrythat generates error because\EasyCorp\Bundle\EasyAdminBundle\Cache\CacheWarmerdid not prepared cache yetIt is enough to change the priority, but this solution is not reliable. I haven’t learned yet how
\Symfony\Bridge\Twig\Extension\LogoutUrlExtensionworks similarly Maybe routes should be downloaded lazily? I do not knowI can confirm the bug with S5 + EA3, however I don’t have more informations to provide for now. I temporarily fixed it the way @maxkain did.
And for me too. I have this problem in sf 5.1 and EasyAdmin 3.1. And
The same error. There is no error If add to service.yaml: