I installed magento 2.4.0 on my Linux server from godaddy. I'm unable to add the products to it. It is showing the Error is The stock item was unable to be saved. Please try again.
Can any one help me from this please

- 311
- 1
- 2
- 6
-
Check this out https://community.magento.com/t5/Magento-2-x-Technical-Issues/The-stock-item-was-unable-to-be-saved-Please-try-again/td-p/449973 – Nooruddin Lakhani Nov 02 '20 at 15:31
-
I tried it but still, it's not working. Can you please help me with it? – nikhil gantyala Nov 02 '20 at 15:42
8 Answers
Please change all indexer as Update by Schedule mode in system-> index management
. It's working for me.

- 1,564
- 16
- 25

- 391
- 2
- 2
-
-
Hi, I had already set to schedule, but it kept giving me the error. I changed on save and the error disappeared, but I also changed the database user permissions from "usage" to "ALL" and changed two products without getting the error. – Joso May 05 '21 at 12:15
If you are using Elasticsearch instead of Mysql. then please check once that elasticsearch is working or not.
sudo service elasticsearch status // for checking the Running Status
sudo service elasticsearch start // for Start
sudo service elasticsearch restart // for Restart

- 1,564
- 16
- 25
I have fixed it. There was an entry missing in cataloginventory_stock
try to run this query
INSERT INTO cataloginventory_stock (stock_id, website_id, stock_name) VALUES ('1', '1', 'default');

- 51
- 1
- 4
Go to Magento 2.4.2 installation location:
cd /var/www/html
Flush cache
sudo php bin/magento cache:flush
Chek Indexer Status
php bin/magento indexer:status
Reset Indexer
php bin/magento indexer:reset
Reindex Indexer
php bin/magento indexer:reindex
Chek Indexer Status
php bin/magento indexer:status
Chek indexer Info
php bin/magento indexer:info
Finally Flush Cache
php bin/magento cache:flush
Restart sudo reboot
Login to admin and check

- 18,169
- 13
- 73
- 107

- 411
- 4
- 5
Make sure you have Elastic search service active status ?
service elasticsearch status

- 194
- 7
I had the same issue, I just had to execute:
php bin/magento indexer:reindex

- 18,150
- 39
- 158
- 271
I've Migrated the magento 2.3.x into 2.4.x. I faced the same issues. I've resolved this issue the following way.
INSERT INTO cataloginventory_stock (stock_id, website_id, stock_name) VALUES ('1', '1', 'default');
php bin/magento indexer:reindex
php bin/magento cache:flush
But still i am facing the same issue, then I did the below steps.
- mysqldump --single-transaction -u root -p mydb --triggers | sed -e 's/DEFINER[ ]=[ ][^]*/*/' > mydb_without_definer.sql
- DROP DATABASE
mydb
; - create DATABASE
mydb
; - mysql -u root -p mydb < mydb_without_definer.sql
- php bin/magento indexer:reindex
- php bin/magento cache:flush
Thank you! Pilathraj

- 59
- 6
For me, the solution was to use Opensearch instead of Elasticsearch. There is an option in the backend for that, by default elastic is selected.
Go to Magento Admin then,
Stores > Configurations > Catalog > Catalog > Catalog Search

- 1
- 1
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 18 '23 at 14:15