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

Most upvoted comments

Hello. Hours debugging helps figure out what’s going on. How to reproduce: Step 1. Install profiler. composer require --dev symfony/profiler-pack If profiler is installed framework-bundle uses vendor/symfony/framework-bundle/Resources/config/cache_debug.xml instead vendor/symfony/framework-bundle/Resources/config/cache.xml. cache_debug.xml enabled cache_pool_clearer.cache_warmer (Symfony\Bundle\FrameworkBundle\CacheWarmer\CachePoolClearerCacheWarmer) service with tag kernel.cache_warmer and priority 64. Step 2. Create doctrine event subscriber. Create class that have \Twig\Environment dependence in constructor and tag doctrine.event_subscriber Step 3. rm -rf var/cache && php bin/console c:wa

First cache warmer cache_pool_clearer.cache_warmer requires validator.mapping.cache_warmer that requires doctrine.orm.default_entity_manager that requires doctrine.dbal.default_connection that requires our new doctrine event subscriber that requires twig that requires (as extension) \EasyCorp\Bundle\EasyAdminBundle\Router\CrudUrlGenerator that requires \EasyCorp\Bundle\EasyAdminBundle\Registry\DashboardControllerRegistry that generates error because \EasyCorp\Bundle\EasyAdminBundle\Cache\CacheWarmer did not prepared cache yet

It is enough to change the priority, but this solution is not reliable. I haven’t learned yet how \Symfony\Bridge\Twig\Extension\LogoutUrlExtension works similarly Maybe routes should be downloaded lazily? I do not know

I 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

EasyCorp\Bundle\EasyAdminBundle\Cache\CacheWarmer:
        tags:
            - { name: kernel.cache_warmer } 

The same error. There is no error If add to service.yaml:

EasyCorp\Bundle\EasyAdminBundle\Cache\CacheWarmer:
    tags:
        - { name: kernel.cache_warmer }