symfony 5 - 作曲家更新后不工作(缓存问题)

symfony5 - not working after composer udpate (cache issue)

我的网站自 composer update 后关闭。问题似乎不在更新包本身上(我 运行 它们在开发环境中也没有问题)。似乎 'only' 缓存无法正确清理自身。

Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"

Prefetching 9 packages  
  - Downloading (100%)

Package operations: 0 installs, 51 updates, 3 removals
  - Removing symfony/uid (v5.1.8)
  - Removing symfony/polyfill-uuid (v1.20.0)
  - Removing easycorp/easyadmin-bundle (v3.1.9)
  - Updating symfony/flex (v1.10.0 => v1.11.0): Loading from cache
  - Updating symfony/routing (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/http-foundation (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/event-dispatcher (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/var-dumper (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/error-handler (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/http-kernel (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/finder (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/filesystem (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/dependency-injection (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/config (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/var-exporter (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/cache (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/framework-bundle (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/doctrine-bridge (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/string (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/console (v5.1.8 => v5.1.9): Loading from cache
  - Updating doctrine/doctrine-bundle (2.2.1 => 2.2.2): Loading from cache
  - Updating doctrine/inflector (1.4.3 => 2.0.3): Loading from cache
  - Updating doctrine/common (3.0.2 => 3.1.0): Loading from cache
  - Updating doctrine/orm (2.7.4 => 2.8.1): Loading from cache
  - Updating laminas/laminas-code (3.5.0 => 3.5.1): Loading from cache
  - Updating symfony/asset (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/dotenv (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/property-info (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/property-access (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/options-resolver (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/intl (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/form (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/mime (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/mailer (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/security-core (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/security-http (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/security-guard (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/security-csrf (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/security-bundle (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/serializer (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/translation (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/validator (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/yaml (v5.1.8 => v5.1.9): Loading from cache
  - Updating nikic/php-parser (v4.10.2 => v4.10.3): Loading from cache
  - Updating symfony/maker-bundle (v1.24.2 => v1.25.0): Loading from cache
  - Updating symfony/stopwatch (v5.1.8 => v5.1.9): Loading from cache
  - Updating doctrine/migrations (2.3.0 => 2.3.1): Loading from cache
  - Updating symfony/http-client (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/twig-bridge (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/debug-bundle (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/monolog-bridge (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/twig-bundle (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/web-profiler-bundle (v5.1.8 => v5.1.9): Loading from cache
  - Updating symfony/css-selector (v5.1.8 => v5.1.9): Loading from cache
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
84 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

What about running composer global require symfony/thanks && composer thanks now?
This will spread some   by sending a ★  to the GitHub repositories of your fellow package maintainers.

Run composer recipes at any time to see the status of your Symfony recipes.

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!   // Clearing the cache for the prod environment with debug                      
!!   // false                                                                       
!!  
!!  
!!  In ORMException.php line 40:
!!                                                                                 
!!    It's a requirement to specify a Metadata Driver and pass it to Doctrine\ORM  
!!    \Configuration::setMetadataDriverImpl().                                     
!!                                                                                 
!!  
!!  cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
!!  
!!  
Script @auto-scripts was called via post-update-cmd

它说了一些关于 Doctrine\ORM\Configuration::setMetadataDriverImpl() 的事情,但我从未听说过。

知道我能做什么吗?谢谢!


编辑:

如果我将 .env.local 更改为 env=dev,它就会起作用。还有缓存清理。 但是如果我尝试 ./bin/console cache:clear --env=prod,我会得到这个错误:

$ ./bin/console cache:clear --env=prod

In ORMException.php line 40:
                                                                               
  It's a requirement to specify a Metadata Driver and pass it to Doctrine\ORM  
  \Configuration::setMetadataDriverImpl().

编辑 2:

可能与此有关:

config/packages/prod/doctrine.yaml

doctrine:
    orm:
        auto_generate_proxy_classes: false
        metadata_cache_driver:
            type: pool
            pool: doctrine.system_cache_pool
        query_cache_driver:
            type: pool
            pool: doctrine.system_cache_pool
        result_cache_driver:
            type: pool
            pool: doctrine.result_cache_pool
#...

在环境之间切换时,我有时不得不手动删除缓存文件夹。

发生这种情况时,我通常会这样做:

rm -rf var/cache/prod var/cache/dev