Error codes and messages reference
When a request fails, Morphic returns an HTTP status and an error body. This page lists each error code and its meaning. It also lists the messages you see in the API and admin.
Error body
Every API error has this shape:
{ "error": { "code": "conflict", "message": "…", "retry": true } }
code: one of the codes in the table below.message: the text shown to you. Messages use the WordPress language when a translation exists. Otherwise they are in English.field: the field that failed. Present only forinvaliderrors that name a field.reason: the rule that failed, such asmaxorrequired. Present only withfield.retry:truewhen trying again can succeed. It istrueforconflict,closed,unavailable,quota,index_buildingandbackpressure.
Error codes
| Code | HTTP status | Retry | Meaning | What to do |
|---|---|---|---|---|
not_found | 404 | No | The type, entry, key or other item does not exist, or it is in the bin. | Check the id. Restore the entry from the bin if you expected it there. |
conflict | 409 | Yes | The entry changed since you read it, or the same request key is in use at the same time. | Read the entry again, then send the update with the new rev. |
invalid | 422 | No | A value, filter or parameter failed validation. field and reason say which. | Fix the value named by field. |
forbidden | 403 | No | Your role or key may not do this. | Check the model's Access settings. If you use an API key, use a key that allows the action. |
quota | 429 | Yes | Too many attempts. | Wait a few minutes, then try again. |
index_building | 503 | Yes | An index that the query needs is still being built, or is not ready. | Retry in a moment. |
unavailable | 503 | Yes | The database or the server could not finish the request. | Retry. Check the server error log if it repeats. |
closed | 503 | Yes | Defined as a retryable code. Morphic does not raise it in version 2.7.9. | Retry. |
backpressure | 503 | Yes | Defined as a retryable code. Morphic does not raise it in version 2.7.9. | Retry. |
pro_required | 500 | No | A model's kind needs Morphic Pro. | Use Morphic Pro for this model. |
Any other code maps to status 500. Morphic does not raise another code.
Messages by cause
Placeholders such as %s stand for the value Morphic fills in. The messages below are the English source text.
Item not found (not_found, 404)
| Cause | Message |
|---|---|
| Type name is unknown or retired | type %s not found |
| Entry id is malformed, unknown, or in the bin when the entry is read without the bin | node %s not found |
| Entry in the bin cannot be found for restore | deleted node %s not found |
| Lookup by a unique field finds nothing | %1$s with that %2$s not found |
| Relation edge to delete does not exist | edge %s not found (source/relation/target) |
| API key does not exist | key %s not found |
Permission (forbidden, 403)
| Cause | Message |
|---|---|
| Your role may not perform the action on the type | you may not %1$s %2$s (action, type) |
| An API key does not allow the action on the type, also for an administrator | you may not %1$s %2$s (action, type) |
| Your role may not read the type | you may not read %s |
| Your role may not read or update a single-item type | you may not read %s, you may not update %s |
| Your role may not see deleted items of the type | you may not see deleted %s |
| Your role may not see the fields attached to the item | you may not see the fields attached to this item |
| A key route or settings route needs an administrator | administrators only |
Validation (invalid, 422)
Each message comes with field and reason.
| Cause | Reason | Message |
|---|---|---|
| A required field is empty | required | %s: required (the field key, for example title: required) |
| Value is longer than the byte limit | max | value is too long (verify request) |
| A stored data block is over the type's size limit | too_large | data is %1$d bytes; the limit is %2$d |
| A text field is shorter or longer than its limit | min, max | %1$s is shorter than %2$s, %1$s is longer than %2$s |
| A text field does not match its pattern | pattern | %1$s does not match %2$s |
| A URL field is not a web address | url | %s is a web address starting with http:// or https:// |
| A color field has the wrong form | color | %s is a color like #5b5bf6 |
| A number is wrong, or outside its range | type, min, max | %s is a number, %1$s is below %2$s, %1$s is above %2$s |
| A whole number is required | integer | %s is a whole number |
| A true or false value is required | type | %s is true or false |
| A time value has the wrong form | type | %s is a time in Unix milliseconds or ISO 8601, %s is a time in Unix milliseconds |
| A value is not one of the allowed values | enum | %1$s is one of %2$s |
| A link points to an entry that does not exist | not_found | %s links to something that does not exist |
| A link has more than 500 items | max | %s links to more than 500 items |
| A list has too few or too many items | min, max | %1$s has fewer than %2$s items, %1$s has more than %2$s items |
| A nested object goes too deep | depth | %s nests too deep |
| A media field does not point to a media library attachment | not_found | %s is not a media library attachment |
| A media field is not a valid attachment id | type | %s is a media library attachment id |
| A media field is too large | max | %1$s is larger than %2$s bytes |
| A component item names an unknown component | component | each item names one of %s in __component |
| A field holds a secret that is not hashed | not_hash | %s is not a hashed secret |
| A translation key is not a site language | language | %s is not one of the site languages |
| A field is not translatable | translatable | %s is not translatable |
| A unique value is already used | unique | another %1$s already has this %2$s |
| Two entries share a unique value | unique | %1$s and %2$s share a value of %3$s |
| A sealed field is used without Morphic Pro | pro_required | %s is a sealed field; sealing needs Morphic Pro |
| A type is in use by another type | in_use | %1$s is referenced by %2$s |
| The model has no parent types | not_allowed | %s has no parent types |
| The parent id is unknown or in the bin | not_found | parent %s does not exist |
| The parent is of a type the model does not allow | type | a %1$s cannot be under a %2$s |
An entry of a type with partition parent gets a different parent | immutable | a %s stays under its partition root; set partition self to move it |
| An entry is set as its own parent | cycle | a node cannot be its own parent |
| An entry is restored while its parent is in the bin | deleted | restore the parent %s first |
| A type has no index for the query | no_access_path | %1$s has no index %2$s, no index of %s answers this query; add a filter for these fields |
| A search has no full-text index | no_access_path | %1$s has no fulltext index on %2$s, %s has no fulltext index |
| A query limit is outside the range | range | limit is 1 to 500 |
| A cursor is not one the server issued | format | cursor is not one this server issued |
| A search has no search text | required | search needs q |
| An update does not send the revision it read | required | an update sends the rev it read, a delete sends the rev it read |
| A request key is longer than 128 characters | max | request keys are 1 to 128 characters |
| A history setting is below zero | range | history days is zero (keep forever) or more |
| A field is not a list, object or component list | type | %s is a list, %s is an object, %s is a list of components |
| A field uses an unknown kind | kind | unknown kind %s |
| A relation name or target is wrong | unknown_relation, cardinality, type | %1$s has no relation %2$s, %s links to one node, %s is not a node id of a known type, %1$s links to %2$s, not %3$s |
| A delete or purge targets a live entry | live | delete a node before purging it |
Conflict (conflict, 409)
| Cause | Message |
|---|---|
| The entry changed since you read it | %1$s is at rev %2$s, not %3$s |
| The entry is at a different revision than the one the request names | %1$s is at rev %2$s |
| The same request key is being used by another request | request key %s was used concurrently |
| A model changed after you opened it | the model changed since you opened it; reload and apply your changes again |
Index or view not ready (index_building, 503)
| Cause | Message |
|---|---|
| An index or view is not ready | %1$s %2$s.%3$s is %4$s (index kind, type, index name, state) |
Database and server (unavailable, 503)
| Cause | Message |
|---|---|
| A database read or write fails | the database could not complete the request; see the server error log |
| A request fails with an unexpected error | the request could not be completed; see the server error log |
The server writes Morphic database error: … or Morphic: … to the server error log. You do not see these texts in the API.
Throttle (quota, 429)
| Cause | Message |
|---|---|
| More than 10 verify requests from the same user or address in 5 minutes | too many attempts; try again in a few minutes |
Morphic Pro required (pro_required, 500)
| Cause | Message |
|---|---|
| A model's kind needs Morphic Pro | %1$s is a %2$s model; it needs Morphic Pro (type, kind) |
Admin screens
| Screen | Text |
|---|---|
| Entry or model not found | Title Not found, with the error message and a Go home button |
| Any other error | Title Something went wrong, with the error message and a Go home button |
| Index or view not ready in a list | Title Getting this ready |
| Other list errors | Title Could not load entries |
| Morphic cannot load | Title Morphic could not load, with the error message |
| Guide does not exist | That guide does not exist |
| Settings, models or imports for a non-administrator | Only administrators can change settings., Only administrators can change models., Only administrators can import content. |
| Fields attached to an entry do not save, in the WordPress edit screen | Morphic fields were not saved: %s |