Skip to main content

Error Codes

New disaster-server APIs should use the unified response envelope. Older endpoints or authentication middleware may still return msg; clients should handle both.

Response Envelope

{
"code": 0,
"message": "OK",
"data": {},
"meta": {},
"trace_id": "..."
}

Error response:

{
"code": 1000,
"message": "invalid request",
"data": null,
"meta": {},
"trace_id": "..."
}

Business Codes

codeHTTP StatusMeaningSuggested Handling
0200SuccessRead data and meta
1000400Bad requestCheck body, path params, query params
2001401Unauthorized or invalid tokenLogin again or refresh token
2003403ForbiddenCheck user permissions, Server RBAC, remote cluster permissions
3004404Resource not foundCheck name, namespace, cluster, route
3009409State conflictCheck whether the current state allows the action
4000502Upstream errorCheck Kubernetes API, Velero, object storage, or remote cluster
5000500Internal server errorUse trace_id to search server logs

Authentication Middleware Response

Authentication failures may return:

{
"code": 401,
"msg": "token is invalid"
}

Clients should handle both message and msg.

Troubleshooting

  • 400: request schema or field names.
  • 401: token expiry or missing Bearer prefix.
  • 403: user permissions, ServiceAccount, remote cluster RBAC.
  • 404: resource name and API group/version.
  • 409: instance or operation state machine.
  • 502: Kubernetes API, Velero, object storage, network.
  • 500: use trace_id and server logs.