# Error Codes

This page summarizes common HTTP status codes, JSON business error codes, and resolution paths across CloudSigma AI Studio HTTP APIs and OmniFabric database connections. For endpoint-specific responses, check each operation page in [API Reference](https://omnifabric.cloudsigma.com/docs/reference/api/index.html.md); for symptom-based checklists, see [Troubleshooting](https://omnifabric.cloudsigma.com/docs/get-started/troubleshooting.html.md).

## AI Studio HTTP API error envelope

CloudSigma AI Studio HTTP APIs return a standard JSON error envelope (optional fields such as `data`, `request_id`, or `trace_id` follow each operation page):

```json
{
  "code": "ErrParamInvalid",
  "msg": "readable error message",
  "data": null
}
```

### Common HTTP and business error codes

| HTTP status | Common `code` | Meaning and likely cause | Recommended action |
| --- | --- | --- | --- |
| `400` | `ErrParamInvalid` | Missing required parameter, invalid field format, malformed JSON, or unsupported fields | Verify required fields, data formats, and payload limits on the target API page |
| `400` | `ErrMultipleAuthCredentials` | Multiple authentication credentials sent in one request (for example, saved browser cookies sent alongside `X-API-Key`) | Send only `X-API-Key` (and `X-Workspace-ID` when required) with cookies disabled |
| `400` | `ErrWorkspaceRequired` | Missing workspace identifier | Include a valid `X-Workspace-ID` header from the same region |
| `400` | `ErrIAMExplicitRoleInvalid`, `ErrIAMScopeInvalid`, `ErrIAMGrantScopeInvalid`, `ErrIAMResourcePickerInvalid` | Invalid role, authorization scope, or resource picker condition | Fix the IAM parameters and submit again |
| `401` | `Unauthorized`, `ErrUnauthorized`, `ErrUnauthenticated`, `unauthenticated` | Missing, expired, or revoked personal access token, wrong region token, or using `Authorization: Bearer` instead of `X-API-Key` | Pass a valid personal access token from the same region via `X-API-Key`; see [Endpoints & Authentication](https://omnifabric.cloudsigma.com/docs/developer/endpoints-and-authentication.html.md) |
| `403` | `ErrForbidden`, `ErrIAMDenied`, `ErrIAMPolicyDenied`, `ErrIAMDataPrivilegeDenied`, `ErrIAMObjectGrantDenied`, `ErrIAMResourcePickerDenied` | Current identity or active workspace role lacks permission for the operation | Check workspace membership and role/object permissions under [Role permissions](https://omnifabric.cloudsigma.com/docs/guides/ai-studio/permissions/roles.html.md) |
| `404` | `ErrNotFound`, `ErrIAMResourceNotFound` | Target resource ID does not exist, belongs to another region, or is not visible in the specified workspace | Confirm `CLOUDSIGMA_API_BASE`, `X-Workspace-ID`, and the resource ID belong to the same region |
| `409` | `ErrAlreadyExists`, `ErrDuplicateName`, `ErrDuplicateKey`, `ErrConflict`, `ErrIAMConflict`, `ErrIAMPolicyConflict`, `ErrIAMDataPrivilegeConflict`, `ErrIAMObjectGrantConflict`, `ErrIAMResourcePickerConflict` | Duplicate name/key, incompatible lifecycle state, or concurrent update conflict | Re-read the current resource state and version, use a unique name, or resolve dependent bindings before retrying |
| `429` | `ErrDynamicServiceConcurrencyLimit`, `ErrDynamicServiceRateLimit` | Concurrency or request rate limit exceeded for published workflow/operator services | Inspect `Retry-After`, reduce client concurrency, and retry with exponential backoff |
| `500` | `ErrServer` | Internal processing failure; write operations may have been partially applied | Retain timestamp, `request_id`, and `trace_id`, verify the current resource state before retrying, and contact support if persistent |
| `502` / `503` | `ErrServiceUnavailable`, `ErrIAMManagementUnavailable`, `ErrIAMPolicyUnavailable`, `ErrIAMDataPrivilegeUnavailable`, `ErrIAMObjectPermissionUnavailable`, `ErrIAMResourcePickerUnavailable` | Business, runtime, or authorization dependency is temporarily unavailable | Retry with backoff; after recovery, verify existing results instead of blindly repeating writes |

## OmniFabric database connection and SQL errors

When connecting to an OmniFabric database instance via MySQL protocol clients or drivers:

| Error or symptom | Likely cause | Recommended action |
| --- | --- | --- |
| `2003` (`Can't connect to MySQL server`) / timeout | Client public IP is not allowed by Network Policy, host/port is incorrect, or instance is not **Available** | Check instance status, host/port, and IP allowlist in [Connect and query an instance](https://omnifabric.cloudsigma.com/docs/guides/matrixone/connect-and-query.html.md) |
| `SSL connection error` / TLS handshake failure | Client TLS mode does not match instance requirements or CA path is invalid | Match the console TLS parameters (`--ssl-mode=REQUIRED` / `sslMode=REQUIRED`) |
| `1045` (`Access denied for user`) | Wrong password or missing `<username>:<role_name>` role suffix for regular users | Verify credentials and login format in [OmniFabric permissions](https://omnifabric.cloudsigma.com/docs/guides/matrixone/permissions.html.md) |
| `1142` / SQL permission denied | Active role lacks the required `GRANT` privilege on the target database or table | Inspect `SHOW GRANTS;` and consult [SQL privileges](https://omnifabric.cloudsigma.com/docs/reference/sql/privileges.html.md) |
| SQL syntax or compatibility error | Statement uses unsupported syntax or exceeds documented limits | Consult [SQL Reference](https://omnifabric.cloudsigma.com/docs/reference/sql/index.html.md) and [SQL limitations](https://omnifabric.cloudsigma.com/docs/reference/sql/limitations.html.md) |

## Related pages

- Symptom-based troubleshooting checklist and diagnostic info to prepare: [Troubleshooting](https://omnifabric.cloudsigma.com/docs/get-started/troubleshooting.html.md)
- Regional endpoints, headers, and workspace configuration: [Endpoints & Authentication](https://omnifabric.cloudsigma.com/docs/developer/endpoints-and-authentication.html.md)
- First API call walkthrough: [Make your first AI Studio API call](https://omnifabric.cloudsigma.com/docs/developer/quickstart/index.html.md)
