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

Posted by

Magento2在使用api更新库存的时候,失败了出现下面情况

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

更新库存后的消息

解决办法:

  1. rm -rf generated/*
  2. php bin/magento indexer:reset
  3. php bin/magento indexer:reindex
  4. php bin/magento cache:clean

执行完上面的命令再次更新库存。