Skip to content

Troubleshooting

Historically this was an origin mismatch, not a permissions problem — fixed now, but the check is worth knowing:

403 INVALID_ORIGIN

BASE_URL and the URL in your browser disagree. Add the browser’s origin to TRUSTED_ORIGINS, exactly as it appears (scheme, host, port).

A state-changing request arrived without an Origin header. Browsers always send one; curl does not. Add -H 'Origin: http://your-origin'.

BETTER_AUTH_SECRET does not match this instance

Section titled “BETTER_AUTH_SECRET does not match this instance”

You changed the secret after first boot. Restore the previous one, or truncate the jwks table and accept that every session and token becomes invalid.

An old failure mode from a schema split, fixed by pinning search_path on every pool. If you see it, /api/health reports the schema and searchPath it resolved — compare with what you configured.

dynamicAccessControl: true without an accessControl vocabulary. Declare the resources and actions your roles are allowed to mention.

YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE with missingPermissions: ["member:read"]

Section titled “YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE with missingPermissions: ["member:read"]”

An old bug: a custom ac replaces the plugin’s default statement, which omits read. Fixed in this build by adding read to every built-in resource.

public/r is gitignored; the Docker image builds it. If you run from source, run pnpm --filter @ownauth/auth-service registry:build before starting.

Sign-up succeeds but the browser is not signed in

Section titled “Sign-up succeeds but the browser is not signed in”

The cookie was rejected. On an IP, cookies are host-only — the app must be on the same host. On a domain, app.example.com and auth.other.com cannot share a cookie; browsers block third-party cookies and no configuration changes that.

The container runs as uid 1000 and the config directory is owned by someone else:

Terminal window
chown -R 1000:1000 config/

The console renders but stays on “loading”

Section titled “The console renders but stays on “loading””

Historically a server-only import (pg needing Buffer) leaking into the client bundle. If you extend the console, keep server modules out of anything imported by a route component — import them inside the handler instead.

Nothing works and the container is unhealthy

Section titled “Nothing works and the container is unhealthy”
Terminal window
docker compose logs auth --tail 50
curl -s localhost:3000/api/health

The health endpoint returns the actual error: password authentication failed for user "ownauth" means DATABASE_URL and POSTGRES_PASSWORD disagree, which happens when you change the password after the volume was initialised.