Skip to main content

Troubleshooting

Each entry is symptom, cause, check, fix, taken from the failure modes in the code. Commands assume the chart's defaults (namespace and release pricing). See the Runbook for the procedures and Observability for the log messages.

Boot failures​

SymptomCauseCheckFix
Exit 1, log DATABASE_URL is required: this context runs on real Postgres, there is no in-memory modeDATABASE_URL emptykubectl -n pricing get secret pricing-db has the DATABASE_URL keySet database.existingSecret / database.url; there is no fallback mode
KAFKA_BROKERS is required: this context runs on real Kafka (outbox relay, consumers, /readyz)KAFKA_BROKERS empty or only commas and blankskafka.brokers valueSet a comma-separated broker list
OFFER_AVAILABILITY_CONSUMER_GROUP is required: the consumer always runs on real KafkaGroup id not setconfig.offerAvailabilityConsumerGroupSet a stable, service-prefixed id such as pricing-offer-availability; the chart also refuses to render without it
PRICING_CURRENCY "usd" is not an ISO 4217 code (three upper-case letters)Lower-case or wrong-length codeconfig.currencyUse USD, BRL and so on
cmd/a2a: invalid configuration: A2A_AGENT_URL is required... or A2A_AGENT_URL="..." is not an absolute http(s) URLAgent URL missing, relative or schemelessa2a.agentUrl (empty defaults to the in-cluster Service URL)Give an absolute http(s) URL clients can dial
Pod in CrashLoopBackOff, logs show retrying with op = run migrations or ping postgres, then exitPostgres unreachable for the whole bounded retry (five attempts, 1+2+4+8 s) or a migration failskubectl -n pricing logs deploy/pricing --previous; try the DSN with psqlFix the DSN, network policy or mesh sidecar start-up; for a pooled DSN make sure the MIGRATIONS_DATABASE_URL key is a direct connection
Migrations hangDATABASE_URL goes through a transaction-mode pooler and MIGRATIONS_DATABASE_URL is unsetIs the migrations key in the Secret?Populate database.migrationsExistingSecretKey with a session-mode DSN
Tuning value ignored, WARN invalid OUTBOX_RELAY_INTERVAL; using the default (or POLICY_INTERVAL, OUTBOX_MAX_ATTEMPTS, SHUTDOWN_DRAIN_DELAY)Malformed or non-positive valueThe warning carries value and defaultUse a Go duration (5s) or plain seconds; OUTBOX_MAX_ATTEMPTS takes a non-negative integer
Helm refuses to renderA mandatory value is missing, a *_MODE or *_CONSUMER_GROUP is in extraEnv, or terminationGracePeriodSeconds is below drain + 40 sThe failure names the valueFix the value

Readiness and liveness​

SymptomCauseCheckFix
/readyz is 503 with body {"status":"not_ready"}Shutdown has started: the drain gate flippedPod is TerminatingExpected during a rollout; the pod stays live until the drain delay passes
/readyz is 503 dependency-unavailable (problem detail not ready: kafka or not ready: postgres), /healthz is 200The named dependency does not answer within 2 s (verdict cached 3 s)The WARN log readiness: dependency is not ready (dependency, error) carries the causeRestore the dependency; the pod stays up and live and becomes ready on its own
Pod restarts with <worker> stopped unexpectedly: exiting so the orchestrator restarts the serviceThe relay, the consumer or the policy loop returned on its own, usually a lost broker after 10 consecutive fetch failures--previous logs, the worker name, the preceding ERRORFix Kafka connectivity; the restart is deliberate
cmd/a2a ready while Postgres is downIts readiness probe is /healthz, which checks nothingA skill call answers a 500 problemCheck Postgres; each skill reports a failure in band

REST problem types​

Errors are RFC 9457 application/problem+json with type /problems/<slug> (internal/adapters/inbound/http/errors.go). Of the refusals, only the FINAL ones are stored under the Idempotency-Key; a RETRYABLE one releases the key, so retrying the identical request with the same key executes the work again (ADR 0011).

StatusSlugCauseFix
400malformed-requestBad JSON, unknown field, wrong type, body over 64 KiB, or a NUL character in path, query or bodySend exactly the fields of apis/openapi.yaml
400idempotency-key-requiredA POST without an Idempotency-Key headerSend a unique key per logical request
400idempotency-key-invalidAn Idempotency-Key that is longer than 128 characters or has a byte outside printable ASCIISend 1 to 128 printable ASCII characters, e.g. a UUID
400invalid-limit / invalid-cursor / unknown-query-parameterGET /item-prices with a limit outside 1 to 500, a cursor that does not decode, or any parameter other than limit and cursor (the retired after, offset, nextToken, from)Page with limit and the nextCursor of the previous page
409idempotency-key-reusedThe same key with a different method, path or body under a stored answer (a stored answer lives 24 h)Use a new key, or resend the identical request to get the replay; this is a client bug, do not retry blindly
404not-foundUnknown item price, quote or sale id, or no current schedule or tax table on GET .../currentCreate it first
409overlapping-sale-windowThe new sale window overlaps a live one of the same itemCancel the other sale or choose another window
409non-increasing-versionPublished version of a schedule or tax table is not above the current onePublish current version + 1
409concurrent-updateA version mismatch: PUT .../list-price with a stale version, a second create for the same item, or a lost race after the in-process retry (2 attempts for commands, 5 for consumed events)Re-read the resource and retry
409illegal-transitionA command on a WITHDRAWN price (set list price, schedule or cancel a sale, withdraw again)A withdrawn price is never revived (ADR 0002 A3)
422unknown-catalog-itemThe item is unknown or DISCONTINUED in the local catalog_items viewCheck the offer-availability consumer is running and the CatalogItemCreated event arrived
422sale-not-below-listA sale price is not below the list price, or a new list price is not above an existing sale priceLower the sale or raise the list price
422incomplete-charge-scheduleA schedule does not name a charge for every classic tier (SAME_DAY, NEXT_DAY, TWO_DAY, STANDARD); CONSOLIDATED is optionalAdd the missing tier
422overlapping-tax-bandTax bands overlapMake the prefix ranges disjoint
422rate-out-of-rangerateBasisPoints outside 0 to 10000Fix the rate
422item-not-pricedA quote line names an item with no price or a WITHDRAWN onePublish the price (POST /item-prices)
422empty-quoteA quote request with no linesSend at least one line
422no-charge-schedule / no-tax-tableNo CURRENT schedule or tax table was ever publishedPublish one; until then every checkout fails (watch pricing_quotes_issued_total by reason)
422negative-amountA negative amountAmounts are zero or more minor units
422currency-mismatchAn amount is not in PRICING_CURRENCY (the kind cluster configures USD)Send the configured currency
422validation-failedAny other value rule: invalid id (1 to 64 characters of A-Z a-z 0-9 . _ : -), quantity outside 1 to 1000, more than 100 lines or 50 groups, a line in no group or in two, a postal prefix that is not 3 upper-case letters or digits, more than 50 sale windows, a window that ends in the pastThe detail names the rule
500internal-errorAn unexpected error (never leaks the message; it is logged)Read the ERROR log line with the same request_id

Events and the outbox​

SymptomCauseCheckFix
Downstream contexts do not see price changesThe outbox is not drainingSELECT count(*), min(created_at) FROM outbox_events WHERE published_at IS NULL; logs outbox relay pass failedRestore Kafka; the relay resumes by itself
Rows stay unpublished with attempts equal to OUTBOX_MAX_ATTEMPTSA row reached the attempt cap and was excluded (ERROR outbox relay: row reached the attempt cap...); later rows overtake itSELECT id, event_type, attempts, last_error FROM outbox_events WHERE published_at IS NULL AND attempts >= 20Fix the cause in last_error, then UPDATE outbox_events SET attempts = 0 WHERE id = ...
An item's price changed but no ItemPriceChangedThe published view did not move: the event is raised only when list price, effective price or sale end differs from the last published oneCompare the item's evaluated_at and published_* columnsExpected
A sale started but the event came lateThe boundary pass runs every POLICY_INTERVAL (5 s)Log policy pass done with handledLower POLICY_INTERVAL; the effective price on GET is correct meanwhile
Duplicate events seen downstreamDelivery is at-least-once; a crash between send and UPDATE resends the rowThe id of the CloudEvent is stableConsumers dedupe on id
PriceQuoteIssued is not on retailnetwork.pricing.eventsIt is analytics-onlyLook at retailnetwork.pricing.analyticsExpected; there is no PriceQuoteExpired event at all

Consumer​

SymptomCauseCheckFix
New catalogue items never become priceable (unknown-catalog-item)The consumer is behind, stuck or on the wrong groupLog consumer running (topic, group_id); broker consumer-group lag; SELECT * FROM catalog_itemsVerify OFFER_AVAILABILITY_CONSUMER_GROUP is the intended stable id (a fresh id replays the topic from the beginning)
A partition stops advancingA message cannot be dead-lettered (the DLQ publish retries forever)ERROR offer-availability dead-letter publish failed; retrying the same messageMake the DLQ topic writable (auto-creation or create it by hand)
Messages on retailnetwork.offer-availability.events.dlqA payload that can never apply (invalid catalogItemId) or five failed transient attemptsHeaders x-dlq-error, x-dlq-source-offsetFix the cause and re-publish the value to the source topic
WARN skipping a message that is not a valid CloudEventA message that is not CloudEvents 1.0 JSON on the topictopic, consumer in the lineFix the producer; the message is committed past
A discontinued item still has an active priceThe CatalogItemDiscontinued event was not consumed, or the price was already WITHDRAWNcatalog_items.state and item_prices.stateWithdraw manually with POST /item-prices/{catalogItemId}/withdrawals

A2A agent​

SymptomCauseCheckFix
Agent Card advertises an unreachable URLA2A_AGENT_URL is the in-cluster default but the client is off-clustercurl .../.well-known/agent-card.json and read the interface URLSet a2a.agentUrl to the gateway URL
Answer is a problem with status 400 and type .../malformed-skill-request or .../invalid-argumentThe first message part is not {"skill": ..., "arguments": {...}}, a field is unknown (rejected, never ignored), or a required argument (catalogItemId, quoteId) is missingThe problem detail; types are under https://errors.pricing.warehouse-systems.devSend exactly the documented shape; skills are item_price and quote_status
Answer is a 404 problem (.../not-found)Unknown id, an id longer than 128 characters, or an id with NULSame id on GET /item-prices/{id}Expected
Answer is a 400 problem .../unknown-skillAny skill other than the twoAgent Card skillsUse a listed skill; the agent has no write skill
Answer is a 500 problem .../internal-errorA use-case error that is not a miss, usually PostgresERROR log a2a skill failedCheck Postgres