Skip to content

Product showing out of stock but In stock in backend #39889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 5 tasks
januszd17 opened this issue May 5, 2025 · 8 comments
Open
1 of 5 tasks

Product showing out of stock but In stock in backend #39889

januszd17 opened this issue May 5, 2025 · 8 comments
Labels
Area: APIs Component: Stock Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reported on 2.4.7-p3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@januszd17
Copy link

Preconditions and environment

2.4.7-p3
Stock status mismatch: product shows as in-stock in backend, out-of-stock in frontend (cataloginventory_stock_status vs. cataloginventory_stock_item)

We are encountering a recurring issue where Magento products display as out of stock on the frontend even though they are marked in stock in the admin backend.
This mismatch appears to be caused by desynchronization between the cataloginventory_stock_item and cataloginventory_stock_status tables.

Steps to reproduce

Import or update products (via integration, API, or backend)
Check Magento admin → product shows is_in_stock = 1
Check Magento frontend → product displays as out of stock

Expected result

Frontend and backend stock statuses should match.
If cataloginventory_stock_item.is_in_stock = 1, the product should display as in stock on the frontend.

Actual result

cataloginventory_stock_item.is_in_stock = 1 (correct)
cataloginventory_stock_status.stock_status = 0 (incorrect)
Frontend shows product as out of stock.

Additional information

Example SQL to identify issue:
SELECT cpe.entity_id,
cpe.sku,
csi.is_in_stock AS stock_item_status,
css.stock_status AS stock_status_valueFROM catalog_product_entity cpeJOIN cataloginventory_stock_item csi ON cpe.entity_id = csi.product_idJOIN cataloginventory_stock_status css ON cpe.entity_id = css.product_idWHERE csi.is_in_stock != css.stock_status;
Temporary workaround:
UPDATE cataloginventory_stock_status cssJOIN cataloginventory_stock_item csi ON css.product_id = csi.product_idSET css.stock_status = csi.is_in_stockWHERE css.stock_status != csi.is_in_stock;
Followed by:
php bin/magento indexer:reindex
php bin/magento cache:flush

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented May 5, 2025

Hi @januszd17. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

Copy link

m2-assistant bot commented May 5, 2025

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November engcom-November added the Reported on 2.4.7-p3 Indicates original Magento version for the Issue report. label May 5, 2025
@engcom-November
Copy link
Contributor

Hello @januszd17 ,

Thank you for your report and collaboration.

We attempted to reproduce the issue in our latest version 2.4 develop but were unable to reproduce it. Please find the attached screenshot for reference.

Image

Image

Steps to Reproduce

  • Import or update products (via integration, API, or backend)
  • Check Magento admin → product shows is_in_stock = 1
  • Check Magento frontend → product displays as out of stock

We followed these steps and did not encounter any issues. Could you please recheck in the latest version of Magento and let us know if we are missing any steps to reproduce this issue?

Therefore, we are marking this ticket as "Issue: Needs Update".

Thank you!

@engcom-November engcom-November added the Issue: needs update Additional information is require, waiting for response label May 6, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board May 6, 2025
@januszd17
Copy link
Author

How did you try reproducing it? Did you follow the steps? This seems to be a problem when updating products using the API there are others with the same problem:
https://magento.stackexchange.com/questions/365350/product-showing-out-of-stock-but-in-stock-in-backend
Not sure if that makes a difference, I noticed this on configurable products. Like I said, most checks, when looking at the tables, came back ok, all except one.

-- Check stock item table
SELECT * FROM cataloginventory_stock_item WHERE product_id IN
(SELECT entity_id FROM catalog_product_entity WHERE sku IN ('300190', 'THUJDEPR06'));

-- Check stock status table
SELECT * FROM cataloginventory_stock_status WHERE product_id IN
(SELECT entity_id FROM catalog_product_entity WHERE sku IN ('300190', 'THUJDEPR06'));

-- Check relationship tables
SELECT * FROM catalog_product_super_link WHERE parent_id =
(SELECT entity_id FROM catalog_product_entity WHERE sku = '300190');

-- If using MSI, check source items
SELECT * FROM inventory_source_item WHERE sku IN ('300190', 'THUJDEPR06');

Most were returning the correct status with stock showing as 1. Except this one:
SELECT * FROM cataloginventory_stock_status WHERE product_id IN (SELECT entity_id FROM catalog_product_entity WHERE sku IN ('300190', 'THUJDEPR06'));
returned the value for stock_status as 0 for both

@echocomm
Copy link

echocomm commented May 8, 2025

I have the same issue on some of my SKU's not all. I noticed if I change the sku to all lower case letters it solves the problem of showing in stock.

@engcom-November
Copy link
Contributor

Hello @januszd17 ,

Thank you for your report and collaboration.

We attempted to reproduce the issue in the latest 2.4-develop instances. We are able to reproduce the issue. Please refer to the attached screenshot for details.

Image
Image
Image

Steps to Reproduce:

  1. Import or update products (via integration, API)
  2. Check Magento frontend → product displays as out of stock

We followed the preconditions and steps as provided and encountered the issue.

Therefore, we are marking this ticket as "Issue: Confirmed."

Thank you!

@engcom-November engcom-November added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: APIs Component: Stock Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: needs update Additional information is require, waiting for response labels May 9, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Needs Update to Confirmed in Issue Confirmation and Triage Board May 9, 2025
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-14639 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented May 9, 2025

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: APIs Component: Stock Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reported on 2.4.7-p3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Development

No branches or pull requests

4 participants