Skip to content

cache:pool:clear --all command fails in a prod environment #53551

@LiquidPL

Description

@LiquidPL

Symfony version(s) affected

7.0.2, 6.4.2

Description

When trying to clear cache pools using the cache:pool:clear --all command while in a production environment (i.e. APP_ENV=prod), the command fails with the following error on Symfony 6.4:

In Container.php line 249:
                                                                                                                                                                                                              
  The "cache.annotations" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection   
  instead.                                                                                                                                                                                                    
                                                                                                                                                                                                              

cache:pool:clear [--all] [--exclude EXCLUDE] [--] [<pools>...]

Failed to execute command bin/console cache:pool:clear --all: exit status 1

And on Symfony 7.0:

In Container.php line 240:
                                                                                                                                                                                                               
  The "cache.asset_mapper" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection   
  instead.                                                                                                                                                                                                     
                                                                                                                                                                                                               

cache:pool:clear [--all] [--exclude EXCLUDE] [--] [<pools>...]

Failed to execute command bin/console cache:pool:clear --all: exit status 1

Both of these happen only in the prod env, the dev env works perfectly fine.

How to reproduce

  1. Create a new webapp installation of the app from symfony/skeleton.
  2. Change APP_ENV to prod.
  3. Attempt to run the cache:pool:clear --all command.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy