Naar de inhoud springen
Aurabase-logo
aurabasis

Probleemoplossing

Start from the message or the code in the response. Each entry says what it means and what to do.

Referentie6 min lezenNiveau referentie

Deze pagina is automatisch vertaald. De Engelse versie is gezaghebbend.

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.

CodeHTTPMeaning and what to do
INVALID_TOKEN401The access token is unreadable: it is not a valid JWT. Send Authorization: Bearer &lt;access_token&gt; obtained by signing in to your project.
PROJECT_NOT_FOUND404No active project at &lt;host&gt;: the project was deleted or the address is wrong. Check NEXT_PUBLIC_AURABASE_URL in Studio › Settings › Connection.
PROJECT_URL_REQUIRED400This 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_BROWSER401A 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_INVALID401The API key is invalid, expired or revoked. Send your project's key in the apikey header (Studio › Settings › Connection).
AUTHORIZATION_MISSING401The Authorization header is missing. Send Authorization: Bearer &lt;access_token&gt;.
AUTHORIZATION_BEARER_REQUIRED401The Authorization header must use the Bearer scheme: Authorization: Bearer &lt;access_token&gt;.
TOKEN_EXPIRED401The access token has expired. Refresh the session (the SDK does it for you) or sign in again.
TOKEN_SIGNATURE_INVALID401The access token signature is invalid: it was not issued by this project, or it was altered.
TOKEN_AUDIENCE_INVALID401The access token was issued for another project. Use a token obtained by signing in to this project.
RATE_LIMITED429Too many attempts. Try again in <retry_after> seconds.
INVALID_CREDENTIALS401Invalid email or password.
EMAIL_ALREADY_IN_USE409This email is already in use.
BUCKET_NOT_FOUND404Bucket "<bucket>" does not exist in this project. Existing buckets: <existing>. Create it with aura.storage.createBucket('&lt;bucket&gt;') or in Studio › Storage.
FUNCTION_NOT_FOUND404Function &lt;name&gt; not found: no active function of this project has this name or identifier. List them with aura functions list.
BUCKET_ALREADY_EXISTS400Bucket "<bucket>" already exists in this project. Choose another name, or use the existing bucket.
CURRENT_PASSWORD_INCORRECT401The current password is incorrect.
AI_PROVIDER_NOT_CONFIGURED400The AI provider &lt;provider&gt; 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_CONFIGURED400No 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_EXCEEDED403Monthly quota reached for &lt;metric&gt;: <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_CONFIRMED403Confirm your email address before signing in. Send a new confirmation link with auth.resendVerificationEmail(email).
USER_BANNED403This account is suspended. Contact the application's support.
MFA_CODE_INVALID401The verification code is incorrect. Check the code in your authenticator app and try again.
MFA_CHALLENGE_EXPIRED401The sign-in challenge has expired. Sign in again with your password.
TOTP_CODE_REUSED401This code was already used. Wait for the next code from your authenticator app.
ANONYMOUS_SIGNINS_DISABLED403Anonymous sign-ins are disabled for this project. Enable them in Studio › Authentication › Configuration.
PROVIDER_NOT_CONFIGURED400<provider> sign-in is not configured for this project. Add a client ID and secret in Studio › Authentication › Providers.
REDIRECT_URL_NOT_ALLOWED400The redirect URL <redirect_to> is not in this project's allow list. Add it in Studio › Authentication › Configuration › Redirect URLs.
SESSION_REVOKED401This session was revoked (sign-out, device revoked, password change or ban). Sign in again.
REFRESH_TOKEN_REJECTED401The refresh token is no longer valid (<reason>). Sign in again.
HOOK_FAILED502The &lt;hook&gt; 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_UNAVAILABLE503A dependency of the platform (<service>) is temporarily unavailable. Retry in <retry_after> seconds; no data was changed.
@aurabase/aurabase-js@0.7.5 · aura@0.3.4↗ Meld een probleem