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.
Message Queue and Scheduled Tasks
6 guidesScheduled task stuck in queued status forever
Task marked queued but never dispatched or reverted; script polls scheduled_task and resets stale rows to scheduled.
ReconcilerFailed messages accumulate in the messenger failure queue
Retried messages land in the failure transport and sit unprocessed; script counts, lists, requeues or purges them.
DiagnosticMessage queue backlog when only the admin worker runs
Relying on the browser admin worker instead of a CLI consumer leaves messages unprocessed; script measures queue age and count for alerting.
DiagnosticInstall queue message for an app or service silently lost
An extension install message vanishes without processing, leaving the integration inactive; script finds stuck installs and re-triggers them.
ReconcilerScheduled task run interval resets after deploy
Redeploys silently overwrite a customized run interval back to default; script diffs configured interval against expected value and restores it.
ReconcilerWebhook event logs stuck in queued state pile up
Queued webhook_event_log rows are never cleaned up and grow unbounded; script finds and purges stale entries past retention.
ReconcilerOrder Data Integrity
5 guidesOrder line item orphaned after its product is deleted
Deleting a product nulls productId and productVersionId on historic order line items and blocks order edits; script finds and repairs orphans.
ReconcilerOrder line item references a deleted promotion
A dangling promotionId on a line item makes saving the order error out; script detects and clears or repairs the reference.
ReconcilerOrder line item cover references deleted media
A line item's coverId points at removed media and breaks checkout with an integrity error; script finds dangling coverId values and clears them.
ReconcilerDeleting the last line item leaves order total stale
Removing every line item keeps a nonzero amountTotal instead of recalculating; script flags orders with zero items but positive totals.
DiagnosticOrder totals not recalculated after manual line item edits
Editing quantities or items in an existing order leaves discount lines and amountTotal stale; script recomputes and flags mismatches.
DiagnosticOrder State Machine
12 guidesOrder 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.
ReconcilerOrder 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.
DiagnosticOrder 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.
DiagnosticAdmin 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.
ReconcilerFlow 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.
DiagnosticOrders 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.
DiagnosticFiltering 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.
DiagnosticDelivery 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.
ReconcilerBulk 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.
ReconcilerTransition 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.
ReconcilerPayment 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.
DiagnosticDelayed 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.
DiagnosticInventory and Stock
9 guidesavailableStock 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.
ReconcilerStock 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.
ReconcileravailableStock 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.
ReconcilerProduct 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.
ReconcilerOut 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.
DiagnosticReturn 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.
ReconcilerHTTP 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.
DiagnosticOverselling 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.
ReconcilerProduct 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.
DiagnosticNumber Ranges and Documents
5 guidesDuplicate number range configs for a sales channel desync counting
Two identical number_range configs bound to one sales channel break preview versus current number tracking; script finds duplicate bindings and flags for merge.
DiagnosticNon-atomic number range storage can duplicate order numbers
Concurrent order placement or a Redis eviction without TTL can duplicate an order number; script scans orderNumber for duplicates via search API.
ReconcilerQuote creation consumes the shared order number range
Creating or recalculating a B2B quote increments the order number sequence without creating an order, causing gaps; script compares sequence state against actual order count.
DiagnosticNumber range hitting its maximum value stalls generation
A number range reaching its integer or pattern limit fails to increment further, risking manual duplicate entry; script monitors the last value against the pattern limit.
DiagnosticInvoice document created without a number or date
Confirming the invoice modal too quickly creates a document entity missing its number and date; script queries documents with empty config.number for cleanup.
DiagnosticSEO URLs
4 guidesDuplicate seo_url rows accumulate for the same path
A missing or violated unique key lets duplicate SEO URL rows pile up under concurrency or migration; script queries for duplicate path per channel and language and dedupes.
ReconcilerSEO URL not generated for a product on a shared-language sales channel
Assigning a product to a second sales channel sharing a language hits a unique constraint and silently skips URL generation; script finds products missing a seo_url per active channel.
DiagnosticStale SEO URLs remain non-canonical after a template change
Changing the SEO URL template does not regenerate or clean up existing URLs; script checks canonical flags and triggers a reindex for stale entries.
ReconcilerSeoResolver can pick a soft-deleted URL as canonical
Sorting of duplicate seo_url rows ignores the deleted flag, letting a soft-deleted row outrank the real canonical one; script flags canonical rows marked deleted.
DiagnosticCustomers and Promotions
7 guidesGuest 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.
DiagnosticDuplicate 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.
ReconcilerMigrated 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.
DiagnosticLowercase 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.
ReconcilerPromotion 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.
DiagnosticCancelled 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.
ReconcilerPromotion 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.
DiagnosticProducts, Variants and Media
7 guidesDeleting 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.
ReconcilerVariant 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.
ReconcilerSync 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.
ReconcilerThumbnail 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.
ReconcilerMedia 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.
ReconcilerOrphaned 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.
ReconcilerProduct 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.
ReconcilerStorefront Visibility
3 guidesProducts missing a product_visibility row for a sales channel
Imported or migrated products lack a visibility entry for a channel so they never surface in storefront; script cross-checks products against visibility rows and creates missing ones.
ReconcilerActive assigned products still absent from storefront listings
A product appears correctly configured yet is missing from storefront listing or search; script recomputes visibility and triggers the product indexer via API.
ReconcilerElasticsearch alias not refreshed after a full reindex
Running the index command without recreating the alias leaves the storefront pointed at a stale index so updates never appear in search; script compares DB and indexed counts to detect staleness.
DiagnosticAdmin API and Auth
1 guidesFighting 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.
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