1

我们正在从 ORO 3.1.19 迁移到 4.1.2,并且遇到了迁移问题。

$ php bin/console --env=prod oro:migration:load --force --show-queries
Process migrations...
  > Oro\Bundle\EntityExtendBundle\Migration\LoadEntityConfigStateMigration
  > Oro\Bundle\MigrationBundle\Migration\UpdateBundleVersionMigration
  > Oro\Bundle\EntityExtendBundle\Migration\RefreshExtendCacheMigration

    Prepare entity config
    Clear extended entity cache
    Dump the configuration of extended entities to the cache
    Clear entity metadata cache
    Warm   up entity metadata cache

    In RuntimeReflectionService.php line 63:

    Property Oro\Bundle\AttachmentBundle\Entity\Attachment::$account_8d93c122 does not exist

我们尝试清除缓存,实体配置缓存并没有成功

 php bin/console --env=prod oro:entity-config:cache:clear
 php bin/console --env=prod oro:entity-config:cache:warmup

任何帮助或反馈将不胜感激。

谢谢

编辑

我们可以看到,Attachment::$account_8d93c122在初始容器创建期间,Reflection 找到了,但在实体缓存预热期间没有

4

2 回答 2

1

当实体元数据未准备好时,请确保您没有使用原则 ORM 服务(@doctrine、@entity_manager 等)。

通常,在编译器传递或迁移中使用 ORM 时会出现错误。

于 2020-04-13T12:34:06.093 回答
0

解决方案/解决方法是oro:entity-extend:cache:check在缓存清除之前运行

class RefreshExtendCacheMigrationQuery {
// ....
    public function execute(LoggerInterface $logger)
    {
        $this->commandExecutor->runCommand(
            'oro:entity-extend:cache:check',
            [],
            $logger
        );

        $this->commandExecutor->runCommand(
            'oro:entity-extend:cache:clear',
            [],
            $logger
        );
    }
}
于 2020-04-16T21:27:01.683 回答