Deploy symfony 5 app on heroku with pre-warmed production cache

After deployments of an app based on Symfony (5.1.7) on heroku we occasionally see the following error in the logs:

PHP Fatal error: require(): Failed opening required
‘/app/var/cache/prod/doctrine/orm/Proxies/__CG__AppEntityMyEntity.php’

My interpretation is, that the app gets deployed with a cold production cache and gets hit by traffic before cache warmup is completed.

Does that interpretation make sense?

We currently don’t have any postdeploy scripts configured (for production) nor a "release phase" script.

And I cannot find any resources on this. What is the best practice to deploy a symfony app with a pre-warmed prod cache on Heroku?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *