Existing Products not saving after upgrading to Magento 2.3












0















Recently I upgraded My Magento 2.2.6 to 2.3, After upgrading I configured Multi Source Inventory, It is working as expected while creating new products (and products created after upgradation). But it is throwing error while updating old products (which were created before upgrading to 2.3).



Below error is thrown by system while saving old products-




The stock item was unable to be saved. Please try again.




In exception.log there is below log for the error-




main.CRITICAL: The stock item was unable to be saved. Please try
again. {"exception":"[object]
(MagentoFrameworkExceptionCouldNotSaveException(code: 0): The
stock item was unable to be saved. Please try again. at
/magento_root/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187,
Magento\Framework\Exception\CouldNotSaveException(code: 0): Could
not save Source Item at
/magento_root/vendor/magento/module-inventory/Model/SourceItem/Command/Handler/SourceItemsSaveHandler.php:78,
Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity
constraint violation: 1452 Cannot add or update a child row: a foreign
key constraint fails (magento_db.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL), query was: INSERT INTO inventory_source_item
(source_code, sku, quantity, status) VALUES (?, ?, ?, ?) ON
DUPLICATE KEY UPDATE quantity = VALUES(quantity), status =
VALUES(status) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235,
PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key
constraint fails (magento_root.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"}




Does anyone have idea about this issue?










share|improve this question

























  • please check your log files

    – Aasim Goriya
    2 days ago











  • did you checked after indexing ?

    – Aasim Goriya
    yesterday











  • yes I have done that also run all necessary commands

    – Piyush
    yesterday











  • Issue seems must be because of reindexing, please reset reindex and re-index again.

    – Aasim Goriya
    yesterday











  • @AasimGoriya I tried reset and reindex again, still same result

    – Piyush
    yesterday
















0















Recently I upgraded My Magento 2.2.6 to 2.3, After upgrading I configured Multi Source Inventory, It is working as expected while creating new products (and products created after upgradation). But it is throwing error while updating old products (which were created before upgrading to 2.3).



Below error is thrown by system while saving old products-




The stock item was unable to be saved. Please try again.




In exception.log there is below log for the error-




main.CRITICAL: The stock item was unable to be saved. Please try
again. {"exception":"[object]
(MagentoFrameworkExceptionCouldNotSaveException(code: 0): The
stock item was unable to be saved. Please try again. at
/magento_root/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187,
Magento\Framework\Exception\CouldNotSaveException(code: 0): Could
not save Source Item at
/magento_root/vendor/magento/module-inventory/Model/SourceItem/Command/Handler/SourceItemsSaveHandler.php:78,
Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity
constraint violation: 1452 Cannot add or update a child row: a foreign
key constraint fails (magento_db.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL), query was: INSERT INTO inventory_source_item
(source_code, sku, quantity, status) VALUES (?, ?, ?, ?) ON
DUPLICATE KEY UPDATE quantity = VALUES(quantity), status =
VALUES(status) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235,
PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key
constraint fails (magento_root.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"}




Does anyone have idea about this issue?










share|improve this question

























  • please check your log files

    – Aasim Goriya
    2 days ago











  • did you checked after indexing ?

    – Aasim Goriya
    yesterday











  • yes I have done that also run all necessary commands

    – Piyush
    yesterday











  • Issue seems must be because of reindexing, please reset reindex and re-index again.

    – Aasim Goriya
    yesterday











  • @AasimGoriya I tried reset and reindex again, still same result

    – Piyush
    yesterday














0












0








0








Recently I upgraded My Magento 2.2.6 to 2.3, After upgrading I configured Multi Source Inventory, It is working as expected while creating new products (and products created after upgradation). But it is throwing error while updating old products (which were created before upgrading to 2.3).



Below error is thrown by system while saving old products-




The stock item was unable to be saved. Please try again.




In exception.log there is below log for the error-




main.CRITICAL: The stock item was unable to be saved. Please try
again. {"exception":"[object]
(MagentoFrameworkExceptionCouldNotSaveException(code: 0): The
stock item was unable to be saved. Please try again. at
/magento_root/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187,
Magento\Framework\Exception\CouldNotSaveException(code: 0): Could
not save Source Item at
/magento_root/vendor/magento/module-inventory/Model/SourceItem/Command/Handler/SourceItemsSaveHandler.php:78,
Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity
constraint violation: 1452 Cannot add or update a child row: a foreign
key constraint fails (magento_db.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL), query was: INSERT INTO inventory_source_item
(source_code, sku, quantity, status) VALUES (?, ?, ?, ?) ON
DUPLICATE KEY UPDATE quantity = VALUES(quantity), status =
VALUES(status) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235,
PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key
constraint fails (magento_root.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"}




Does anyone have idea about this issue?










share|improve this question
















Recently I upgraded My Magento 2.2.6 to 2.3, After upgrading I configured Multi Source Inventory, It is working as expected while creating new products (and products created after upgradation). But it is throwing error while updating old products (which were created before upgrading to 2.3).



Below error is thrown by system while saving old products-




The stock item was unable to be saved. Please try again.




In exception.log there is below log for the error-




main.CRITICAL: The stock item was unable to be saved. Please try
again. {"exception":"[object]
(MagentoFrameworkExceptionCouldNotSaveException(code: 0): The
stock item was unable to be saved. Please try again. at
/magento_root/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187,
Magento\Framework\Exception\CouldNotSaveException(code: 0): Could
not save Source Item at
/magento_root/vendor/magento/module-inventory/Model/SourceItem/Command/Handler/SourceItemsSaveHandler.php:78,
Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity
constraint violation: 1452 Cannot add or update a child row: a foreign
key constraint fails (magento_db.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL), query was: INSERT INTO inventory_source_item
(source_code, sku, quantity, status) VALUES (?, ?, ?, ?) ON
DUPLICATE KEY UPDATE quantity = VALUES(quantity), status =
VALUES(status) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235,
PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key
constraint fails (magento_root.inventory_source_item, CONSTRAINT
INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code) REFERENCES inventory_source
(source_code) ON DEL) at
/magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"}




Does anyone have idea about this issue?







magento2 admin magento2.3 multi-source-inventory






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 23 hours ago







Piyush

















asked Jan 18 at 14:02









PiyushPiyush

4,80872053




4,80872053













  • please check your log files

    – Aasim Goriya
    2 days ago











  • did you checked after indexing ?

    – Aasim Goriya
    yesterday











  • yes I have done that also run all necessary commands

    – Piyush
    yesterday











  • Issue seems must be because of reindexing, please reset reindex and re-index again.

    – Aasim Goriya
    yesterday











  • @AasimGoriya I tried reset and reindex again, still same result

    – Piyush
    yesterday



















  • please check your log files

    – Aasim Goriya
    2 days ago











  • did you checked after indexing ?

    – Aasim Goriya
    yesterday











  • yes I have done that also run all necessary commands

    – Piyush
    yesterday











  • Issue seems must be because of reindexing, please reset reindex and re-index again.

    – Aasim Goriya
    yesterday











  • @AasimGoriya I tried reset and reindex again, still same result

    – Piyush
    yesterday

















please check your log files

– Aasim Goriya
2 days ago





please check your log files

– Aasim Goriya
2 days ago













did you checked after indexing ?

– Aasim Goriya
yesterday





did you checked after indexing ?

– Aasim Goriya
yesterday













yes I have done that also run all necessary commands

– Piyush
yesterday





yes I have done that also run all necessary commands

– Piyush
yesterday













Issue seems must be because of reindexing, please reset reindex and re-index again.

– Aasim Goriya
yesterday





Issue seems must be because of reindexing, please reset reindex and re-index again.

– Aasim Goriya
yesterday













@AasimGoriya I tried reset and reindex again, still same result

– Piyush
yesterday





@AasimGoriya I tried reset and reindex again, still same result

– Piyush
yesterday










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f258368%2fexisting-products-not-saving-after-upgrading-to-magento-2-3%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f258368%2fexisting-products-not-saving-after-upgrading-to-magento-2-3%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

An IMO inspired problem

Management

Investment