Troubleshooting
Common issues and solutions for self-hosted Tokamak deployments
Common failure modes and how to resolve them.
Nothing starts at all
Every Compose service is profile-gated. If COMPOSE_PROFILES is unset or empty in tokamak-services/.env, docker compose up starts zero containers and exits without an error.
COMPOSE_PROFILES=infra,api,web,fullService won't start
Check service health:
make tokamak-healthCommon causes:
- Missing
.envfile — runmake tokamak-setupto generate it from the template - Port conflict — check
docker psfor containers using 8080 (gateway), 5432 (Postgres), 6379 (Redis), 3001 (web), or the docs/Grafana port - Docker not running — ensure Docker Desktop or the Docker daemon is active
Core refuses to boot
Core exits at startup if JWT_SIGNING_SECRET or KEYCLOAK_BASE_URL is set on it. Token validation belongs to the auth service; set those variables there instead.
Database errors
Re-run core's migrations:
make -C infra/docker/tokamak db-migrateReset the database (destroys all data):
make tokamak-down-clean
make tokamak-up-devOpen a PostgreSQL shell to inspect state:
make -C infra/docker/tokamak db-consoleRemember that core and auth own separate schemas in the same database — check both if a query comes back empty.
Authentication failures
Symptoms: 401 on every request, or 403 on endpoints the caller should be able to reach.
Check:
- The API key has not expired.
tokamak auth statusreports the expiry. SYSTEM_ADMIN_EMAILis set if you need the first platform administrator on a fresh deployment.- With OIDC enabled,
KEYCLOAK_BASE_URL,KEYCLOAK_REALM, andKEYCLOAK_CLIENT_IDare correct and reachable from the auth container. - For a
403, compareGET /v1/me/permissionsagainst the permission the endpoint requires. See Access Control.
authorization unavailable or delegation token unavailable from the gateway means the gateway could not reach auth, or could not mint an internal token. Check TOKAMAK_AUTH_URL and that AUTHZ_DELEGATION_PRIVATE_KEY is set consistently across gateway replicas — if it is unset each replica generates its own ephemeral key and tokens fail verification.
Port conflicts
Check what's using a port:
lsof -i :8080
lsof -i :5432Stop conflicting containers:
docker ps
docker stop <container-id>Or change the port in .env and restart. Note that the docs site and Grafana both default to 3002 in some templates — set GRAFANA_PORT or DOCS_PORT if they collide.
Container logs
make tokamak-logs # All services
make -C infra/docker/tokamak logs-api # gateway, core, auth
make -C infra/docker/tokamak logs-infra # Postgres, Redis
make -C infra/docker/tokamak logs-web # web app, docsFor a single container:
docker compose -p tokamak logs tokamak-gateway
docker compose -p tokamak logs tokamak-core
docker compose -p tokamak logs api-dbUpgrading
If you're upgrading from a previous version and seeing unexpected errors, see the Upgrading guide.
Getting help
If none of the above resolves your issue, open an issue at github.com/janhq/tokamak with the output of make tokamak-health and the relevant logs.