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
| Layer | When it appears | What you see | Who resolves it |
|---|---|---|---|
| Page | A whole page cannot load its data | Full-page error card: the reason, a next-step button, and an error code when needed | You, or a platform administrator |
| Action | A form submit, deployment, delete or resize fails | A dialog or inline notice; your input is kept | You |
| Interface | You call /v1 or /api/* directly | JSON: HTTP status, error code, message | Your code |
Page layer
Studio sorts page failures into three classes, and only offers Retry where another attempt could land differently:
| Class | How it is recognised | What the page says | Retry |
|---|---|---|---|
| Actionable | The 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 lives | Only conflict, rate_limit_exceeded, limit_exceeded |
| Transient | The 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 unavailable | Yes |
| Platform | Anything else, including driver faults that carry no code | The platform broke | No — 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
| Code | What the page says | Next step |
|---|---|---|
unauthorized, expired_token | Your session has expired | Sign in again; you return to where you were |
forbidden, access_denied | You do not have access to this page | Ask a platform administrator for the matching permission |
not_found | This item cannot be found | Pick 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_failed | The content did not pass validation | Adjust the input and submit again |
conflict | Someone else changed this item | Reload to get the current state, then continue |
precondition_failed | A prerequisite is missing | Complete the previous step first |
rate_limit_exceeded, limit_exceeded | You have reached the request limit | Retry once the quota recovers |
insufficient_balance | Your balance is too low | Top up and continue |
wallet_balance_exceeds_limit | This top-up exceeds the balance limit | Top up a smaller amount, or use the current balance first |
workspace_project_required | No project is selected | Switch to a project, or create one |
gpu_capacity_exceeded, gpu_vram_capacity_exceeded, resource_capacity_exceeded | The available capacity cannot satisfy this request | Lower the specification, or use another machine |
onprem_inference_license_missing, onprem_inference_license_not_found, onprem_inference_license_invalid | This app needs an inference licence | The machine's provider uploads it under Compute Provider › Host › Actions › UnieInfra inference licence |
license_expired, license_invalid | The licence cannot be used | A platform administrator updates the licence |
data_hub_disabled, connectors_disabled | This feature is not enabled | Ask a platform administrator to enable it |
payment_not_configured, stripe_not_configured, stripe_webhook_not_configured | Payment is not configured | A platform administrator completes the payment setup |
model_disabled | This model is disabled | Choose another model |
base_model_not_adopted | This base model is not adopted yet | Adopt it in the model catalogue first |
no_sql_connection | No database connection exists | Create an SQL connection first |
no_api_key | No API key exists | Create 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"
}| Envelope | Where it appears | error type | Where 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/* | object | error.code |
| Flat | /api/on-prem/*, /api/marketplace/*, /api/internal/*, /api/admin/*, and the newer deployment and compute-provider routes | string | top-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
| Status | Meaning | Typical codes |
|---|---|---|
400 | The request body or parameters are invalid | invalid_request, invalid_domain, invalid_slug, slug_required, confirmation_required |
401 | Not signed in, signature mismatch, or a dead token | unauthorized, invalid_signature |
402 | The wallet balance is insufficient | insufficient_balance |
403 | Signed in, but without access to this resource or feature | forbidden, read_only_mode, ops_disabled, publish_disabled, platform_role_requires_super_admin, not_enabled |
404 | The resource does not exist, or its existence is deliberately withheld | not_found, cluster_not_found, deployment_not_found, no_kubeconfig, session_ended |
409 | Conflicting with current state; reload before retrying | conflict, slug_taken, deployment_not_ready, snapshot_target_changed, snapshot_target_ambiguous, workspace_changed, missing_kubeconfig |
413 | The upload is too large | payload_too_large, archive_too_large, empty_archive |
422 | Readable but not processable | model_discovery_failed |
429 | Rate or quota exhausted | rate_limit_exceeded, limit_exceeded |
500 | Internal platform error | internal_error |
502 | An upstream response was invalid | provider_invalid_response, provider_models_empty |
503 | A dependency is disabled or unconfigured | dns_not_configured, server_misconfigured, agent_error, internal_not_configured |
Fields
| Field | Meaning |
|---|---|
code | Stable identifier, lower snake_case. Branch on this field, never on the message text |
message | Human-readable wording that may change; fine for logs, unsafe for control flow |
request_id | Present on a few routes; /v1/* also returns an x-request-id header. Most platform routes do not have one yet |
details | Optional; 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 returns500internal_errorinstead of401. When you see500, confirm the session first. - A few endpoints answer
404for resources that exist but are not accessible, so that their existence is not disclosed. A404does 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
404for a missing resource while thecodeis stillinternal_error— a cluster's overview and monitoring routes, for example, where the sibling nodes, alerts and activity routes answernot_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
| Code | Meaning |
|---|---|
invalid_request | A parameter is missing, has the wrong type, or is outside the allowed range |
invalid_payload | The request body is malformed (a webhook, for example) |
invalid_document | The configuration document submitted is not valid |
confirmation_required | The action needs an explicit confirmation (changing the local-path directory, for example) |
unknown_action | The action is not in the allowed set |
unknown_target | The target the request names does not exist |
note_required | This action must carry a note the other side can read |
payload_too_large | The request body exceeds the limit |
archive_too_large, empty_archive | The uploaded source archive is too large or empty |
invalid_archive_key, invalid_archive_type | The archive reference or type is invalid |
invalid_preview_path, preview_not_allowed | Only Dockerfile and YAML files can be previewed |
not_git_source | This deployment does not come from Git, so it cannot be triggered |
upload_failed | The file upload failed |
invalid_base_url | The provider URL is not a valid base URL |
Identity and permissions
| Code | Meaning |
|---|---|
unauthorized | Not signed in, or the session has expired |
forbidden | Signed in, but without access to this resource or feature |
not_enabled | The platform-level switch is off |
read_only_mode | Read-only mode is on; nothing can be changed |
ops_disabled | Ops mode is not enabled |
platform_role_requires_super_admin | This action is restricted to super administrators |
session_ended | That working session has ended |
workspace_changed | The workspace changed during the action; reload and retry |
invalid_signature | Request signature verification failed |
no_group_api_key | The current group has no usable API key |
Machines, deployments and compute
| Code | Meaning |
|---|---|
cluster_not_found | No such machine or cluster |
deployment_not_found | No such deployment |
deployment_not_ready | The deployment is not ready for this action yet |
missing_kubeconfig, no_kubeconfig | This machine has no usable kubeconfig |
kube_unavailable | The Kubernetes API cannot be reached |
pod_not_ready, synced_pod_not_ready | A pod is not ready, or the vCluster's parent pod is unavailable |
pod_sync_mismatch | A vCluster pod resolved outside its assigned namespace |
webshell_not_configured | Web Shell is not enabled in this environment |
bastion_unavailable, bastion_tunnel_unavailable | The bastion host or its tunnel could not be established |
publish_disabled | An administrator has turned template publishing off |
snapshot_target_ambiguous, snapshot_target_changed | The snapshot target is ambiguous, or changed while the action ran |
model_discovery_failed | Reading the model list from the deployment failed |
model_required, model_not_found, models_endpoint_unavailable | No model was named, the model does not exist, or the endpoint exposes no model list |
provider_unreachable, provider_connection_failed | The provider endpoint cannot be reached |
provider_invalid_response, provider_models_empty | The provider answered in an unexpected shape, or with an empty list |
no_platform_ca | The platform has no CA configured, so it cannot issue certificates |
unreachable, not_https, tls_unverified, reachable_unauthorized, reachable_unexpected | kubeconfig check outcomes |
Domains, DNS and Git integration
| Code | Meaning |
|---|---|
dns_not_configured | The DNS name service is not configured; required fields are missing |
invalid_dns_provider | That DNS provider is not supported |
missing_dns_provider_fields | The provider is missing required configuration fields |
invalid_domain | The domain name is not valid |
invalid_slug, slug_required, slug_taken | The slug is malformed, missing, or already used |
github_app_not_configured | The GitHub App is not installed or configured |
Knowledge base, memory and search
| Code | Meaning |
|---|---|
search_unavailable | The search service is unavailable |
memory_sync_failed | Memory content failed to sync |
Rentals and platform operations
| Code | Meaning |
|---|---|
requester_<reason> | A rental request was refused automatically; the prefix carries the reason, for example requester_insufficient_balance |
internal_error | An unexpected platform error |
internal_not_configured, server_misconfigured | The platform environment or configuration is incomplete |
ops_agent_token_not_configured | The ops agent token is not set |
agent_error | The ops agent reported a failure |
recording_missing, recording_purged | The session recording does not exist, or has expired and been purged |
invalid_stt, task_model_required | The speech-to-text or task model configuration is invalid |
vlm_required, vlm_image_unsupported, vlm_tool_calls_unsupported, vlm_tool_call_format_invalid | A vision model is required, or its capabilities do not match |
What to try, in order
- 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.
- For an action failure, open the browser dev tools › Network, find the request, and read the status and the
codein the response body. - If you suspect an expired session, open any list page in another tab. Being sent back to the sign-in page confirms it.
- Check the platform: open
/api/health. Administrators can also look for a matching event under Operations › Activity. - 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:
- Always carry a
code, lower snake_case (^[a-z][a-z0-9_]{2,63}$). Driver-level values — a Postgres SQLSTATE such as42703, for example — are not platform codes and must not be used as one. - Keep the message separate.
messageis for humans and may be reworded; behaviour is chosen bycode. - 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.
- 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. - When a resource's existence must not be disclosed, answer
404rather than403. - When you add a code, update this page and the page-level mapping in the same change.
Related
API Compatibility
Use the OpenAI, Responses, and Anthropic-compatible Runtime endpoints and understand UnieAI extensions, streaming metadata, and upstream differences.
Agents API (sessions)
Call an agent through server-kept sessions — create, continue, stream live and read the record. Same interface as OpenAI's Agents API, served by every execution mode (UnieAI Harness, Harness Lite, plain model).