'Docker/Symfony5.2 Cache failed to opening required

I have the following error when using prod env :

Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\FatalError: "Compile Error: require(): Failed opening required '/app/var/cache/prod/doctrine/orm/Proxies/__CG__AppEntitySecurityFrontendUser.php' (include_path='.:/usr/local/lib/php')" at /app/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 204 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Compile Error: require(): Failed opening required '/app/var/cache/prod/doctrine/orm/Proxies/__CG__AppEntitySecurityFrontendUser.php' (include_path='.:/usr/local/lib/php') at /app/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:204)"} []

I already tryed:

  • edit all files with auto_generate_proxy_classes to true
  • rm -rf /app/cache + chmod 777
  • app/console cache:warmup --env=prod

this error does not appear with a dev env



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source