400 idempotency-key-required / idempotency-key-invalid | a POST/PUT without the header, or a key that is not 1-128 printable ASCII characters | send a unique key per logical request (not needed on the two sweeps) |
409 idempotency-key-reused | the same key with another method, path or body (also while the key still holds a stored answer; after a RETRYABLE refusal the key is free and another body is a new request) | use a new key; to retry, send the identical request |
409 concurrent-modification | the aggregate was changed by another request (version guard); any POST or PUT can answer it except the two sweeps, which skip what changed | re-read and retry, with the same Idempotency-Key or a new one: this refusal is RETRYABLE, nothing is stored under the key and the retry runs the command again (ADR 0019) |
A refusal that "stays" under a key: 4xx with Idempotency-Replayed: true | the problem type is FINAL (the same request cannot pass: validation, invalid-*, visit-not-found and the other ids this service minted, precondition-failed, inspection-closed, ...) or OUTCOME (carrier-suspended); the table is in ADR 0019 | change the request, or send a new key once what the refusal names is fixed |
409 / 404 / 422 that passes on a retry with the same key (visit-already-open, trailer-on-hold, location-occupied, no-claimable-move, unknown-location, unknown-appointment, unknown-template, ...) | RETRYABLE: the answer depends on state that changes (a visit checks out, a hold is released, a spot frees, a facility or dock-scheduling event arrives); nothing was stored under the key | retry with the same key once the state is right; if it still refuses, read the problem detail |
412 precondition-failed on PUT /sites/{siteId}/yard-policy | If-Match is not the policy's current version | GET the policy, send its ETag |
400 invalid-if-match | If-Match is not an entity tag of a policy version | send the ETag returned by GET |
400 unknown-query-parameter, invalid-limit, invalid-cursor, invalid-state | list endpoints reject unknown parameters, bad limit, a cursor not produced by the service, a state outside the enum | fix the query |
400 invalid-report-range, invalid-threshold-minutes | from/to must be RFC 3339, to after from, at most 92 days; thresholdMinutes an integer from 1 to 10080 | fix the query |
409 visit-already-open | an open visit exists for that plate at the site (unique index uq_yard_visits_one_open_per_plate) | check the visit out first |
409 appointment-required | the site's yard policy has requireAppointment | send a booked appointmentId or change the policy |
409 no-free-spot | no free Yard slot for the trailer (also when the facility feed has not loaded the site) | free a spot, or load the layout |
409 location-occupied, destination-reserved, trailer-has-open-move | a spot or door holds a trailer or is reserved by an open move; one open move per trailer (partial unique indexes) | wait or choose another destination |
409 door-closed, door-flow-mismatch | a door closure copy covers it; the door's flow (Inbound/Outbound/Both) does not match the trailer | pick another door or wait for DoorClosureLifted |
409 trailer-on-hold / trailer-not-on-hold | move or release of a held trailer / release of one not held | release the hold first |
409 trailer-not-released, seal-required | check-out of a trailer that is not on site, still has an open move, is DOCKED with door work not DONE, or is a LOADED outbound trailer without a seal | finish the work, close the move, record the seal (POST /trailers/{trailerId}/seals) |
409 door-work-open | releasing the securing (POST /trailers/{trailerId}/securing-releases) while door work is IN_PROGRESS (ADR 0013); check-out answers trailer-not-released first | complete the door work first |
409 hostler-busy, not-lease-holder, lease-not-expired | a hostler can hold one claimed move; only the lease holder completes it | complete or cancel the current move |
404 no-claimable-move | POST /moves/claims found no REQUESTED hostler move at the site | expected when idle |
a CLAIMED move is not released after the lease | the lease sweep did not run (the CronJob is the only scheduler) | kubectl get cronjob; run POST /move-lease-sweeps by hand; the default lease is 300 s |
no TrailerDwellExceeded events | the dwell sweep did not run, or the site's policy has no dwellThresholdMinutes for that trailer kind | the CronJob, GET /sites/{siteId}/yard-policy |
409 trailer-not-secured | door work started on a trailer that is not secured and the site yard policy has requireSecuringBeforeDoorWork true (ADR 0013) | record the securing (POST /trailers/{trailerId}/securings, a restraint or wheel chocks), or turn the policy off |
409 inspection-required | the site yard policy has requiredInspections for the gate (PRE_DOCK move to a door, PRE_LOAD door work on a trailer being loaded, PRE_DEPARTURE check-out) and the trailer has no completed inspection of that template at that gate (ADR 0015) | open, fill in and complete one (POST /trailers/{trailerId}/inspections, PUT /inspections/{id}/items/{itemCode}, POST /inspections/{id}/completions), or drop the rule from the policy |
409 inspection-failed | the latest completed inspection of the required template at that gate FAILED (the failed required item also held the trailer) | release the hold (POST /trailers/{trailerId}/hold-releases) after the fix, then pass a new inspection of the same template and gate |
409 trailer-still-secured | a move off the door, or the check-out, of a trailer whose restraint or chocks were recorded and not released | POST /trailers/{trailerId}/securing-releases once the restraint is off, then retry |
409 seal-class-too-low | the site yard policy has minimumSealClass and the seal at check-in or record-seal is of a lower class or has none | send a sealClass at or above the minimum, or change the policy |
409 carrier-suspended | dock-scheduling suspended the carrier (carrierScac) and the site yard policy has suspendedCarrierAction REJECT; the visit is recorded as REJECTED with reason CARRIER_SUSPENDED although the call fails; a retry under the same Idempotency-Key replays the stored 409 and records nothing new | check the carrier standing with dock-scheduling; reinstate it there, or set suspendedCarrierAction to FLAG (admit and flag) or NONE |
422 invalid-unit-number | a CONTAINER (or a unit declared unitNumberScheme: ISO6346) whose number is not a valid ISO 6346 number; the detail names the expected check digit | correct the number, or the kind if it is not a container |
409 placement-rule-violated | a trailer that declares a hazard class was sent to a yard spot that is not HAZMAT (or the site has no HAZMAT spot and the policy does not allowHazmatOnUnclassifiedSpots), or a trailer that requires temperature control to a spot that is not REEFER_PLUG at a site that has plugs (ADR 0014); the detail names the rule and the spot | choose a spot of the right kind (the facility-layout spotKind), correct the trailer's declaration with POST /trailers/{trailerId}/classifications, or have the site publish HAZMAT or REEFER_PLUG spots |
422 invalid-hazmat-class, invalid-un-number | a hazard class that is not a US DOT class or division (1 to 9, 1.4, 2.1...), or a UN number that is not UN and four digits (ADR 0014) | send a valid value or leave the field out |
422 invalid-seal-class | a seal class (or the policy's minimumSealClass) that is not I, S or H | use one of the three |
422 unknown-location, unknown-appointment, invalid-carrier, validation, unexplained-destination | a value or reference the model refuses; locations and appointments are event-fed copies | fix the body; check the copies are loaded |
400 malformed-request-body or 404 resource-not-found on a NUL character | U+0000 is refused uniformly (it would be a Postgres error otherwise): in the query or the body it is the 400, in the path the 404 | remove it |
404 resource-not-found | the path matches no route (or carries a NUL character) | check the path against the endpoint table of the API overview |
405 method-not-allowed | the path exists and does not take that method; the Allow header lists the ones it takes | use a listed method |
500 internal-error | an unexpected error; the cause is only in the log (request failed, method, path, error) | find the ERROR line |
GET /reports/* on the api returns rows empty | ANALYTICS_READER_DATABASE_URL is unset on the api, so it answers the contract shape with no rows | set it, or call yard-reports; the MCP get_yard_dwell_report tool always answers no rows (the reader is not wired in cmd/mcp) |
/reports/* rows are stale | the projector is behind or down | GET /reports/freshness; projector logs and lag of its group |