SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1, query was: INSERT INTO catalog_product_index_price
SELECT ip_tmp
.* FROM catalog_product_index_price_temp
AS ip_tmp
ON DUPLICATE KEY UPDATE tax_class_id
= VALUES(tax_class_id
), price
= VALUES(price
), final_price
= VALUES(final_price
), min_price
= VALUES(min_price
), max_price
= VALUES(max_price
), tier_price
= VALUES(tier_price
)
Add a comment
|
2 Answers
We had the same error logged when running the indexer_update_all_views cron task. Manually reindexing everything fixed the issue.
php bin/magento indexer:reindex
Edit: This issue still occurred, someone else kindly made a fix for it https://github.com/magento/magento2/pull/36370
Composer patch for magento/module-catalog below:
diff --git a/vendor/magento/module-catalog/Model/Indexer/Product/Price/AbstractAction.php b/vendor/magento/module-catalog/Model/Indexer/Product/Price/AbstractAction.php
index e69ab504880ef..219467033ecde 100644
--- a/vendor/magento/module-catalog/Model/Indexer/Product/Price/AbstractAction.php
+++ b/vendor/magento/module-catalog/Model/Indexer/Product/Price/AbstractAction.php
@@ -179,7 +179,8 @@ protected function _syncData(array $processIds = [])
// for backward compatibility split data from old idx table on dimension tables
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
$insertSelect = $this->getConnection()->select()->from(
- ['ip_tmp' => $this->_defaultIndexerResource->getIdxTable()]
+ ['ip_tmp' => $this->_defaultIndexerResource->getIdxTable()],
+ array_keys($this->getConnection()->describeTable($this->tableMaintainer->getMainTableByDimensions($dimensions)))
);
foreach ($dimensions as $dimension) {
Run below commands
php bin/magento setup:db-declaration:generate-whitelist
php bin/magento indexer:reindex
Then run commands upgrade and others
-
I am getting another error while generating the whitelist json.
Warning: Undefined array key "column" in vendor/magento/module-developer/Model/Setup/Declaration/Schema/WhitelistGenerator.php on line 197
When I have tried to debug the reason behind the above error, then found that catalog_category_entity_datetime doesn't have a column key which cause the issue.Array ( [referenceId] => CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY_ID [disabled] => 1 )
Commented Nov 11, 2022 at 9:03 -
It looks like running the generate-whitelist command will throw an error if an extension has disabled an index or constraint via a db_schema.xml file. You can try temporarily commenting out those lines & rerunning the command.– JasutenCommented Nov 18, 2022 at 3:06
-
actual fix is here: github.com/magento/magento2/commit/… Commented Mar 13, 2023 at 2:07