Skip to content

Magento 2 and Adobe Commerce field notes

Fix Magento indexing, cron, MSI stock, and order grids with a script

A working library of the problems that hit real Magento 2 and Adobe Commerce stores, across indexing, cron, MSI multi source inventory, orders and grid sync, catalog and prices, and customers, and how to detect or repair each one with a small Python or Node.js script. Every guide has a diagram of the problem, a diagram of the fix, full code in both languages, tests, and links to the source reports.

Python and Node.js Magento REST API Diagrams and full code
Browse all 59 scripts on GitHub Download them all as a zip Field guide PDF (59 fixs, 127 KB) Follow @allanninal Every fix on this page has a tested Python and Node.js script in the repo. Free, and MIT as stated in its README.

Indexing

8 guides

Stale price index shows wrong or old prices

Storefront price lags admin price after edits or rule changes. Script diffs API price vs price index and triggers reindex.

Diagnostic

Indexer stuck at reindex required or processing

A crashed or killed reindex leaves indexer_state locked forever. Script polls indexer status and flags or resets stuck rows.

Diagnostic

Products vanish mid reindex on delete then insert cycle

catalog_product_index_price briefly drops rows during rebuild, hiding products. Script compares product counts before and after reindex.

Diagnostic

Products flap out of category or search during scheduled indexing

Mview delete and recreate cycle temporarily empties catalogsearch results. Script polls category and search endpoints during reindex windows.

Diagnostic

Category product assignment changes do not reach search index

catalog_category_product edits never flow into the fulltext changelog, hiding newly assigned products. Script compares category API assignment vs storefront listing.

Diagnostic

Category product count wrong or zero on large catalogs

Reported category product count diverges from real assignments due to a temp table bug. Script compares actual assignments vs reported count via API.

Diagnostic

Anchor category shows products from disabled subcategories

is_anchor categories leak products from disabled child categories into storefront listings. Script cross-checks category status vs indexed product assignment.

Diagnostic

Catalog price rule cron failure blocks downstream indexers

catalogrule_apply_all failing on a new store view halts scheduled indexers, leaving rule prices unapplied. Script compares catalog rule price vs expected discount via API.

Diagnostic

Cron

4 guides

Inventory (MSI)

9 guides

Salable quantity corrupted by bad reservation compensation

Lost, duplicated, or overcompensated reservations desync salable qty from real stock. Script sums reservations vs source qty per SKU and reconciles.

Reconciler

Salable quantity goes negative or allows oversell

Concurrent checkout or bad backorder config lets salable qty drop below zero. Script cross-checks source_items, reservations, and open orders for negative stock.

Diagnostic

Product shows in stock while salable quantity is zero

Stock status flag disagrees with computed salable qty of zero, letting shoppers order phantom stock. Script compares stock item status vs salable quantity API.

Diagnostic

Listing page and product page disagree on stock status

Category grid shows in stock while the product page shows out of stock for the same SKU at zero qty. Script diffs stock status across grid and detail endpoints.

Diagnostic

Shared stock not synced across websites

A purchase in one website does not decrement salable qty for sibling websites sharing the same stock, causing oversell. Script compares salable totals per website for a stock id.

Diagnostic

Configurable parent stock status not derived from children

Parent configurable stays stale or wrong after child simple product qty changes, sometimes showing in stock when all children are out. Script recomputes parent status from children via API.

Reconciler

Out of stock threshold change not applied to existing items

Changing the out of stock threshold does not recompute status for existing source items. Script recalculates is_in_stock per source item against the new threshold.

Repair

Negative source item quantity still counted as positive stock

An out of stock source with negative qty still adds positively to combined salable quantity. Script sums source_items per SKU and flags impossible totals.

Diagnostic

REST created orders skip reservation placement

Orders placed through the order create API bypass the reservation plugin, leaving salable qty stale. Script compares order items against the reservations table.

Diagnostic

Orders and Grid Sync

5 guides

Orders and Payments

3 guides

Credit Memos and Refunds

7 guides

Credit memo total wrong on multi invoice orders

Refund total or tax is miscalculated when an order was split across multiple invoices. Script recomputes expected refund from invoice and tax data and compares to the credit memo.

Diagnostic

Partial refund tax computed from full order instead of refunded items

Partial credit memos pull total order tax rather than a proportional share. Script recomputes expected tax and compares to the credit memo record.

Diagnostic

Duplicate credit memo created for one refund action

A single refund action produces more than one credit memo record. Script lists credit memos per order id and flags extras.

Diagnostic

Order status wrong after partial or zero total refund

A partial or zero total credit memo leaves the order at Complete or Processing instead of Closed. Script checks credit memo totals against order status.

Diagnostic

Credit memo grand total not refreshed after adjustment edit

Editing refund shipping or adjustment fields does not refresh the credit memo grand total in the API response. Script recomputes expected total from line items and flags drift.

Diagnostic

Online refund silently falls back to offline

A REST created credit memo fails to load the invoice instance so the gateway is never charged the refund. Script checks the credit memo online flag and transaction id against the request.

Diagnostic

Manual invoice missing tax leaves false amount due

Admin created invoices omit tax amount so total paid understates and the order shows a balance due. Script sums invoices vs order grand total via API.

Diagnostic

Shipments

1 guides

URL Rewrites

5 guides

Catalog and Visibility

6 guides

Pricing and Tax

6 guides

Catalog price rule discounts base price instead of group price

A rule scoped to one customer group discounts the original price rather than that group tier price, or applies outside its scope. Script compares rule applied price vs expected group price via API.

Diagnostic

Wrong tax or price shown per customer group at checkout

Mismatched tax class produces a different final price across customer groups for the same tier price. Script fetches price per customer group via API and compares to expected output.

Diagnostic

Tax rate wrong when shipping address differs from customer default

Order applies the customer default address tax class instead of the selected shipping address, over or under charging VAT. Script recomputes expected tax rule match per address and compares to applied tax.

Reconciler

Tax recalculated incorrectly after coupon applied

Applying a discount coupon shifts the taxable base incorrectly so totals do not reconcile with price minus discount. Script recomputes tax from order items and discounts and diffs the result.

Diagnostic

Order tax off by rounding between calculation methods

Per item vs per row tax rounding produces a small drift from the expected total. Script recomputes expected tax and diffs against the order tax amount.

Diagnostic

Shared catalog price cached and served to the wrong company

The first viewer's discounted shared catalog price gets cached and served to guests or other companies on category pages. Script requests category prices as different customer groups and flags mismatches.

Diagnostic

Cart Price Rules and Coupons

3 guides

Customers

1 guides

API and Integration

1 guides

Fighting a Magento 2 and Adobe Commerce bug right now?

If you have a problem in Magento indexing, cron, MSI stock, or order grid that you would rather hand off, this is the kind of work I do. Message me and we can work through it together.

Contact me on LinkedIn

Found this useful?

These guides are free and always will be. If one saved you a support ticket or a refund, you can throw a coffee my way. It keeps the notes coming.

Buy me a coffee on Ko-fi