【发布时间】: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