2

I have installed Magento 2.2.6 in Google cloud VM. It is a fresh install and when I try to save a simple product, I get the following error:

"Unable to save Stock Item"

My exception log shows the following error:

/var/www/html/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php:183,

I'm stuck in this error and not sure about the solution: I to tried decompile, upgrade, cache clean, cache flush, static deploymenI'mbut I'm unable to solve this issue.

I applied chmod 777 to the /var/www/html/app/code folder but unable to rectify the error.

2
  • Hey you need to run re-indexing first then you need to flush the cache then it should work. Commented Nov 20, 2018 at 7:20
  • Thanks for the quick reply. I tried re-indexing and flushing the cache but I'm getting the same error Commented Nov 20, 2018 at 7:35

3 Answers 3

1

I resolved the issue. I disabled Binary logging in the Google cloud SQL which allowed me to save the product. Anyway this might be a temporary solution hope for a complete solution.

0

Please Run the reindex command from magento root directory, Check following command to reindex,

php bin/magento indexer:reindex

And after reindex please flush the cache and check. hope it will work for you. To flush the Magento cache run following command.

php bin/magento cache:flush
1
  • Thanks for the quick reply. I tried re-indexing and flushing the cache but I'm getting the same error Commented Nov 20, 2018 at 7:35
0

I solved it removing all Magento MSI modules through this package below, as you are running a Magento 2.2 I changed the package version to be the same.

composer require yireo/magento2-replace-inventory:2.2.*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.