Skip to content

Error codes ​

Every standard application error the framework answers has a stable code, and every validation message has one too. Use this page when you write a client, translate the panel's messages or match errors in tests. The response shape is described in Errors.

Validation codes ​

A 422 response lists each message in errors / formErrors (English) and, in the same order, its code and parameters in issues / formIssues:

json
{
  "message": "The given data was invalid.",
  "code": "validation_failed",
  "errors": { "title": ["may not be longer than 200 characters"] },
  "issues": { "title": [{ "code": "max_length", "params": { "max": "200" } }] }
}

Clients translate by code and fall back to the message; parameters are text. A message that follows none of the templates below (one written by your own code) has the code custom (rustcms::i18n::CUSTOM) and params.message holds it. The table lists every template of rustcms::i18n::TEMPLATES; a test keeps it complete.

CodeEnglish
requiredis required
invalidis invalid
not_allowedis not allowed
not_foundwas not found
several_matchesmatches several records
not_importedcould not be imported
set_by_relationis set by the relation
takenhas already been taken
confirmationdoes not match
emptyis empty
given_twicemay only be given once
not_instantmust be a date and time (RFC 3339)
not_after_sincemust be after since
token_invalidis invalid or has expired (a reset or invitation link)
max_lengthmay not be longer than {max} characters
max_bytesmay not be longer than {max} bytes
min_lengthmust be at least {min} characters
too_longis too long
too_largeis too large
max_itemsmay not have more than {max} items
min_itemsmust have at least {min} items
not_a_rowis not one of the rows
row_ordermust list every row once
list_sizemust be a list of 1 to {max} items
max_kibmay not be larger than {max} KiB
max_elementsmay not have more than {max} elements
max_imagesmay not have more than {max} images
max_embedsmay not have more than {max} embeds
max_app_nodesmay not have more than {max} application elements
too_many_roleshas too many roles
too_many_permissionshas too many permissions
unknown_roleshas unknown roles
integermust be an integer
integer_stringmust be an integer string
numbermust be a number
number_rangemust be a number from 1 to {max}
positive_integermust be a positive integer
booleanmust be true or false
stringmust be a string
decimal_stringmust be a decimal string
uuidmust be a UUID
datemust be a date (YYYY-MM-DD)
local_datetimemust be a local date-time (YYYY-MM-DDTHH:MM:SS)
timestampmust be an RFC 3339 timestamp
out_of_rangeis out of range
betweenmust be between 1 and {max}
min_valuemust be at least {min} (the min of a number input)
max_valuemay not be greater than {max} (the max of a number input)
emailmust be a valid email address
control_charactersmay not contain control characters
name_formatmust be at most {max} characters, without control characters
text_objectmust be an object of text values
not_optionis not one of the options
unreadable_secretcannot be decrypted; replace or clear it
empty_keymay not have an empty key
key_lengthmay not have keys longer than {max} characters
value_lengthmay not have values longer than {max} characters
token_namemust be 1 to 255 characters
abilitiesmust be at most {max} non-empty names
jwt_abilitiesmust be 1 to {max} non-empty names, {bytes} bytes in all
jwt_too_longtoo long for an access token
idempotency_keymust be 1 to 128 letters, digits, _ or -
idempotency_reusedwas already used for a different request; send a new key for a new change
cannot_filtercannot be filtered
cannot_sortcannot sort by {name}
trashed_valuemust be with or only
trashed_unsupportedis not supported by this resource
malformed_filtermalformed {key}
unknown_operatorunknown operator {op}
search_too_broadmatches too many records to check; refine the search
too_many_matchesToo many matching records to check individually; narrow the search or filters.
one_record_onlyRun this action on one record at a time.
too_many_to_exportMore than {max} records to export; narrow the search or filters.
too_large_to_exportToo large to export at once; export in the background.
invalid_parentinvalid parent key
invalid_keyinvalid key
unsupported_keyunsupported key type
conflictsconflicts with existing data
missing_referencereferences a missing or protected record
incompleteis incomplete (a column the form does not set may not be empty: the application must set it, e.g. in a hook)
rows_not_addablerows cannot be added here (a relationship repeater with addable(false))
rows_not_deletablerows cannot be removed here (deletable(false))
too_many_rowshas more than {max} rows ([admin] repeater_rows): a relationship repeater's change orders more rows of one parent, or sends more entries in one part, than repeater_rows
positions_exhaustedhas no positions left; renumber the rows (the order column reached its type's largest value)
staleThis was changed by someone else meanwhile. Reload and try again.
options_failedcould not check the options; try again (a form error: an input's options_fn failed, timed out or answered options the server refuses before a save; nothing was saved)
last_super_adminAt least one active super admin is required for the {guard} guard.
no_super_admin_roleno super_admin role for guard {guard}
unknown_permissionsunknown permissions: {list}
duplicate_filemay not list the same file twice
file_typesdoes not accept {types} files
multipartmust be sent as multipart/form-data
file_partmust be one part named file, with at most one collection
file_name_lengthhas a name longer than 255 characters
unreadablecould not be read
file_typeis not an accepted file type
incomplete_fileis not a complete file of its type
imageis not a valid image
too_many_pixelshas too many pixels
media_collectionis not a media collection
too_many_mediarefers to too many files at once (one save refers to more than 2,000 distinct files: its fields, rich text and repeater rows together)
documentis not a document
document_invalidis not a valid document
document_versionis not a valid document (version 1 to 4)
document_needs_versionhas a table, which needs document version 2 (also an embed, a callout, an image caption, an image width) / has the mark {node}, which needs document version 3 / has the element {node}, which needs document version 3 / has a formula, which needs document version 4
document_depthis nested too deeply
document_structurehas a list item outside a list / has a list holding something else than list items / has a code block holding something else than plain text / has a heading without a level from 2 to 4 / has unexpected properties on {node} / has an unknown block {node} / has an unknown inline {node} / has an unknown mark {node} / has a mark with attributes / has a text with the same mark twice / has a text with too many marks / has a text without text / has an empty text / has a text both superscript and subscript / has a table holding something else than rows / has a table whose rows have different lengths / has a table cell out of place (header cells make up the first row only) / has a table cell holding something else than paragraphs / has a callout holding something else than paragraphs and lists / has a callout holding a table or a callout / has a callout holding the element {node} / has a callout holding a formula on its own line / has a callout with unexpected attributes / has a callout whose tone is not info or warn
document_formulahas an invalid formula ({reason} at character {at}) (reason: empty, too_long, too_deep, unknown_command, unexpected_character, missing_brace, unexpected_brace, missing_argument or double_script; at counts characters from 1)
document_formula_missinghas a formula without its LaTeX
virtual_field_staleno longer fits this record: edit it (a virtual field's stored value, once a field in its DEPENDS_ON changes or its conditions newly show it, and the field is not sent)
max_formulasmay not have more than {max} formulas
document_elementhas an unknown element {node} / has an element {node} out of place / has an element {node} with an invalid attribute {attr} / has an element {node} without its attribute {attr}
document_linkhas a link that is not http, https or mailto / has a link with unexpected attributes
document_imagehas an image that is not a media item / has an image with unexpected attributes / has an image width other than normal, wide or full
document_althas an image description longer than {max} characters
document_captionhas an image caption longer than {max} characters
document_table_rowshas a table with no rows or more than {max} rows
document_table_columnshas a table row with no cells or more than {max} cells
document_embedhas an embed whose provider is not youtube or vimeo / has an embed with an invalid id / has an embed with unexpected attributes
bad_credentialsThese credentials do not match our records.
wrong_passwordThe password is incorrect.
password_for_emailis required to change your email
invalid_bodyFailed to deserialize the JSON body into the target type: {detail}

Top-level codes ​

codeStatusreason (409)
bad_request400
unauthenticated401
forbidden, csrf_mismatch403
not_found404
method_not_allowed405
invitation_accepted, user_inactive, mail_disabled409accepted, inactive, disabled (invitations)
write_conflict409busy (another change in progress), upload_expired, receipt_expired; queue actions: not_failed, not_waiting, running; a schedule's Run now: running (a run is in progress)
export_not_ready409pending (the background export has not finished)
export_stale409stale (access changed since the export was made: export again)
secret_stale409stale (an encrypted map changed meanwhile: reload before retrying)
import_started409started (the import has already started)
stale409options (what an input's options_fn read changed between its run and the save's lock: reload or save again)
payload_too_large413
validation_failed422
too_many_requests429
internal_error500locally, the debug page adds debug
unavailable503

Every body has message and code; a 409 adds reason, a 422 adds errors, formErrors, issues and formIssues.

  • 409 means nothing was saved: reload, or send the request again (the panel offers to). Match on code and reason, not on the message.
  • 429 carries a Retry-After header: the advised delay, in seconds, before trying again (not always the exact time a limit resets).
  • 500 never includes the error itself: the server logs it, with the request id.
  • 503 unavailable answers a realtime stream or socket request while the server is shutting down. Connect again (to another instance).
  • import_row_written and import_stopped are 409 conflicts used inside the import job; they never reach a client (the import's report and status say what happened).

Responses without a JSON code ​

StatusWhenBody
408the request took longer than http.timeout_secs (default 30)empty
503GET /health when the database does not answer{"status": "degraded", "database": "unavailable"}
400a malformed typed query string, rejected before the handler runs (e.g. GET <admin_path>/api/system/users?page=abc)plain text

A handler that panics answers the standard 500 (internal_error); only a stream that has already started (server-sent events) ends instead.

Mail ​

Codes of rustcms::mail::MailError: answered by POST settings/mail/test ({ok: false, code}) and kept as the last_error of failed mail.send jobs.

CodeRetriedMeaning
mail_disabledno[mail] driver = "disabled"
mail_not_configurednono server or sender saved
mail_policynothe server is outside allowed_hosts / allowed_ports / allow_insecure
mail_settings_unreadablenothe saved password cannot be decrypted (APP_KEY changed)
mail_invalidnoan address or header is invalid
mail_templatenoa template is missing, invalid or failed
smtp_authnothe server refused the credentials
smtp_rejectednothe server refused the message (5xx)
smtp_connectyesno connection
smtp_tlsyesTLS failed: no STARTTLS offered, a certificate not trusted or for another name
smtp_temporaryyesthe server deferred the message (4xx)
smtp_timeoutyestoo slow
smtp_throttledyesthis process could not get a send slot within a minute (max_per_minute is a continuously refilled per-process budget)

RustCMS 0.17.0 · source cfb82fa33fab · MIT OR Apache-2.0