Troubleshooting & FAQ
Common issues and how to debug them when running KanbanAI locally or in self-hosted environments.Codex CLI / agent fails
Symptom: Attempts fail immediately, or the Dashboard shows no agents registered.- Ensure the Codex CLI is installed and on
PATH. - Verify
CODEX_API_KEYis set inserver/.env(or equivalent env for your process). - Optional overrides:
OPENAI_BASE_URL– override the default API base.CODEX_PATH/CODEX_PATH_OVERRIDE– point KanbanAI at a non-default Codex binary path.
- Check server logs (see Logging section below) for errors from the agents module.
GitHub OAuth / device flow issues
Symptom: Device flow never completes, or GitHub connection status stays “Not connected”.- Verify your GitHub OAuth App:
- Device Flow is enabled.
- Client ID/secret are copied correctly.
- Check how credentials are provided:
- During onboarding or via Settings → GitHub OAuth App.
- Or via
GITHUB_CLIENT_ID/GITHUB_CLIENT_SECRETinserver/.env.
- Use the onboarding guide:
- See
docs/guides/onboarding.mdfor the exact API flow.
- See
- Check
/api/v1/auth/github/checkto see the current auth status.
Database & migrations
Symptom: Server fails to start with migration or database errors.- Confirm
DATABASE_URL:- If unset, the server will use the default OS data directory path.
- If set, ensure the directory exists and the process has write permission.
- Dev vs prod databases:
bun run devwrites tokanban-dev.dbunder the OS data directory (e.g.~/.local/share/kanbanai/kanban-dev.db).bun run prodand binaries continue to usekanban.dbin the same directory when no override is provided.- To reset the dev database, stop the dev server and delete
kanban-dev.db(or pointKANBANAI_DEV_DATABASE_URL/DATABASE_URLat a fresh path).
- Check migrations:
- Migrations run automatically on start.
- If you override
KANBANAI_MIGRATIONS_DIR, ensure it points at a valid Drizzle migrations directory (for example, a copy ofserver/drizzlecontaining ordered.sqlfiles).
- Look at logs around startup for
migrationsordberrors.
Worktrees & disk usage
Symptom: Disk fills up, or stale worktrees remain after heavy use.- Worktree location:
$HOME/.cache/kanban-ai/worktrees/<project>/<attempt>/....
- Automatic cleanup:
- When cards move to Done and Attempts are finished, Tasks listeners call cleanup.
- Project deletion also purges worktrees for that repo.
- Manual cleanup:
- Stop the server.
- Inspect/remove stale worktree directories under
~/.cache/kanban-ai/worktreesas needed.
Logging & debugging
- Logs are human-readable lines emitted via Winston:
- Format:
LEVEL [scope] message key=value .... - Scopes align with domains (e.g.
[github:repos],[tasks],[ws:kanban],server). LOG_LEVELcontrols verbosity (debug,info,warn,error; defaultinfo).
- Format:
- Request-level traces:
- Enabled with
KANBANAI_DEBUG=1,DEBUG=*/DEBUG=kanbanai*, orLOG_LEVEL=debug. - When on, Hono logs appear at
debuglevel with thehonoscope alongside regular server logs.
- Enabled with
- Examples:
Ports & host conflicts
Symptom: Server fails to bind or UI can’t reach the API.- Defaults:
- API host:
127.0.0.1 - API port:
3000
- API host:
- Overrides:
HOSTandPORTenv vars.
- Ensure nothing else is running on the chosen port and that your client
.env(VITE_SERVER_URL) matches.