Skip to main content

Troubleshooting

Each row is a failure mode the code actually has, with the log line or problem type it produces. Problem types are relative to https://errors.wes-work-planning.warehouse-systems.dev/ (see Errors). Settings are on Configuration; procedures on the Runbook.

Boot and readiness​

SymptomCauseCheckFix
Pod exits at once: failed to load the process-path cataloguePATH_CATALOGUE_FILE missing or invalid — there is no empty-catalogue fallback (ADR-0012)kubectl exec ... ls /etc/wes-work-planning; chart pathCatalogue.content / existingConfigMapsupply the catalogue (warehouse-infra's config/process-paths/*.yaml)
Pod exits: process-path catalogue did not become ready within 60sPATH_CATALOGUE_SOURCE=kafka and the replay of warehouse.process-path-management.events did not catch upis the topic present and readable from the pod?fix broker reachability; or fall back to PATH_CATALOGUE_SOURCE=file
Pod exits: DATABASE_URL is required, KAFKA_BROKERS is required, KAFKA_CONSUMER_GROUP is required, PRODUCT_CLASSIFICATION_CONSUMER_GROUP is required or REPLENISHMENT_CONSUMER_GROUP is requireda mandatory variable is unset or blank; Postgres and Kafka are the only runtime (ADR-0044), there is no in-memory or log-only modeenv of the container; chart database.*, kafka.brokers, config.*ConsumerGroup (the chart itself refuses to render without them)set the variable named in the error
Pod exits: EVENT_PUBLISHER="log" is not supported, PRODUCT_CLASSIFICATION_MODE=permissive is not supported, REPLENISHMENT_MODE=permissive is not supported (same for off)stale config from before ADR-0044: log, permissive and off no longer existenv (and extraEnv)unset the variable or set it to kafka
Pod exits: PRODUCT_CLASSIFICATION_MODE=http was removed (ADR-0035)stale config from before ADR-0035envunset it or use kafka
Logs retrying with op run migrations / ping postgres / connect to the process-path catalogue topic, then successthe fleet's Istio sidecar resets each pod's first outbound dial ~10 s after startsucceeded after retry followsnone — the boot retry (5 attempts, ~15 s of backoff) absorbs it
Same, ending in (after 5 attempts) and exit 1the dependency really is unreachableDSN host, Postgres/Kafka healthfix the dependency; the pod restarts
Pod killed by the startup probe while still logging boot stepsboot exceeded the probe's 60 s (2 s × 30): catalogue replay (up to 60 s) plus migrations plus retriestimestamps of the boot log linesraise startupProbe.failureThreshold, or speed up the slow step
Pod never becomes Readycmd/wes opens its listener only after boot; /readyz is 200 only while Postgres answers a ping and a Kafka broker answers a metadata request (cached 3 s, 2 s bound)logs stop before http server listening, or /readyz returns 503 with problem dependency-unavailable and a detail naming postgres or kafkathe blocking step is in the logs (catalogue, migrations, ping); restore the dependency
/readyz returns 503 {"status":"not_ready"}SIGTERM received — readiness flips first on shutdown, by designpod is terminatingexpected; /healthz stays 200 so liveness does not kill the drain
/readyz returns 503 dependency-unavailablePostgres does not answer a ping, or no Kafka broker answers a metadata request (a missing topic is not a failure: the writers auto-create theirs)detail names the dependencyrestore the dependency; the pod is taken out of rotation until it answers
Pod restarts with outbox relay stopped on its own or ... consumer stopped on its ownthe relay or a consumer died (Kafka down long enough, a DLQ publish or an offset commit failed); the process deliberately exits non-zero so the pod restarts instead of staying alive with dead consumersthe ERROR line before the exitfix the broker; the restarted pod resumes from the committed offsets
cmd/wes-projector or cmd/wes-reports exits: ANALYTICS_DATABASE_URL is requiredanalytics enabled without a DSNanalytics.database.* values / Secretset projectorUrl/reportsUrl or existingSecret

Migrations​

SymptomCauseCheckFix
Boot fails in run migrations with pq: unnamed prepared statement does not exist or canceling statement due to statement timeoutgolang-migrate ran through PgBouncer's transaction pooling, which breaks its session advisory lockis MIGRATIONS_DATABASE_URL set to a direct DSN?provide the Secret key MIGRATIONS_DATABASE_URL (ADR-0026)
Boot fails: Dirty database version Na previous migration failed half-waySELECT * FROM schema_migrationsrepair the schema by hand, then migrate -path migrations -database <direct DSN> force N
cmd/mcp tool calls fail with relation "work_pools" does not existcmd/mcp never migrates; cmd/wes has not run against this database yet\dt on the OLTP databasedeploy/start cmd/wes first
Projector boot fails in run analytics migrationsanalytical database unreachable or a *.up.sql failedschema_migrations_analytics rowsfix the DSN or the SQL; each file applies in its own transaction

Kafka consumption​

SymptomCauseCheckFix
Upstream events never reach the read models; no kafka consumer group / consuming product classifications boot logthe pod never got past boot (every consumer starts unconditionally), or a second process shares the groupboot logs; kafka-consumer-groups.sh --describe --group wes-work-planningfix the boot error; see the next row
A second process (local go run, e2e harness) consumes nothing while the deployed pod works, or vice versaboth share KAFKA_CONSUMER_GROUP=wes-work-planning; with one partition only one member gets itkafka-consumer-groups.sh --describe --group wes-work-planninggive the extra process a unique KAFKA_CONSUMER_GROUP
Lag grows on every consumed topic; log kafka consumer stopped on its own and the pod restartsthe loop exits when a DLQ publish or an offset commit fails (on purpose: the offset is not committed, nothing is lost) and the process exits non-zeroERROR lines before it, e.g. publish to dead-letter topicfix the broker; the restarted pod continues
<topic>.dlq grows; invalid CloudEvent, sending to dead-letter topicthe producer sent something that is not CloudEvents 1.0 (e.g. the retired flat envelope)x-dlq-error headerfix the producer; the message is never retried
<topic>.dlq grows; exhausted retries, sending to dead-letter topica handler failed 3 times: unknown path_id (catalogue), undeclared work_kind on WorkDemandReleased, a broken SlotPlanApproved (unknown move kind, missing slot) or a RELOCATE path missing from the catalogue / not admitting SLOT_RELOCATION (ADR-0040), or a persistent Postgres errorx-dlq-error, id, type in the logdeclare the path / fix the upstream payload / fix the database, then replay
A RELOCATE work unit stays Pending and is never releasedit is blocked: relocation.blockedBy names the move that vacates its target slot, which has not completed yetGET /work-units/{id}complete the blocking unit; see Runbook
RELOCATE work units turned Cancelleda newer SlotPlanApproved for the same site superseded their plan before they were released (by design)SELECT * FROM slot_plans WHERE site_id = '...' ORDER BY approved_at DESCnone
SlotPlanApproved older than the site's current plan; recorded, nothing planneda plan arrived after a newer one for the same siteINFO onlynone
TaskCompleted for a work unit this context never planned; skippinga PACK task fulfillment-execution created itself carries the order idINFO onlynone — expected (ADR-0028)
Release-fed paths answer 409 wip-limit-reached for good although fulfillment finishes taskscompletions are not arriving, so WIP slots are never freed (RecordCompletion frees them)is the warehouse.fulfillment.events consumer running? lag on that topic?restore consumption, or complete via POST /work-units/{id}/completions
applying a pack level event failed; retrying the same message repeatinga transient error the pack-level consumer retries forever (it never skips a decodable ProductPackLevel* event)the error fieldfix Postgres; the consumer continues by itself
pack level event is poison, sending to dead-letter topica ProductPackLevelDeclared/Retired/Measured with an invalid GTIN, level, dimension or versionthe error field, the x-dlq-* headers on warehouse.product-master.events.dlqfix the producer; the message was committed past
Boot error PACK_VIEW_CONSUMER_GROUP is required or must differ from PRODUCT_CLASSIFICATION_CONSUMER_GROUPthe pack-level consumer is always on and needs its own stable groupthe api Deployment's env (config.packViewConsumerGroup)set a group distinct from the classification group (ADR-0045)
applying ProductClassified failed; retrying the same message repeatinga transient error the classification consumer retries forever (it never skips a decodable event)the error fieldfix Postgres; the consumer continues by itself
WorkReleased never carries required_capabilities/fragilethe copy has no row for the SKU yet (the ProductClassified consumer has not seen it, or the SKU is not hazmat/fragile)SELECT * FROM product_classification_copy WHERE sku = '...'check the consumer lag on warehouse.product-master.events; the MCP server reads the same table

Outbox and publishing​

SymptomCauseCheckFix
Nothing reaches Kafka although requests succeedthe always-on relay cannot publish: see the next two rowsoutbox relay pass failed, wes.outbox.lag_secondsrestore Kafka; there is no log-only publisher any more
wes.outbox.lag_seconds keeps rising; outbox relay pass failedKafka unreachable, or one row failing every pass (later rows wait behind it until it reaches OUTBOX_MAX_ATTEMPTS)SELECT id, event_type, attempts, last_error FROM outbox_events WHERE published_at IS NULL ORDER BY id LIMIT 5fix the cause in last_error; the relay resumes on its own
outbox relay: row reached the attempt cap and is no longer claimed (ERROR); an event never arrivedthat row failed OUTBOX_MAX_ATTEMPTS (default 20) sends and is excluded; later rows overtook it (ADR-0039)SELECT id, topic, event_type, attempts, last_error FROM outbox_events WHERE published_at IS NULL AND attempts >= 20fix the cause, then UPDATE outbox_events SET attempts = 0 WHERE id = ... (Runbook)
Outbox rows written by MCP never publishedthe relay runs only in cmd/wes; the api Deployment is down or crash-loopingapi pods and logsrestore the api; it drains every row whichever process wrote it
idempotency_keys / outbox_events grow without boundhousekeeper disabled (0) or failing (housekeeping sweep failed)env, logsfix; note processed_events is never swept by design

HTTP problem types​

Status / typeCauseFix
400 unknown-path-idpathId not in the process-path catalogue. Checked on the routes that can create an aggregate: POST .../work-units, PUT .../pooluse a declared path or add it to the catalogue
404 not-found on work-releases, telemetry, rebalance-decisionsno WorkPool exists for that path yet (created by the first enqueue or by PUT /paths/{pathId}/pool)enqueue or configure first
404 not-found on labor-plan-view / inventory-viewno event observed yet for that path/SKUwait for the upstream event or check consumption
404 on POST .../charge or .../planthe charge forecast and the shift plan moved to warehouse-planning (ADR-0049); the routes answered 410 charge-forecast-moved / 410 shift-plan-moved for one release and were removed in stage Esend PUT /workload-forecasts/{site_id}/{path_id} or PUT /labour-plans/{site_id}/{shift_id}/{path_id} to warehouse-planning, as the problem detail says
400 malformed-request-bodyinvalid JSON, a missing required field (cpt, wipLimit) or an empty/invalid cutoffAtfix the request
400 invalid-line-nolineNo given but outside 1..2147483647omit it or send a valid line
409 wip-limit-reachedrelease-fed pool at its WIP limitcomplete work, or raise the limit with PUT /paths/{pathId}/pool
409 work-pool-emptynothing pendingenqueue work
409 concurrent-modification12 optimistic-concurrency retries (jittered, ≤ ~1 s) all lost the race on the same pool (ADR-0029)retry the request; sustained contention on one path is the real problem
409 work-unit-already-enqueuedthe workUnitId is already in the pooluse a new id (or treat as success for a retry)
409 work-unit-already-released / work-unit-already-completed / work-unit-not-released / work-unit-cancelled / work-pool-entry-already-releasedlifecycle invariant of WorkUnit / WorkPoolinspect GET /work-units/{id}
400 idempotency-key-requiredPOST /paths/{pathId}/work-units without Idempotency-Key (always enforced: Postgres is the only runtime)send a unique key per logical request (ADR-0022)
400 malformed-request-body for a body or query with U+0000, 404 for a path with U+0000Postgres text cannot hold NUL; the guard answers before any idempotency key is recordedthe request bytes
400 invalid-wip-limit for a huge wipLimitwipLimit above 2147483647 (the Postgres INTEGER maximum)the request body
409 idempotency-key-reusedsame key, different body (SHA-256 of the body differs)new key for a different request
Retry with same key and body returns the first response, no new unitcached replay, by design; after IDEMPOTENCY_KEY_TTL (24 h) the key is forgotten and the call runs again—
500 internal-errorunmapped error, usually Postgres (pool exhausted, statement_timeout 5 s)ERROR access log with trace_id; db.client.operation.errors

There is no 412 in this service: no endpoint uses ETag/If-Match preconditions; lost updates on WorkPool are handled server-side by the version column and retry.

Sibling lookups​

This service makes no synchronous call to a sibling. The facility-layout travel-distance lookup, and with it the circuit_breaker_state series, went with the shift plan (ADR-0049).

MCP and analytics​

SymptomCauseCheckFix
Every tool returns not foundthe path has no pool yet (cmd/mcp reads the same Postgres as cmd/wes, whose schema it never migrates)SELECT * FROM work_poolsconfigure the pool with PUT /paths/{pathId}/pool
cmd/mcp exits: DATABASE_URL is required / KAFKA_BROKERS is requiredmandatory variable missing (ADR-0044)MCP envset it
get_release_throughput_report rejected: missing properties: ["pathId" "granularity"]the SDK marks every input field required (see MCP tools)—send "pathId": "" and "granularity": "" (or "hour")
get_release_throughput_report not listedREPORTS_BASE_URL unsetMCP env / analytics.enabledset it
MCP client gets session errors after scaling MCP to 2+ replicassessions live in one process's memoryreplica countkeep mcp.replicaCount: 1
400 invalid-report-query from /reports/throughputfrom/to missing or not RFC3339, or granularity not hourthe detailfix the query
Report rows missing although events were publishedthe projector commits before handling; a failed apply is logged (analytics message handling failed) and not retriedprojector ERROR logsrebuild the report (runbook)
lagSeconds above 30projector down, lagging, or no events produced recentlyconsumer group wes-analytics lagrestart/scale the projector

Browser​

SymptomCauseFix
CORS error calling the REST API from a browser originorigin not in CORS_ALLOWED_ORIGINS (default http://localhost:5173,http://localhost:5183)add the origin; in the cluster go through Kong on :8000