Skip to main content

Troubleshooting

Symptom, cause, check, fix. Every message quoted below is a string in the code. For infrastructure incidents (Postgres or Kafka down, parked outbox rows, DLQ) the Runbook has the long form; this page is the lookup table.

The process will not start​

SymptomCauseCheckFix
DATABASE_URL is required: this context runs on real Postgres, there is no in-memory mode (cmd/api), DATABASE_URL is required: this context runs on real Postgres (cmd/mcp, cmd/a2a)variable unsetenv | grep DATABASE_URL in the pod; the chart refuses to render without database.url or database.existingSecretset it (Secret key DATABASE_URL)
KAFKA_BROKERS is required: this context runs on real Kafka (outbox relay, consumers, /readyz)cmd/api only; unset or only commas and blankschart value kafka.brokersset a comma-separated list, e.g. localhost:9092
LINEHAUL_CONSUMER_GROUP is required: the consumer always runs on real Kafka (same for NODE_TOPOLOGY_CONSUMER_GROUP, SHIPPING_CONSUMER_GROUP)the group id is deliberately without defaultconfig.linehaulConsumerGroup, config.nodeTopologyConsumerGroup, config.shippingConsumerGroupset a stable, service-prefixed id (the fleet uses last-mile-delivery-linehaul, -node-topology, -shipping)
A2A_AGENT_URL is required: the Agent Card must advertise the absolute http(s) URL ... or A2A_AGENT_URL="..." is not an absolute http(s) URLcmd/a2a has no default for the advertised URLthe value must have http or https and a hoste.g. http://last-mile-delivery-a2a.warehouse-systems.svc.cluster.local:8093/
run migrations: ... after retries, pod killed by the startup probewrong or unreachable DATABASE_URL/MIGRATIONS_DATABASE_URL, or a pooled DSN used for migrationslogs show retrying WARN lines with op="run migrations" (5 attempts, 15 s of backoff)point MIGRATIONS_DATABASE_URL at a direct session-mode DSN; golang-migrate's advisory lock does not work through PgBouncer transaction pooling
http server listening never appears, bind: address already in useHTTP_ADDR, MCP_ADDR or A2A_ADDR collides with another processlsof -i :8080change the address
Helm: config.linehaulConsumerGroup is required ..., ... sets MODE ..., terminationGracePeriodSeconds is 30 - want at least 55chart guard railsthe message names the valueset the value; there is no *_MODE to set

REST answers errors​

Errors are RFC 9457 application/problem+json; the type field is the slug.

ResponseCauseFix
400 idempotency-key-requireda POST without Idempotency-Key (a key that is not 1 to 128 printable ASCII characters is idempotency-key-invalid)send a unique key per logical request
409 idempotency-key-reusedthe same key with a different method, path or body than the request stored under it (a key whose first answer was a state-dependent refusal is released and holds nothing)a client bug: use a new key per logical submit; to retry the same request, resend the identical request (the stored answer is replayed with Idempotency-Replayed: true)
A refusal that does not come back on a retry, or a retry that runs againthe refusal depends on state that can change (concurrent-update, unknown-station, not-found, illegal-transition, route-not-started, the route-planning conflicts): it is not stored, its key is released and the retry under the same key executes again, succeeding once the state allows it; the list is the Idempotency-Key parameter of apis/openapi.yaml and ADR 0019retry the same request with the same key; a refusal replayed with Idempotency-Replayed: true is final for the request (validation-failed, already-delivered, attempt-already-recorded, ...): change the request
400 idempotency-key-invalidthe key is not 1 to 128 printable ASCII characterssend a UUID
400 invalid-limit, invalid-cursor, unknown-query-parametera bad limit, a cursor that was not a nextCursor, or a retired paging parameter (after, offset, nextToken)use limit and the nextCursor of the previous page
422 unknown-stationthe station is not in rm_stations as a DELIVERY_STATIONcheck SELECT * FROM rm_stations;; the node-topology consumer fills it from NodeRegistered. Standalone, seed the row (see Quickstart)
422 invalid-wave-timesthe times do not run inductCutoffAt < windowStart < windowEndfix the body
422 invalid-van-capacityvanCapacity is zero or negativesend a positive capacity
422 validation-failedmalformed JSON, missing or malformed field, NUL byte in the query or body (a NUL in the path is 404)read detail
404 not-found / 404 package-not-on-routeunknown wave, route or partner id / the tracking number is not on that routelist first with GET /waves
409 wave-full, induction-closed, already-inductedthe wave has no stop capacity left, induction is closed, or the package is already in itschedule another wave, or wait for the next induction
409 package-not-inducted, package-already-routed, stop-key-mismatch, route-over-capacity, partner-inactive, partner-station-mismatchPOST /routes rulescheck the wave's stops with GET /waves/{waveId}/stops, the partner's state and vanCapacity
409 route-not-started, route-incomplete, attempt-already-recorded, already-deliveredattempt and completion rulesstart the route first; a package has at most one attempt per route and is delivered at most once across routes
409 illegal-transitione.g. dispatching a cancelled waveGET /waves for the current state
409 concurrent-updateanother request changed the aggregate (version guard)re-fetch and retry
500 internal-erroruntyped failure; the real cause is logged server-side, not returnedfind the log line by request_id; the business counter records it as outcome=rejected, reason=internal-error for attempts
404 not-found on an unknown path, 405 method-not-allowedwrong route; commands are POSTs to /induction-closures, /dispatches, /cancellations, /starts, /deactivations under the wave, route or partner (the :verb routes are gone)see the API reference

Events do not flow​

SymptomCauseCheckFix
Writes succeed but downstream never sees the eventoutbox row unpublished or parkedSELECT id, event_type, attempts, last_error FROM outbox_events WHERE published_at IS NULL ORDER BY id;Kafka reachable? If attempts >= OUTBOX_MAX_ATTEMPTS the row is parked: fix the cause and re-arm with UPDATE outbox_events SET attempts = 0, last_error = NULL WHERE id = <id>
outbox relay pass failed every secondbroker down or unreachable KAFKA_BROKERS/readyz says not ready: kafkarestore connectivity; events are delayed, not lost
First outbox attempt fails, second succeedsthe broker auto-creates a topic on first writeattempts = 2 on the first row of a new topicnone; expected
No consumer running line for a consumer, or the process exits with ... stopped unexpectedly: exiting so the orchestrator restarts the servicea consumer or the relay ended on its own (for example a reader error that is not a transient connection blip)the ERROR line consumer stopped or outbox relay stoppedfix the broker problem; the orchestrator restarts the pod. Up to 10 consecutive transient fetch failures are tolerated
No waves can be scheduled and no routes planned after a fresh deploymentread models empty because the consumer group has no committed offset on a topic that already holds older events, or the producer is silentSELECT count(*) FROM rm_stations;, rm_station_service_areas, rm_package_stops, rm_inbound_packagesa new group starts at the first available offset and replays the topic; if it is empty, the upstream context has produced nothing
Retries on one partition: handling failed; retrying the same messagetransient failure (Postgres down, timeout)the error fieldrestore the dependency; after 5 attempts the message goes to <topic>.dlq
A message sits in <topic>.dlqundecodable CloudEvent, invalid payload, or 5 failed attemptsheaders x-dlq-error, x-dlq-source-topic, x-dlq-source-partition, x-dlq-source-offsetfix the cause, republish the DLQ message to the original topic; the inbox processed_events makes replays idempotent
Packages never reach a waveLoadArrived for a node that is not a delivery station, or no wave with capacity before the induct cutoffpackage_histories.status, rm_inbound_packages; a package with no eligible wave publishes PackageInductionDeferredschedule a wave for that station and date
An unknown event type on a consumed topicconsumers dispatch on the full CloudEvents type and ignore types they have no handler fornothing loggednone; not an error

Readiness and health​

SymptomCauseCheckFix
/readyz 503 {"status":"not_ready"}the pod received SIGTERM and is drainingpod phasenone
/readyz 503 dependency-unavailable, detail not ready: postgres / not ready: kafkathe ping or metadata request failed within 2 sWARN log readiness: dependency is not ready with dependency and errorrestore the dependency; the verdict is cached for 3 s
/readyz 200 but REST writes 500schema or permission problem after the pinginternal-error log lines with the SQL errorcheck the migrations ran (schema_migrations table) and the DB role's rights
cmd/mcp / cmd/a2a has no /readyzby design; only /healthz existsprobe /healthz

MCP and A2A​

SymptomCauseFix
MCP call returns isError text not-found: ... or validation-failed: ...unknown id, or serviceDate not YYYY-MM-DDpass the documented input; every field is required and unknown fields are refused
A2A answers JSON-RPC error -32009 VERSION_NOT_SUPPORTED (requested "0.3", served "1.0")the client sent no A2A-Version headersend A2A-Version: 1.0
A2A returns an in-band problem (not-found 404, validation-failed 422, internal-error 500)skill rejections are answered inside the message, not as JSON-RPC errors; request-shape problems are 400read the data part
Agent Card advertises an address the client cannot reachA2A_AGENT_URL is the in-cluster DNS by defaultset a2a.agentUrl to the Kong path when needed
MCP/A2A return empty lists after a restartthey read the service database cmd/api writes; a different DATABASE_URL shows a different (empty) schemapoint them at the same database

Telemetry is missing​

SymptomCauseFix
No traces or metrics in Jaeger/Prometheus, service worksCollector unreachable; export never blocks and failures are logged at DEBUG onlyrun with LOG_LEVEL=debug and look for opentelemetry error; check OTEL_EXPORTER_OTLP_ENDPOINT
Logs lack trace_idthe record was written without a span-carrying context (a log outside a request or consumer)none; expected for boot lines
Business panel for last_mile_delivery_package_attempted_total is emptyno attempt was reported yetrecord an attempt; see Observability

Tests fail locally​

SymptomCauseFix
make integration fails to start containersDocker not running (testcontainers)start Docker
golangci-lint reports "parallel golangci-lint is running" on git pushthe pre-push hook runs make check and another lint is activewait about a minute and push again
An architecture test fails after adding an eventthe catalogue is pinned (TestEventCatalogueMatchesContract)update the domain event, apis/asyncapi.yaml and ADR 0004 in the same commit