【问题标题】:Uncaught Error: Cannot instantiate interface IndexTableRowSizeEstimatorInterface未捕获的错误:无法实例化接口 IndexTableRowSizeEstimatorInterface
【发布时间】:2019-01-23 09:55:13
【问题描述】:

我正在将我们的 magento 2.1.9 升级到 magento 2.2.7。 重新索引 catalog_category_product 时,它会抛出此错误:

[23-Jan-2019 09:49:39 UTC] PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\Framework\Indexer\IndexTableRowSizeEstimatorInterface in /home/don/Web/fabelio22/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /home/don/Web/fabelio22/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#1 /home/don/Web/fabelio22/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...')
#2 /home/don/Web/fabelio22/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Framewo...')
#3 /home/don/Web/fabelio22/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...')
#4 /home/don/Web/fabelio22/vendor/magento/module-catalog/Model/Indexer/Category/Product/Action/Full.ph in /home/don/Web/fabelio22/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111

Magento_Catalog 中的 di.xml 是

<type name="Magento\Catalog\Model\Indexer\Category\Product\Action\Full">
   <arguments>
      <argument name="batchRowsCount" xsi:type="number">100000</argument>
      <argument name="batchSizeManagement" xsi:type="object">Magento\Catalog\Model\Indexer\CategoryProductBatchSize</argument>
   </arguments>
</type>
<virtualType name="Magento\Catalog\Model\Indexer\CategoryProductBatchSize" type="Magento\Framework\Indexer\BatchSizeManagement">
   <arguments>
      <argument name="rowSizeEstimator" xsi:type="object">Magento\Catalog\Model\Indexer\Category\Product\RowSizeEstimator</argument>
   </arguments>
</virtualType>

但是 $rowSizeEstimator 没有注入正确的类。它尝试实例化 \Magento\Framework\Indexer\IndexTableRowSizeEstimatorInterface。生成了/metadata/global.php,但是就像Magento忽略了编译好的di文件一样。

【问题讨论】:

    标签: magento magento2 magento2.2


    【解决方案1】:

    尝试清除缓存和生成目录。

    1. 清除var/generation
    2. 清除var/cache
    3. 运行bin/magento setup:upgradebin/magento setup:di:compile

    注意:如果您使用redis进行缓存,那么您还应该考虑清除redis缓存。

    【讨论】:

    • 我做了,但没有帮助
    • 不。我们推迟了这次升级,直到我们有空闲时间。
    【解决方案2】:

    我遇到过类似的问题,即无法为某些第三方模块实例化接口。
    调试后发现app/etc/config.xml中缺少相应模块的条目,但代码库中存在模块代码的原因。
    在 app/etc/config.xml 文件中手动添加模块条目后,问题得到解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-27
      • 2016-11-16
      • 2015-09-10
      • 1970-01-01
      相关资源
      最近更新 更多