Error codes

platform_standby

Platform on standby

HTTP 503

Answering the request needed a write the platform couldn't make just then: our standby, during a failover, makes no writes (nothing was written), and the primary pauses writes for a few seconds during a planned switchover. Send the same request again after the seconds in Retry-After, with the same Idempotency-Key where the operation takes one. A signed request is signed anew, with a new nonce: whether this one's nonce was spent depends on which write was refused.

The platform's answer: plain JSON

During a failover, the platform can answer a write (POST or PATCH) itself, before the API sees it. Nothing was written: send the same request again after the seconds in Retry-After, with the same Idempotency-Key where the operation takes one. Reads are not refused this way.

This answer has no code, type or request_id, and no X-Request-Id header, so branch on error when there is no code.

The platform's answer: status and headers
HTTP 503
content-type: application/json; charset=utf-8
retry-after: 60
x-sa-platform-mode: standby
The platform's answer: body
{
  "error": "platform_standby",
  "message": "This deploy is running in PLATFORM_MODE=standby and is not the active writer. Side-effecting requests are refused so the read-only replica can't diverge from the primary. Retry against the active platform."
}

The API's answer: a problem

The API answers this problem, with Retry-After too, when a write reaches it that the platform couldn't make just then: the standby's database refuses every write during a failover, and the primary pauses writes for a few seconds during a planned switchover.

Sent as application/problem+json, with the request id in request_id and the X-Request-Id header. Branch on code: the error and detail sentences can change, and some operations add members of their own.

Example problem
{
  "error": "Platform on standby",
  "code": "platform_standby",
  "type": "https://secondappraisal.com/developers/errors/platform_standby",
  "title": "Platform on standby",
  "status": 503,
  "detail": "Platform on standby",
  "instance": "/api/gap/v1/referrals",
  "request_id": "req_4f9a2c7e1b8d4a6f9c3e2b1a7d5f8e0c"
}

Operations that can send it