समस्या निवारण
Start from the message or the code in the response. Each entry says what it means and what to do.
Read an error#
Every error from the API has the same shape. Program on code, which is stable; message is for a human and follows the Accept-Language header (English by default).
{
"error": {
"code": "EMAIL_NOT_CONFIRMED",
"type": "auth_email_not_confirmed",
"message": "Confirm your email address before signing in. …",
"request_id": "cc36bc27-5b73-4e92-b7d5-413f59baf263"
}
}Keep the request_id when you ask for help: it finds the request in the logs. The SDK returns the same object as error ({ data, error }), with error.code and error.status; it does not throw. Always read error before using data.
Common situations#
Sign-up works, sign-in answers EMAIL_NOT_CONFIRMED#
A new project requires users to confirm their email. On the local stack the message goes to Mailpit: kubectl -n aurabase-dev port-forward svc/aurabase-mailpit 8025:8025, then open http://localhost:8025. To skip the step while you develop: aura auth settings set email_confirmation_required=false. See the quick start.
401 SECRET_KEY_IN_BROWSER#
A service_role key (aura_sk_…) reached a browser. Use the anon key (NEXT_PUBLIC_AURABASE_ANON_KEY) in client code and keep AURABASE_SERVICE_ROLE_KEY on the server.
403 « new row violates row-level security policy »#
Row-level security is on and no policy allows the operation for the caller's role (aura_anon for a visitor, aura_authenticated for a signed-in user). Check that the user is signed in (a sign-in that failed silently sends the request as a visitor), then add a policy. See row-level security.
An empty result where you expect rows#
Without a policy that lets the caller read, a select returns [], not an error. Test the policy as the user with aura db raw "select …" --as authenticated --user <user id>.
TABLE_NOT_FOUND#
The table does not exist in this project, or the schema cache has not reloaded after a change. Create it with aura db raw "create table …" or in the SQL editor, then retry.
Realtime receives nothing#
Check, in this order: realtime is enabled on the table (aura db table realtime <table> on); the channel reached SUBSCRIBED (a CHANNEL_ERROR carries the reason); the signed-in user can read the rows (events follow row-level security). A postgres_changes capacity reached error means the organization's database has too few free connections: stop idle projects or upgrade the plan.
A CORS error in the browser#
The data plane answers with access-control-allow-origin: *, so a CORS message in the console usually hides a 4xx or 5xx response. Open the network tab, read the status and the code, and fix that. For functions, see responses and CORS.
RATE_LIMITED « Try again in N seconds »#
Too many sign-in attempts for the project: the error carries retry_after in seconds. The per-hour limits are project settings (aura auth settings get: rate_limit_login_per_hour, rate_limit_signup_per_hour).
A function answers 401 or 404#
404 FUNCTION_NOT_FOUND: the function is not deployed under that name (aura functions list). A function call with the public key is the only call a public key can make: see who can call what.
AI calls answer 400 « provider … not configured »#
The project has no key for the provider. Save one with the route named in the message (POST /v1/ai/{project_id}/providers/<provider>), or set the provider key in the service environment.
Error codes#
These codes are stable. A code not listed here keeps its own text, and its code is still stable.
| Code | HTTP | Meaning and what to do |
|---|---|---|
INVALID_TOKEN | 401 | The access token is unreadable: it is not a valid JWT. Send Authorization: Bearer <access_token> obtained by signing in to your project. |
PROJECT_NOT_FOUND | 404 | No active project at <host>: the project was deleted or the address is wrong. Check NEXT_PUBLIC_AURABASE_URL in Studio › Settings › Connection. |
PROJECT_URL_REQUIRED | 400 | This URL does not point to a project: call your project's URL (<form>), shown in Studio › Settings › Connection and expected in NEXT_PUBLIC_AURABASE_URL. |
SECRET_KEY_IN_BROWSER | 401 | A secret key (service_role) was used from a browser: it bypasses RLS and must never be sent client-side. Use the anon (public) key in the browser and keep the service_role key on the server. |
API_KEY_INVALID | 401 | The API key is invalid, expired or revoked. Send your project's key in the apikey header (Studio › Settings › Connection). |
AUTHORIZATION_MISSING | 401 | The Authorization header is missing. Send Authorization: Bearer <access_token>. |
AUTHORIZATION_BEARER_REQUIRED | 401 | The Authorization header must use the Bearer scheme: Authorization: Bearer <access_token>. |
TOKEN_EXPIRED | 401 | The access token has expired. Refresh the session (the SDK does it for you) or sign in again. |
TOKEN_SIGNATURE_INVALID | 401 | The access token signature is invalid: it was not issued by this project, or it was altered. |
TOKEN_AUDIENCE_INVALID | 401 | The access token was issued for another project. Use a token obtained by signing in to this project. |
RATE_LIMITED | 429 | Too many attempts. Try again in <retry_after> seconds. |
INVALID_CREDENTIALS | 401 | Invalid email or password. |
EMAIL_ALREADY_IN_USE | 409 | This email is already in use. |
BUCKET_NOT_FOUND | 404 | Bucket "<bucket>" does not exist in this project. Existing buckets: <existing>. Create it with aura.storage.createBucket('<bucket>') or in Studio › Storage. |
FUNCTION_NOT_FOUND | 404 | Function <name> not found: no active function of this project has this name or identifier. List them with aura functions list. |
BUCKET_ALREADY_EXISTS | 400 | Bucket "<bucket>" already exists in this project. Choose another name, or use the existing bucket. |
CURRENT_PASSWORD_INCORRECT | 401 | The current password is incorrect. |
AI_PROVIDER_NOT_CONFIGURED | 400 | The AI provider <provider> is configured neither for this project nor in the service environment. Save a key with <route> (JSON body with api_key), or set <env_var> on the server. |
CHAT_PROVIDER_NOT_CONFIGURED | 400 | No chat provider is configured and enabled for this project. Configure one with <route> (JSON body with api_key and enabled: true) using one of <providers>, or set the matching key in the service environment (ANTHROPIC_API_KEY / OPENAI_API_KEY / GOOGLE_API_KEY). |
QUOTA_EXCEEDED | 403 | Monthly quota reached for <metric>: <used> of <limit> used. It resets on <resets_at> (UTC). Change plan in Studio › Billing, or see the limits of each plan at https://aurabase.cloud/docs/limits |
EMAIL_NOT_CONFIRMED | 403 | Confirm your email address before signing in. Send a new confirmation link with auth.resendVerificationEmail(email). |
USER_BANNED | 403 | This account is suspended. Contact the application's support. |
MFA_CODE_INVALID | 401 | The verification code is incorrect. Check the code in your authenticator app and try again. |
MFA_CHALLENGE_EXPIRED | 401 | The sign-in challenge has expired. Sign in again with your password. |
TOTP_CODE_REUSED | 401 | This code was already used. Wait for the next code from your authenticator app. |
ANONYMOUS_SIGNINS_DISABLED | 403 | Anonymous sign-ins are disabled for this project. Enable them in Studio › Authentication › Configuration. |
PROVIDER_NOT_CONFIGURED | 400 | <provider> sign-in is not configured for this project. Add a client ID and secret in Studio › Authentication › Providers. |
REDIRECT_URL_NOT_ALLOWED | 400 | The redirect URL <redirect_to> is not in this project's allow list. Add it in Studio › Authentication › Configuration › Redirect URLs. |
SESSION_REVOKED | 401 | This session was revoked (sign-out, device revoked, password change or ban). Sign in again. |
REFRESH_TOKEN_REJECTED | 401 | The refresh token is no longer valid (<reason>). Sign in again. |
HOOK_FAILED | 502 | The <hook> hook of this project failed: <reason>. Fix the hook in Studio › Authentication › Hooks (or remove its URL); sign-in is refused until it answers correctly. |
UPSTREAM_UNAVAILABLE | 503 | A dependency of the platform (<service>) is temporarily unavailable. Retry in <retry_after> seconds; no data was changed. |