Databases / Error codes
Database error codes
Every code the API returns for databases, their storage and snapshots, attached security groups and a VPS's private network interface, and what to do about each.
Reading an error
Every error is a problem document with a stable code; the errors guide explains the shape. Two kinds matter here:
-
A refused request. The API answers with a
4xxor5xxand nothing changes. For an invalid field the answer is422 VALIDATION_FAILED, and the field's own code is insideerrors:JSON { "status": 422, "code": "VALIDATION_FAILED", "title": "Validation failed", "detail": "One or more fields are invalid.", "request_id": "req_…", "errors": [ { "field": "storage_gb", "code": "INVALID_DATABASE_STORAGE", "message": "must be at least the plan's disk size (or the zone's minimum), at most the zone's maximum, a multiple of the zone's step above the plan's size, and larger than the current size when resizing" } ] } -
A failed operation. The request was accepted (
202), but the change could not be made. The operation endsfailed, and itsfailure.codesays why (with a readablefailure.reason). For a new database the order carries afailure_codetoo, such aspayment_expired(not paid within an hour) ororganization_deleted(the organization was deleted first, so the order was cancelled and any payment returned to credit).
Quote request_id, or the operation's id, to support.
Creating a database
Field codes, inside errors on a 422:
code | Field | Means | What to do |
|---|---|---|---|
INVALID_DATABASE_NAME | name | Not 1 to 255 characters | Shorten it |
INVALID_DATABASE_ENGINE | engine | Not postgresql, mysql or mariadb | Use one of those |
INVALID_DATABASE_VERSION | version | Not a version line offered for the engine | Pick one from GET /database-engines |
INVALID_DATABASE_ZONE | zone_id | Not a zone your organization can use | Use af-abj-1 or af-abj-2 |
DATABASE_VERSION_NOT_AVAILABLE_IN_ZONE | zone_id | That version cannot be created in that zone yet | Check the version's zones in the catalogue |
PLAN_NOT_FOUND | plan_slug | Not an active plan | Pick one from GET /plans |
DATABASE_SUBNET_REQUIRED | subnet_id | A database in af-abj-2 needs a subnet | Send the subnet's id |
DATABASE_SUBNET_NOT_ALLOWED | subnet_id | A database in af-abj-1 takes no subnet | Leave subnet_id out |
DATABASE_SUBNET_NOT_FOUND | subnet_id | Not one of your subnets | Check the id |
DATABASE_SUBNET_WRONG_ZONE | subnet_id | The subnet is in another zone | Use a subnet in zone_id |
DATABASE_SUBNET_NOT_USABLE | subnet_id | The subnet is being deleted or has failed | Use another subnet |
INVALID_DATABASE_ADMIN_USERNAME | admin_username | Not 3 to 32 lowercase letters, digits and underscores starting with a letter, or a reserved name | Choose another; see create |
INVALID_DATABASE_PASSWORD | password | Not 16 to 128 printable characters, or contains a space, quote or backslash | See the rules |
INVALID_DATABASE_STORAGE | storage_gb | Smaller than the plan's disk, over 2,000 GB, or off the 10 GB step | See allowed sizes |
INVALID_ACCESS_RULE | access_rules | Not an IPv4 CIDR, wider than a /8, or 0.0.0.0/0 | Narrow it |
TOO_MANY_ACCESS_RULES | access_rules | More than 50 | Use wider ranges, or a security group |
DUPLICATE_ACCESS_RULE | access_rules | The same CIDR twice | Remove the repeat |
Other refusals:
code | Status | Means | What to do |
|---|---|---|---|
INSUFFICIENT_CREDIT | 402 | Not enough credit, and no card for the upfront payment | Add funds or a card |
DATABASE_NAME_TAKEN | 409 | You already have a database with that name | Choose another |
ACCOUNT_SUSPENDED | 409 | An invoice is overdue | Pay it; nothing new can be created until then |
IDEMPOTENCY_CONFLICT | 409 | The Idempotency-Key was used for a different request | Use a new key |
DATABASE_HOSTNAME_UNAVAILABLE | 503 | A hostname could not be reserved | Retry with a new Idempotency-Key |
DATABASE_STORAGE_UNAVAILABLE | 503 | Database storage is not offered in that zone yet | Try later, or the other zone |
DATABASES_UNAVAILABLE | 503 | Databases are not available right now | Try again later |
An order can also end payment_failed or failed after it was accepted: see why an order failed.
Reading and changing a database
code | Status | Means | What to do |
|---|---|---|---|
DATABASE_NOT_FOUND | 404 | No database of yours has that id | Check the id and the API key's organization |
RESOURCE_NOT_FOUND | 404 | The id is not a database id at all (db_…) | Check the path |
DATABASE_ORDER_NOT_FOUND | 404 | No order of yours has that id | Check the id |
DATABASE_NOT_RUNNING | 409 | The change needs the database running: a password change, a reset, or a storage resize | Start it, wait for running, retry |
DATABASE_NOT_STOPPED | 409 | The change needs it stopped | Stop it first |
INVALID_RESOURCE_STATE | 409 | It is being deleted, or has been | Nothing more can be changed on it |
CONCURRENT_UPDATE | 409 | It changed while the request was being handled | Retry the same request |
DATABASE_ACCESS_RANGE_LIMIT_EXCEEDED | 422 | Its rules plus its security groups' ranges would exceed 1,024 | Remove some ranges |
Security groups on a database
From PUT /databases/{database_id}/security-groups. Field codes, on security_group_ids:
code | Means | What to do |
|---|---|---|
INVALID_DATABASE_SECURITY_GROUPS | More than 5 groups, or one listed twice | Send at most 5 distinct ids |
DATABASE_SECURITY_GROUP_NOT_FOUND | Not one of your security groups | Check the ids |
DATABASE_SECURITY_GROUP_WRONG_ZONE | The group is in another zone | Attach groups from the database's zone |
DATABASE_SECURITY_GROUP_NOT_USABLE | The group is being deleted, or failed | Use another group |
From the security group's side:
code | Status | Means | What to do |
|---|---|---|---|
SECURITY_GROUP_ATTACHED_TO_DATABASE | 409 | Deleting a group a database uses; detail names the database | Detach it from that database first |
DATABASE_ACCESS_RANGE_LIMIT_EXCEEDED | 422, on rules | A rule change would give an attached database more than 1,024 ranges | Use fewer, wider ranges |
A rule of an attached group that does not apply to the database is not an error: it is listed in the database's ignored_security_group_rules with a reason.
Storage
From POST /databases/{database_id}/resize-storage:
code | Status | Means | What to do |
|---|---|---|---|
INVALID_DATABASE_STORAGE | 422, on storage_gb | Not larger than the current size, over 2,000 GB, or not a multiple of 10 | Pick a valid size |
DATABASE_NOT_RUNNING | 409 | The database is stopped | Start it first |
DATABASE_STORAGE_RESIZE_IN_PROGRESS | 409 | A resize is already running | Wait for it, then retry |
ACCOUNT_SUSPENDED, ACCOUNT_NOT_ACTIVE | 409 | The account cannot take on new charges | Settle billing first |
DATABASE_STORAGE_UNAVAILABLE | 503 | Storage changes are not offered in that zone yet | Try later |
A resize operation can fail with:
failure.code | Means | What to do |
|---|---|---|
DATABASE_STORAGE_RESIZE_FAILED | The disk could not be grown. Nothing changed | Retry; contact support if it repeats |
DATABASE_STORAGE_GROW_FAILED | The disk grew, but the filesystem could not be, or the database could not be reached. Size and bill unchanged | Check it is running, then retry the same size |
Snapshots
From database snapshots:
code | Status | Means | What to do |
|---|---|---|---|
INVALID_DATABASE_SNAPSHOT_NAME | 422, on name | Empty, or over 255 characters | Fix the name |
DATABASE_SNAPSHOT_NAME_TAKEN | 409 | The database already has a snapshot of that name | Choose another |
DATABASE_SNAPSHOT_NOT_READY | 409 | The database is not running or stopped: it is being created, changing state, or being deleted | Wait for it to settle |
DATABASE_SNAPSHOT_NOT_FOUND | 404 | No snapshot of this database has that id | Check both ids; a snapshot of a volume or a machine is not under a database |
ACCOUNT_SUSPENDED | 409 | The account cannot take on new charges | Settle billing first |
A VPS's private network interface
From POST and DELETE /instances/{instance_id}/private-network:
code | Status | Means | What to do |
|---|---|---|---|
SECURITY_GROUP_ALLOWS_PRIVATE_NETWORK | 409 | The VPS's security group admits some of 10.250.0.0/20; detail names the rules | Narrow them |
PRIVATE_NETWORK_NOT_AVAILABLE | 409 | The VPS is in a VPC, or its zone has no database network | Only for standard VPSes in af-abj-1 |
NOT_FOUND | 404 | Private network interfaces are not offered on this platform yet | Try again later |
INSTANCE_NOT_SETTLED | 409 | The VPS is starting, stopping, resizing, restoring or being deleted | Wait until it is running or stopped |
PRIVATE_NETWORK_ALREADY_ATTACHED | 409 | It has the interface, or one is being added | Nothing to do |
PRIVATE_NETWORK_NOT_ATTACHED | 409 | Removing an interface it does not have | Nothing to do |
PRIVATE_NETWORK_CHANGE_IN_PROGRESS | 409 | An attach or detach is still running | Follow that operation |
ACCOUNT_SUSPENDED | 409 | Attaching from a suspended account | Pay the overdue invoice; detaching is always allowed |
While a VPS has the interface, its security group is held to the same rule:
code | Status | Means |
|---|---|---|
RULE_ALLOWS_PRIVATE_NETWORK | 422, on rules | A rule change on the group would admit 10.250.0.0/20 |
SECURITY_GROUP_ALLOWS_PRIVATE_NETWORK | 422, on security_group_id | Moving the VPS to a group that admits it |
An attach or detach operation can fail with:
failure.code | Means | What to do |
|---|---|---|
SECURITY_GROUP_ALLOWS_PRIVATE_NETWORK | The group's rules changed to admit the range before the interface was added. Nothing was added | Narrow them, then retry |
INSTANCE_BUSY | The VPS stayed busy with another change | Retry with a new Idempotency-Key |
INSTANCE_PRIVATE_NETWORK_ATTACH_FAILED | The interface could not be added. Nothing changed | Retry; contact support if it repeats |
INSTANCE_PRIVATE_NETWORK_DETACH_FAILED | The interface could not be removed. It is still attached | Retry |
Operations on a database
Other failure.codes a database operation can end with:
failure.code | Means | What to do |
|---|---|---|
DATABASE_DEPLOY_FAILED, DATABASE_SETUP_TIMED_OUT | A new database could not be built. Its order ends failed and the payment returns to your credit | Order again |
DATABASE_START_FAILED, DATABASE_STOP_FAILED | A power change did not complete | Retry |
DATABASE_DELETE_FAILED | Deletion did not complete | Retry the delete |
DATABASE_NOT_READY, DATABASE_GUEST_COMMAND_FAILED, DATABASE_GUEST_RETRIES_EXHAUSTED | A change inside the database (access rules, a password, storage) could not be applied; the database kept its previous settings | Check it is running, then retry |
DATABASE_EFFECTIVE_RULES_EXCEEDED | The allow-list came to more than 1,024 ranges, so nothing was changed | Remove ranges from its rules or groups |
DATABASE_PASSWORD_LOST | A password change could not be completed and its password is gone | Reset the password |
DATABASE_DELETED | The database was deleted while the change was waiting | Nothing to do |
PROVISIONING_CAPACITY_UNAVAILABLE, PROVISIONING_ADDRESSES_EXHAUSTED, PROVISIONING_IMAGE_UNAVAILABLE | The zone had no room, address or image for it right now | Try another plan or zone, or try again later |
PROVISIONING_LIMIT_EXCEEDED | Your account reached a limit | Delete what you no longer use, or contact support |
PROVISIONING_RESOURCE_BUSY, PROVISIONING_UNAVAILABLE | The platform was busy or briefly unavailable | Retry in a few minutes |
PROVISIONING_RESOURCE_CONFLICT, PROVISIONING_RESOURCE_NOT_FOUND, PROVISIONING_INVALID_REQUEST, PROVISIONING_INTERNAL_ERROR, PROVISIONING_FAILED | The platform could not make the change. See every provisioning code | Follow failure.reason; contact support with the operation id if it repeats |
New codes may be added. Treat one you do not know by its HTTP status, or as a failed operation you can retry.