Shopware 6 field notes

Fix Shopware 6 orders, stock, state machine, and the message queue with a script

A working library of the problems that hit real Shopware 6 stores, across orders and the state machine, stock and availableStock, the message queue and scheduled tasks, DAL indexers, products and media, and data integrity, 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 Shopware Admin API Diagrams and full code All code on GitHub

Message Queue and Scheduled Tasks

6 guides

Order Data Integrity

5 guides

Order State Machine

12 guides

Order transaction stuck open despite a completed payment

Async payment webhook races the customer return, leaving stateId at open though paid; script cross-checks PSP status against transaction state.

Reconciler

Order state cannot be patched directly and must use transitions

Direct writes to order or order_transaction stateId are rejected by scope crud rules; script drives state changes through the transition action endpoint instead.

Diagnostic

Order transaction missing a defined paid transition

Some order_transaction state machines lack a paid transition row so the API call fails; script detects and can insert the missing transition.

Diagnostic

Admin and API show a stale transaction state on multi-transaction orders

Orders with multiple transaction records can surface an outdated non-latest payment state; script recomputes state from the newest transaction.

Reconciler

Flow Builder applies a payment status change to the wrong transaction

An automated flow targets a stale or wrong order_transaction id, throwing illegal transition errors; script detects mismatched transaction and order pairing.

Diagnostic

Orders can be force cancelled outside allowed transitions

Any order can be set to cancelled via API even without a valid transition path, breaking the state graph; script audits for illegal transitions.

Diagnostic

Filtering orders by cancelled payment status returns wrong results

Admin API criteria filtering on cancelled payment status returns orders that are not actually cancelled; script cross-checks filter results against real state.

Diagnostic

Delivery or transaction stateMachineState returns null

order_delivery or order_transaction can read stateMachineState as null despite the order existing; script finds nulls and relinks the correct state.

Reconciler

Bulk order status editor leaves orders mid transition

Bulk editing many orders to done can deadlock on stock updates and leave some un-transitioned; script detects stuck orders and retries transitions individually.

Reconciler

Transition action names renamed on 6.7 migration

Upgrading to 6.7 renames pay, pay_partially and do_pay transition action names, breaking custom integrations; script diffs actionNames against the expected set and remaps calls.

Reconciler

Payment state history not updated after switching payment method post-failure

Switching payment method after a failed payment leaves the transaction on its old state with no history entry; script compares state to state_machine_history to find gaps.

Diagnostic

Delayed flow does not trigger on payment failed transition

A delayed Flow Builder action never fires when a transaction moves to failed, leaving follow up automation undone; script finds failed transactions with no follow-up action.

Diagnostic

Inventory and Stock

9 guides

availableStock much lower than stock after SW5 to SW6 migration

Leftover reservations from old open orders push availableStock far below real stock; script recomputes it from stock minus open order quantities.

Reconciler

Stock and availableStock drift after direct writes bypass the stock API

Writing product.stock directly instead of through the Stock Manipulation API leaves availableStock stale; script compares the two and corrects drift.

Reconciler

availableStock not restored after order cancellation

Cancelling an order can leave the API returning the pre-cancellation availableStock instead of the recalculated value; script compares and corrects it.

Reconciler

Product available forced to zero when isCloseout is null

StockStorage marks a product unavailable whenever isCloseout is null instead of false; script finds null isCloseout rows, normalizes them, and republishes.

Reconciler

Out of stock products remain addable to cart

Products with stock and availableStock at zero still show an active buy button; script flags available products with nonpositive availableStock for review.

Diagnostic

Return processing does not restore product stock

Processing a return does not increment stock back for one or more of the returned items; script diffs return line items against stock movements to find misses.

Reconciler

HTTP cache shows stale max purchasable quantity after stock changes

Product detail pages keep showing the old max quantity after an order reduces stock in the database; script compares live stock to cached value and triggers invalidation.

Diagnostic

Overselling of closeout items under concurrent checkout

High concurrency purchases of the same closeout SKU can push stock or availableStock negative; script scans for negative values and reconciles against paid orders.

Reconciler

Product streams filtering on available stock return empty with Warehouses extension

Dynamic stock filters yield zero products under the Warehouses commercial extension despite real stock existing; script recomputes and validates stream membership.

Diagnostic

Number Ranges and Documents

5 guides

SEO URLs

4 guides

Customers and Promotions

7 guides

Guest checkout reuses an email already tied to a registered account

Missing email uniqueness validation lets a registered email be reused for a guest order, creating duplicate customer records; script finds duplicate emails across guest and registered flags.

Diagnostic

Duplicate guest customer accounts accumulate per sales channel

Guest checkout creates a new customer record per order instead of reusing one by email, bloating the customer table; script groups by email and channel to find duplicates.

Reconciler

Migrated customers end up with multiple accounts across sales channels

Post-migration customers have several account records tied to different channels, breaking login; script queries by email across channels and flags for consolidation.

Diagnostic

Lowercase promotion code entry is not marked as redeemed

A case mismatch between entered and stored code lets a one-time code be reused indefinitely; script compares redeemed flags against completed orders referencing the code.

Reconciler

Promotion maximum usage limit not enforced

Configuring max usages with multiple discount groups can let a promotion apply beyond its intended limit; script counts redemptions in orders against the configured max.

Diagnostic

Cancelled orders do not release their reserved promotion code

Cancelling an order that used an individual promotion code leaves the code marked redeemed instead of freeing it; script finds redeemed codes tied only to cancelled orders.

Reconciler

Promotion applies even though its qualifying rule is not met

A rule evaluation bug lets a discount attach to carts or orders that fail its condition, such as a dropped cart value; script recalculates rule match per order and flags violations.

Diagnostic

Products, Variants and Media

7 guides

Deleting a product variant leaves stale configurator setting rows

Deleting a variant from the variant overview removes the product row but not its configurator settings; script cross-references settings against existing product IDs.

Reconciler

Variant listing config points at a removed main variant

Cloning products or deleting variants leaves mainVariantId pointing at a product that no longer exists; script validates the reference and repairs it via API.

Reconciler

Sync API re-runs create duplicate configurator setting entries

Each sync API run for variant configuration inserts new rows instead of upserting, accumulating duplicates over time; script detects and removes duplicates per option and product.

Reconciler

Thumbnail marked generated but the physical file is missing

A failed thumbnail generation is not retried because the system assumes the file already exists; script checks files against thumbnail records and requeues missing ones.

Reconciler

Media path regeneration on 6.6 upgrade can break file references

Upgrading to 6.6 regenerates every media path and can overwrite it incorrectly when filenames changed, breaking image URLs; script compares expected paths against actual stored files.

Reconciler

Orphaned media cannot be cleaned up non-interactively

The unused media cleanup command requires an interactive prompt so it cannot be cronned; script instead queries media with no entity association and deletes via API.

Reconciler

Product export scheduled task silently fails or produces an incomplete feed

The built in product export task does not fire reliably, yielding stale or partial feeds; script checks the last generation time against the expected interval and re-triggers it.

Reconciler

Storefront Visibility

3 guides

Admin API and Auth

1 guides

Fighting a Shopware 6 bug right now?

If you have a problem in Shopware order states, stock, message queue, or data-integrity 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