Skip to content
Using the APIb75fc06 · docs: errors

Errors

The shape of an error answer, and what to do about each code.

Every error answer has the same body, with an HTTP status that says the kind of failure:

JSON
{
  "error": {
    "code": "PLAN_LIMIT_REACHED",
    "message": "The Free plan allows 3 cubes; delete one or change plans to add another",
    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
    "limit": "cubes",
    "max": 3,
    "used": 3,
    "plan": "free"
  }
}
  • code is a stable name. Handle errors by code, not by message.
  • message says what went wrong, in words. For a 4xx answer it is safe to show. For a 5xx answer, show a message of your own.
  • requestId identifies the request. Give it to support when you ask about an answer.
  • field names the field a validation error is about, such as revision. Some 4xx answers have it.
  • cubes comes only with DATABASE_REFERENCED: it names the cubes whose variables refer to the database.
  • limit, max, used and plan come only with PLAN_LIMIT_REACHED. limit is one of cubes, previews, build_minutes, bandwidth_gb, free_organizations, size or databases. max and used are counted in its unit.

The codes below are not the only ones: a new code can appear. Handle a code you don't know by its HTTP status.

The request is wrong

StatusCodeWhat to do
400VALIDATION_ERRORThe request is not valid. field names the field to fix, when there is one. A body over 1 MiB (413) or a body that isn't JSON (415) has this code too.
401UNAUTHENTICATEDThe key is missing, unknown, expired or revoked. Check the Authorization header, or make a new key.
403FORBIDDENThe key may not do this: its access level or its owner's role doesn't allow it, or the organization isn't the key's. Use a Full key, a key of an owner with the right role, or the key's own organization.
403API_KEY_NOT_ALLOWEDThe operation belongs to the dashboard. No key can call it. See what a key can't do.
400ENV_KEY_RESERVEDThe key of a variable or secret is set by Cubecen, such as PORT or a name that starts with CUBECEN_. Choose another key.
400ENV_TOO_LARGEThe variables are over a limit. A cube can have 200 entries, a value can be 64 KiB, and keys and values together can be 256 KiB.
404NOT_FOUNDNothing is at this address. Check the IDs, slugs and query values.
404INSTALLATION_NOT_FOUNDThe GitHub connection isn't one of the organization's. Check github_installation_id.

The plan or the state of the cube says no

StatusCodeWhat to do
402PLAN_LIMIT_REACHEDThe organization's plan doesn't allow this. limit, max, used and plan say which limit. Free up room, wait for the plan's next period, or change plans, then try again. A refused request leaves nothing behind.
409CONFLICTThe request conflicts with the current state, such as a slug that is already taken. It can also mean the request expired and needs a new Idempotency-Key.
409IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key was already used for a different request. Use a new key for a new action.
409BUILD_IN_PROGRESSThis commit is already queued or being built. Follow that build.
409DEPLOYMENT_IN_PROGRESSA release of this cube is already in progress. Wait for it, or cancel it.
409APPLICATION_NOT_READYThe cube is still being created, or its creation failed. Read the cube until its state is active.
409BUSYAnother operation on this cube is in progress. Retry in a few seconds.
409BUILD_NOT_DEPLOYABLEOnly a successful build can be deployed. Check the build's release_status.
409SIZE_UNAVAILABLEThe size isn't offered right now. Choose a smaller size.
409ENV_CHANGEDThe variables changed since you read them: expected_version is not the current version. Read them again, check your change and send it again.
409ENV_VERSION_UNAVAILABLEThe variables of that version are no longer kept, or can't be read, so it can't be brought back or compared.
409DOMAIN_TAKENThe hostname is taken: another cube serves it, or this cube already has it. A domain can also fail with this code in its error, when another cube proved the hostname first.
409DOMAIN_LIMIT_REACHEDThe cube has as many custom domains as it can have, 10. Remove one first.
409DATABASE_NOT_READYThe database isn't ready yet. A build or a deployment of a cube that refers to it gets this code too. Read it until its status is ready, then try again with a new Idempotency-Key.
409DATABASE_REFERENCEDCubes refer to the database in their variables, and cubes names them. A database they refer to can't be deleted, and its slug can't change. Change their variables first.
422ENV_REFERENCE_BROKENA variable refers to a cube or database that is no longer in the project, to a database that is being deleted, or to the private address of a cube that has none yet. Change the variable, or wait a minute for the address, then try again with a new Idempotency-Key.

A refusal with BUILD_IN_PROGRESS, DEPLOYMENT_IN_PROGRESS or PLAN_LIMIT_REACHED sticks to the Idempotency-Key of the request it refused. To try again, send a new key.

GitHub says no

StatusCodeWhat to do
422REPOSITORY_NOT_ACCESSIBLECubecen can't read the repository: the access was removed, GitHub blocks it, or a public repository is no longer public or has moved.
422REVISION_NOT_FOUNDThe branch, tag or commit isn't in the repository.
422REPOSITORY_EMPTYThe repository has no commits yet. Push a commit, then try again with a new Idempotency-Key.
422GITHUB_INSTALLATION_REMOVEDThe Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again in the dashboard.
422GITHUB_INSTALLATION_SUSPENDEDThe Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub.
422GITHUB_PERMISSIONS_MISSINGThe GitHub account hasn't approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub.
502GITHUB_UNAVAILABLEGitHub is temporarily unavailable. Retry the same request.
503GITHUB_RATE_LIMITEDGitHub's rate limit was reached. Retry after the seconds in Retry-After.

Slow down, then retry

StatusCodeWhat to do
429RATE_LIMITEDThe key made too many requests. Wait for the seconds in Retry-After, then retry. See Rate limits.
500INTERNAL_ERRORSomething went wrong on our side. Retry; if it keeps failing, give support the requestId.
503DATABASE_UNAVAILABLEThe service is temporarily unavailable. Retry the same request with backoff.
503MAINTENANCEThe platform is in maintenance. Builds and other changes are paused for a short while. Retry after the seconds in Retry-After.
503DATABASES_UNAVAILABLEDatabases are temporarily unavailable. Retry the same request with backoff.
503LOGS_UNAVAILABLELogs are temporarily unavailable. Retry the same request with backoff. A log stream that breaks off sends an unavailable event with this code and a cursor: open the stream again with it.
503METRICS_UNAVAILABLEMetrics are temporarily unavailable. Retry after the seconds in Retry-After.
503REQUEST_TIMEOUTThe request took too long and was stopped. Its work may still have been done: retry with backoff, and with the same Idempotency-Key when the request takes one.

Any other 5xx

A 5xx answer is a failure on our side, or of a service we rely on. Any 5xx that isn't listed above is a temporary outage: retry with backoff, which means waiting a little longer after each failed attempt. If it keeps failing, give support the requestId.

When the request takes an Idempotency-Key, retry with the same key: you get the first answer, and the work isn't done twice. See Requests.