UnieAI Studio

Error Handling and Reporting

How Studio presents failures at each layer, the error format and status codes its APIs return, what each error code means, and what to hand to a platform administrator.

When something fails, Studio shows you one of two things: the next step you can take, or a reference you can hand over. Raw failure text — database errors, socket errors, upstream provider responses — never reaches the screen. It is written for operators, it rarely suggests an action, and it often carries details that should not be shown.

Three layers of failure

LayerWhen it appearsWhat you seeWho resolves it
PageA whole page cannot load its dataFull-page error card: the reason, a next-step button, and an error code when neededYou, or a platform administrator
ActionA form submit, deployment, delete or resize failsA dialog or inline notice; your input is keptYou
InterfaceYou call /v1 or /api/* directlyJSON: HTTP status, error code, messageYour code

Page layer

Studio sorts page failures into three classes, and only offers Retry where another attempt could land differently:

ClassHow it is recognisedWhat the page saysRetry
ActionableThe code maps to a known next step (expired session, missing permission, balance, quota, no project selected, dead licence, missing connection…)Guidance for that code, plus a button to where the next step livesOnly conflict, rate_limit_exceeded, limit_exceeded
TransientThe code is timeout, request_aborted, service_unavailable, bad_gateway, upstream_error, upstream_timeout or upstream_empty_response, or the message matches a connection failure (ECONNRESET, ECONNREFUSED, ETIMEDOUT, socket hang up, fetch failed, 502/503/504…)The service is temporarily unavailableYes
PlatformAnything else, including driver faults that carry no codeThe platform brokeNo — retrying cannot change the outcome

A platform failure carries an error code: the page's Next.js digest, or the code the failure itself carried. Both are opaque tokens, so either is safe to share. The card labels the field Reference, next to a Copy button, and states "Provide this reference to your platform administrator for investigation." Include it with the time and the page path when you report the problem.

A failure with neither a code nor a digest shows no code field. In that case, report the time, the page path, and what you were doing.

Codes that ask you to do something

CodeWhat the page saysNext step
unauthorized, expired_tokenYour session has expiredSign in again; you return to where you were
forbidden, access_deniedYou do not have access to this pageAsk a platform administrator for the matching permission
not_foundThis item cannot be foundPick it again from the list; it may have been deleted, renamed, or belong to another project
invalid_request, invalid_argument, invalid_json, bad_request, validation_failedThe content did not pass validationAdjust the input and submit again
conflictSomeone else changed this itemReload to get the current state, then continue
precondition_failedA prerequisite is missingComplete the previous step first
rate_limit_exceeded, limit_exceededYou have reached the request limitRetry once the quota recovers
insufficient_balanceYour balance is too lowTop up and continue
wallet_balance_exceeds_limitThis top-up exceeds the balance limitTop up a smaller amount, or use the current balance first
workspace_project_requiredNo project is selectedSwitch to a project, or create one
gpu_capacity_exceeded, gpu_vram_capacity_exceeded, resource_capacity_exceededThe available capacity cannot satisfy this requestLower the specification, or use another machine
onprem_inference_license_missing, onprem_inference_license_not_found, onprem_inference_license_invalidThis app needs an inference licenceThe machine's provider uploads it under Compute Provider › Host › Actions › UnieInfra inference licence
license_expired, license_invalidThe licence cannot be usedA platform administrator updates the licence
data_hub_disabled, connectors_disabledThis feature is not enabledAsk a platform administrator to enable it
payment_not_configured, stripe_not_configured, stripe_webhook_not_configuredPayment is not configuredA platform administrator completes the payment setup
model_disabledThis model is disabledChoose another model
base_model_not_adoptedThis base model is not adopted yetAdopt it in the model catalogue first
no_sql_connectionNo database connection existsCreate an SQL connection first
no_api_keyNo API key existsCreate an API key first

Action layer

  • A failed dialog stays open and keeps what you typed; only success clears it.
  • The wording is chosen by the error code rather than pasted from the backend, so the same cause reads the same way in every language.
  • When a deployment or machine action fails, compare Deployments › Logs with the machine's Activity tab. See Application troubleshooting.

Interface layer (API responses)

Two envelopes

The platform API currently uses two error envelopes, and a caller has to handle both:

{
  "error": {
    "code": "forbidden",
    "message": "You do not have access to this host.",
    "request_id": "req_7f3c1a9e"
  },
  "details": {}
}
{
  "error": "You do not have access to this host.",
  "code": "forbidden"
}
EnvelopeWhere it appearserror typeWhere the code lives
Nested/v1/* (Runtime proxy), /api/sql-db/*, /api/connectors/*, /api/auth/*, /api/wallet/*, /api/studio-agent/*, /api/platform/*, some /api/admin-panel/*objecterror.code
Flat/api/on-prem/*, /api/marketplace/*, /api/internal/*, /api/admin/*, and the newer deployment and compute-provider routesstringtop-level code

Endpoints can use different error envelopes. Check whether error is a string or an object before reading it. For objects read error.message / error.code; for strings read error / the top-level code. Preserve the HTTP status, error code and available request ID when reporting a problem, and avoid converting the whole error object directly to text.

Status codes

StatusMeaningTypical codes
400The request body or parameters are invalidinvalid_request, invalid_domain, invalid_slug, slug_required, confirmation_required
401Not signed in, signature mismatch, or a dead tokenunauthorized, invalid_signature
402The wallet balance is insufficientinsufficient_balance
403Signed in, but without access to this resource or featureforbidden, read_only_mode, ops_disabled, publish_disabled, platform_role_requires_super_admin, not_enabled
404The resource does not exist, or its existence is deliberately withheldnot_found, cluster_not_found, deployment_not_found, no_kubeconfig, session_ended
409Conflicting with current state; reload before retryingconflict, slug_taken, deployment_not_ready, snapshot_target_changed, snapshot_target_ambiguous, workspace_changed, missing_kubeconfig
413The upload is too largepayload_too_large, archive_too_large, empty_archive
422Readable but not processablemodel_discovery_failed
429Rate or quota exhaustedrate_limit_exceeded, limit_exceeded
500Internal platform errorinternal_error
502An upstream response was invalidprovider_invalid_response, provider_models_empty
503A dependency is disabled or unconfigureddns_not_configured, server_misconfigured, agent_error, internal_not_configured

Fields

FieldMeaning
codeStable identifier, lower snake_case. Branch on this field, never on the message text
messageHuman-readable wording that may change; fine for logs, unsafe for control flow
request_idPresent on a few routes; /v1/* also returns an x-request-id header. Most platform routes do not have one yet
detailsOptional; the structure depends on the endpoint

Validation endpoints are the exception

Check endpoints such as /api/on-prem/clusters/validate-kubeconfig return 200 even when the check fails, and report the result in code: unreachable, not_https, tls_unverified, reachable_unauthorized, reachable_unexpected. Read the code, not just the status.

Known behaviour

  • Calling /api/on-prem/* without a session currently returns 500 internal_error instead of 401. When you see 500, confirm the session first.
  • A few endpoints answer 404 for resources that exist but are not accessible, so that their existence is not disclosed. A 404 does not always mean the data is gone.
  • Message language is not yet uniform: the operations (ops) routes answer in Chinese, most others in English.
  • A few endpoints answer 404 for a missing resource while the code is still internal_error — a cluster's overview and monitoring routes, for example, where the sibling nodes, alerts and activity routes answer not_found. Trust the status code there; unifying the codes is still in progress.

Error code reference

These are the codes the platform API uses today, grouped by area. The status code that accompanies a given code is whatever the response says.

Request and validation

CodeMeaning
invalid_requestA parameter is missing, has the wrong type, or is outside the allowed range
invalid_payloadThe request body is malformed (a webhook, for example)
invalid_documentThe configuration document submitted is not valid
confirmation_requiredThe action needs an explicit confirmation (changing the local-path directory, for example)
unknown_actionThe action is not in the allowed set
unknown_targetThe target the request names does not exist
note_requiredThis action must carry a note the other side can read
payload_too_largeThe request body exceeds the limit
archive_too_large, empty_archiveThe uploaded source archive is too large or empty
invalid_archive_key, invalid_archive_typeThe archive reference or type is invalid
invalid_preview_path, preview_not_allowedOnly Dockerfile and YAML files can be previewed
not_git_sourceThis deployment does not come from Git, so it cannot be triggered
upload_failedThe file upload failed
invalid_base_urlThe provider URL is not a valid base URL

Identity and permissions

CodeMeaning
unauthorizedNot signed in, or the session has expired
forbiddenSigned in, but without access to this resource or feature
not_enabledThe platform-level switch is off
read_only_modeRead-only mode is on; nothing can be changed
ops_disabledOps mode is not enabled
platform_role_requires_super_adminThis action is restricted to super administrators
session_endedThat working session has ended
workspace_changedThe workspace changed during the action; reload and retry
invalid_signatureRequest signature verification failed
no_group_api_keyThe current group has no usable API key

Machines, deployments and compute

CodeMeaning
cluster_not_foundNo such machine or cluster
deployment_not_foundNo such deployment
deployment_not_readyThe deployment is not ready for this action yet
missing_kubeconfig, no_kubeconfigThis machine has no usable kubeconfig
kube_unavailableThe Kubernetes API cannot be reached
pod_not_ready, synced_pod_not_readyA pod is not ready, or the vCluster's parent pod is unavailable
pod_sync_mismatchA vCluster pod resolved outside its assigned namespace
webshell_not_configuredWeb Shell is not enabled in this environment
bastion_unavailable, bastion_tunnel_unavailableThe bastion host or its tunnel could not be established
publish_disabledAn administrator has turned template publishing off
snapshot_target_ambiguous, snapshot_target_changedThe snapshot target is ambiguous, or changed while the action ran
model_discovery_failedReading the model list from the deployment failed
model_required, model_not_found, models_endpoint_unavailableNo model was named, the model does not exist, or the endpoint exposes no model list
provider_unreachable, provider_connection_failedThe provider endpoint cannot be reached
provider_invalid_response, provider_models_emptyThe provider answered in an unexpected shape, or with an empty list
no_platform_caThe platform has no CA configured, so it cannot issue certificates
unreachable, not_https, tls_unverified, reachable_unauthorized, reachable_unexpectedkubeconfig check outcomes

Domains, DNS and Git integration

CodeMeaning
dns_not_configuredThe DNS name service is not configured; required fields are missing
invalid_dns_providerThat DNS provider is not supported
missing_dns_provider_fieldsThe provider is missing required configuration fields
invalid_domainThe domain name is not valid
invalid_slug, slug_required, slug_takenThe slug is malformed, missing, or already used
github_app_not_configuredThe GitHub App is not installed or configured
CodeMeaning
search_unavailableThe search service is unavailable
memory_sync_failedMemory content failed to sync

Rentals and platform operations

CodeMeaning
requester_<reason>A rental request was refused automatically; the prefix carries the reason, for example requester_insufficient_balance
internal_errorAn unexpected platform error
internal_not_configured, server_misconfiguredThe platform environment or configuration is incomplete
ops_agent_token_not_configuredThe ops agent token is not set
agent_errorThe ops agent reported a failure
recording_missing, recording_purgedThe session recording does not exist, or has expired and been purged
invalid_stt, task_model_requiredThe speech-to-text or task model configuration is invalid
vlm_required, vlm_image_unsupported, vlm_tool_calls_unsupported, vlm_tool_call_format_invalidA vision model is required, or its capabilities do not match

What to try, in order

  1. Read the page wording and the code. Decide whether you have a next step or the platform does. If you have one, take it — do not retry.
  2. For an action failure, open the browser dev tools › Network, find the request, and read the status and the code in the response body.
  3. If you suspect an expired session, open any list page in another tab. Being sent back to the sign-in page confirms it.
  4. Check the platform: open /api/health. Administrators can also look for a matching event under Operations › Activity.
  5. When reporting, include the error code (or the digest the page showed), the time with its time zone, the path, what you were doing, and the response body from the Network panel.

Rules for developers

Adding an error? Follow these so the page, the logs and the report line up:

  1. Always carry a code, lower snake_case (^[a-z][a-z0-9_]{2,63}$). Driver-level values — a Postgres SQLSTATE such as 42703, for example — are not platform codes and must not be used as one.
  2. Keep the message separate. message is for humans and may be reworded; behaviour is chosen by code.
  3. The front end picks its rendering from the code and never pastes backend text. A code in the known list gets its own guidance and next step; everything else is treated as a platform fault.
  4. Mark a failure transient only when it genuinely clears on its own (timeout, request_aborted, service_unavailable, bad_gateway, upstream_error, upstream_timeout, upstream_empty_response). A permanent fault marked transient sends the reader to retry something that cannot succeed.
  5. When a resource's existence must not be disclosed, answer 404 rather than 403.
  6. When you add a code, update this page and the page-level mapping in the same change.