Skip to main content

troubleshoot-error-codes

When to use​

Look up a Studio error or warning by its code and route to the specialist that fixes it. Use when the user's text has an UPPER_SNAKE code such as HOST_UNUSABLE or BINDING_PATH_MISSING, a [Contentstack Studio] CODE: log line, or a Studio API error_code number. Phrases: "error code", "what does … mean", "Studio threw …", "error_code 32". For messages with no code, use troubleshoot-error-messages. For a symptom with no code or message, use troubleshoot.

Studio error codes: class, status, first fix, specialist

Read the row for the code, apply the first fix if it's clear, then Read the specialist named in the row for the full diagnosis. Each code has a full entry, with every cause and fix, at https://studio-documentation.contentstackapps.com/reference/error-message-index#<CODE>.

SDK error codes​

The SDK throws these. The error carries error.code and error.errorClass. Answer NOT_FOUND with a 404 and every other class with a 5xx. Decide with isCompositionNotFound(error) from @contentstack/studio-react, never with a list of names.

CodeClassSite answersWhat it meansFirst fixSpecialist
API_KEY_MISSINGSETUP_INCOMPLETE5xxYour site isn't giving Studio an API keySet the API key.install-studio, then verify-setup
COMPONENT_NOT_REGISTEREDSETUP_INCOMPLETE5xxA component isn't registeredBuilt-ins missing: import @contentstack/studio-react once, before the fetch. Your own: register before you fetch, or register the missing component.register-component
COMPOSITION_IDENTIFIER_MISSINGSETUP_INCOMPLETE5xxYour site didn't say which template it wantedName the template in the call.setup-template-preview-routes
DELIVERY_TOKEN_MISSINGSETUP_INCOMPLETE5xxYour site isn't giving Studio a delivery tokenSet the delivery token.install-studio, then verify-setup
ENVIRONMENT_MISSINGSETUP_INCOMPLETE5xxYour site isn't telling Studio which environment to readSet the environment.install-studio, then verify-setup
INIT_NOT_COMPLETESETUP_INCOMPLETE5xxYour site asked for a template before Studio was readyCall studioSdk.init(...) on this code path.install-studio, then verify-setup
STACK_SDK_MISSINGSETUP_INCOMPLETE5xxYour site isn't giving Studio a Contentstack stackPass a stack to Studio.install-studio, then verify-setup
CONTENT_TYPE_NOT_FOUNDSETUP_INVALID5xxStudio's content types are missingSet contentTypeUid to Studio's content type UID (or fix its spelling), or install Studio's content types on that stack.configure-studio, or provision-studio-project to install the content type
ENVIRONMENT_NOT_FOUNDSETUP_INVALID5xxContentstack can't find that environmentCheck the name.install-studio / configure-studio
HOST_UNUSABLESETUP_INVALID5xxYour site points at a Contentstack address it can't useCheck it's a valid address.install-studio / configure-studio
LOCALE_NOT_CONFIGUREDSETUP_INVALID5xxThis language isn't set upCheck the code matches exactly.install-studio / configure-studio
STACK_NOT_FOUND_ON_HOSTSETUP_INVALID5xxThe API key doesn't lead to a stackCheck the API key.install-studio / configure-studio
TRANSPORT_FAILEDNETWORK_ERROR5xxYour site couldn't reach ContentstackTry again.troubleshoot-composition-resolution
RESPONSE_UNUSABLESERVER_ERROR5xxSomething other than Contentstack answeredCheck what sits in between.troubleshoot-composition-resolution
SEARCH_INCOMPLETESERVER_ERROR5xxStudio stopped searching before it finishedContact Contentstack support.troubleshoot-composition-resolution
SPEC_UNREADABLESERVER_ERROR5xxA stored layout won't openContact Contentstack support.troubleshoot-composition-resolution
UPSTREAM_ERRORSERVER_ERROR5xxContentstack couldn't answerTry again in a few minutes.troubleshoot-composition-resolution
URL_OWNERSHIP_PROBE_FAILEDSERVER_ERROR5xxStudio couldn't tell which template owns this addressTry again shortly.troubleshoot-composition-resolution
COMPOSITION_UID_NOT_FOUNDNOT_FOUND404That template isn't hereCheck the UID.troubleshoot-composition-resolution
CONNECTED_ENTRY_NOT_FOUNDNOT_FOUND404This template has no content to showCheck there's an entry.troubleshoot-composition-resolution
NO_COMPOSITION_FOR_TEMPLATE_CONTENT_TYPENOT_FOUND404No template uses this content typeConnect a template.troubleshoot-composition-resolution
NO_COMPOSITION_FOR_URLNOT_FOUND404Nothing is set up for this addressCheck the address.troubleshoot-composition-resolution
NO_PRIMARY_TEMPLATE_FOR_SECONDARYNOT_FOUND404Secondary templates here, but no primary oneDeploy a secondary one from Studio: it becomes primary.troubleshoot-composition-resolution
REQUESTED_COMPOSITION_UNAVAILABLENOT_FOUND404A cs-template link this address can't showCheck the UID, and that it's deployed here as secondary.troubleshoot-composition-resolution
URL_LOCALE_NOT_FOUNDNOT_FOUND404The language in this address isn't set upCheck the address.troubleshoot-composition-resolution
URL_MATCHED_NO_ENTRYNOT_FOUND404This address has no content behind itCheck there's an entry at this address.troubleshoot-composition-resolution

Warnings (logged, not thrown)​

The page renders, but something on it is blank. The SDK logs these in development, and in production only with debug: true in studioSdk.init. Never answer them with a 404 or 5xx.

CodeWhat it meansSpecialist
BINDING_PATH_MISSINGThe field was renamed or removed on the content type, or it's empty on this entry.troubleshoot-data-binding
BINDING_SHAPE_MISMATCHThe binding points at a group or modular block. Point it at a field inside it.troubleshoot-data-binding
REFERENCES_UNRESOLVEDThe references nest deeper than one request follows, or a referenced entry was deleted.resolve-reference-depth
FEWER_ENTRIES_THAN_REQUESTEDThe missing entries aren't published to this environment, or they were deleted.troubleshoot-data-binding
QUERY_RETURNED_NO_ROWSA pinned query ran and its filter matched nothing.pin-query
QUERY_REQUEST_FAILEDA pinned query's request didn't complete. Its filter isn't the problem. Retry the page.pin-query
DATA_SOURCES_UNREADABLEThe composition's saved data sources are damaged. Report it to Contentstack.troubleshoot-data-binding
PREVIEW_ASSET_PROJECTION_NULLA known Preview API defect. Check the published site before you change the binding.troubleshoot-data-binding

Studio API error_codes​

The Studio API returns error_message and error_code. Branch on error_code, never on the message text. A 400 (bad body or query) and a 408 (call ran longer than 60 seconds) carry no error_code.

Statuserror_codeerror_messageWhat's wrongSpecialist
40139Missing Contentstack credentials — the request must include an authtoken or an OAuth access token (authorization: Bearer <token>) to create or read compositionsA composition call reached the API with neither an authtoken nor an authorization: Bearer token. The API checks this after it finds the project and checks your stack access, so another error can come first.authenticate-cma
40148Missing Contentstack credentials — the request must include an authtoken or an OAuth access token (authorization: Bearer <token>) to list registered componentsThe same, on the registered components route.authenticate-cma
4041Project not foundNo project with that UID in this organization, or you can't read it. errors is { "uid": ["is not valid."] }. Composition and registered component routes return this too when the project in the path doesn't exist.use-compositions-api / author-composition-via-api
40430Composition not foundNo composition with that UID in the project's stack. errors is { "uid": ["is not valid."] }.use-compositions-api / author-composition-via-api
40933A composition with this composable_uid already existsAnother composition in the content type already has this composable_uid, in any language. errors is { "composable_uid": ["is not unique."] }.use-compositions-api / author-composition-via-api
40947A composition with this … already existsAnother composition already has a value that must be unique, such as the same title. errors names the field.use-compositions-api / author-composition-via-api
40941This composition is referenced by other compositions and cannot be deletedYou deleted a composition that another composition uses. errors.references lists them. See "Why deleting a composition fails with 409" on the API errors page.use-compositions-api / author-composition-via-api
42221Stack not foundYour token has no access to the project's connected stack: read access for a GET, write access for anything else. The API gets only a yes or no from the access check, so it can't tell a stack you can't access from one that doesn't exist. Reading a project you can't access answers 404 with code 1 instead.authenticate-cma
42232The composition is invalidThe layout breaks a rule. errors lists every problem at once. See "Layout rules the API checks on every write" on the same page. The API also returns it when you send a blank composable_uid.use-compositions-api / author-composition-via-api
42240composable_uid is immutable and cannot be changed on updateA PUT sent a composable_uid different from the stored one.use-compositions-api / author-composition-via-api
42237Failed to decompress the composition UI specYou asked for decompression=true, but the stored ui can't be read. errors is { "ui": ["is not valid."] }.use-compositions-api / author-composition-via-api
4222 (create), 3 (change), 4 (delete)An Error occurred while creating the project, and the same for updating or deletingThe API couldn't save the project. When a value must be unique, such as a second live project with the same stack and content type, errors names the field with is not unique.use-compositions-api / author-composition-via-api
42270This template can't be published yet. …Another template is primary at the URL. Send resolutions, not fixes: docs/20-tools/20-studio-api/20-deploy-read-change-and-delete.md#when-another-template-is-primary-at-the-urluse-compositions-api
42271This template can't be deployed as a secondary template: …The “URL serving mode” field couldn't be added. Nothing changed.provision-studio-project
50036Failed to compress the composition UI specThe API couldn't compress ui and read it back unchanged, so it saved nothing.use-compositions-api / author-composition-via-api
The status Contentstack returned, or 50238Contentstack rejected the composition: …Contentstack refused a composition read or write. A 401, 403, 409, 422 or 429 from Contentstack keeps its status. A server error or no answer becomes 502.use-compositions-api / author-composition-via-api
The status the component service returned, or 50246The component service rejected the request: …The registered components service refused the call. A 403 or other client error keeps its status.use-compositions-api / author-composition-via-api
50246The component service could not be reached (…).The registered components service didn't answer, or answered with something other than a list.use-compositions-api / author-composition-via-api

For 32, the errors object lists every layout rule the write broke. The rules and their messages are on the API errors and validation page, under "Layout rules the API checks on every write".

Acceptance​

  • The code was matched to exactly one row, and the answer names its class and whether the site should return a 404 or a 5xx.
  • The specialist named in the row was Read before any deeper diagnosis.
  • A code not in these tables is reported as unknown, with the full log line, and the user is pointed to the error message index. No cause is invented.

See also​

Report a problem with this page