| title | Troubleshooting Common Issues |
|---|---|
| category | Debugging |
| tags | troubleshooting, errors, fixes |
Check if ports are in use:
lsof -i :8000 # API port
lsof -i :3000 # Web port
lsof -i :5432 # Database portVerify Docker is running:
docker infoCheck container logs:
dev docker logs api
dev docker logs webTry stop and restart:
dev docker down
dev docker up -ddev docker up preflights the daemon and prints a friendly message if it's
down. If you see it, start Docker (OrbStack or Docker Desktop) and retry. A raw
docker.sock: no such file or directory from another command means the same
thing.
The api container exits during the JWKS/uv sync step with something like:
error: No interpreter found for Python 3.14.6 in managed installations or search path
This is a stale base image: the cached api image ships an older Python patch
than server/.python-version requires, and a plain rebuild reuses the cached
FROM layer. Refresh the bases and rebuild:
dev docker up -b --pull -d--pull re-fetches python:3.14.x-slim and uv so the rebuilt image satisfies
the pin. (The Dockerfile pins the patch to keep this rare, but a .python-version
bump can still outrun a cached image.)
uv sync clones a git dependency (the dramatiq fork) over the network, and
Docker's embedded DNS can flap transiently:
failed to fetch commit ... Could not resolve host: github.com
Startup now retries uv sync a few times, so this usually self-heals. If the
container still exited, just restart it — the retry runs again with a fresh
resolver:
dev docker up -d api workerWait for health check (up to 40 seconds on first start)
Check db container:
dev docker ps
dev docker logs dbVerify database is healthy:
# Each instance has its own database: polar_dev_<instance-number>
dev docker exec db psql -U polar -d polar_dev_<N> -c "SELECT 1"Shared infra (db/redis/minio) is on the polar-shared Docker network with no
host port — reach it through dev docker exec or docker exec polar-shared-<svc>-1.
Check file mounting:
dev docker shell api
ls -la /app/server/polar/Restart the service:
dev docker restart apiIf still broken, rebuild:
dev docker build api
dev docker restart apiCheck Docker memory settings (should be 8GB+)
Stop unused instances:
dev docker down -i 1
dev docker down -i 2Clean up Docker:
docker system pruneOn a fresh worktree the api container (building the email renderer) and the
web container (installing frontend deps) can both run pnpm install at the
same time and OOM. Symptom in docker logs polar-app-<N>-api-1:
ERR_PNPM_ENOMEM ENOMEM: not enough memory, copyfile ...
docker ps then shows api/web with Exited (1) while worker is still Up.
Fix — restart the failed containers, pnpm resumes from its cache:
docker start polar-app-<N>-api-1 polar-app-<N>-web-1Wait for /healthz on the API port (printed by dev docker up) to come up
before continuing. Bumping Docker Desktop's memory above 8 GB or starting
services one at a time (dev docker up -d api, then web) also avoids the
clash.
Shared MinIO exposes ports 9000 (API) and 9001 (console) on localhost. Access
the console at http://localhost:9001 with credentials polar-development /
polar123456789.
Check minio-setup logs:
dev docker logs minio-setupList this instance's buckets:
dev docker exec minio mc alias set local http://localhost:9000 \
polar-development polar123456789
dev docker exec minio mc ls localBuckets are per-instance: polar-s3-<N> and polar-s3-public-<N>.
Clear Next.js cache:
dev docker shell web
rm -rf .next
exit
dev docker restart webReinstall dependencies:
dev docker shell web
pnpm install
exit
dev docker restart webCheck current migration state:
dev docker shell api
uv run alembic currentRun pending migrations:
uv run alembic upgrade headRollback if needed:
uv run alembic downgrade -1If polar-shared-db-1 was recreated (e.g. you ran dev docker down on the
shared stack, or it was replaced by an unrelated docker compose run), the
running api/worker still hold connections to the old container and surface
errors like:
asyncpg.exceptions._base.InterfaceError: connection is closed
sqlalchemy.dialects.postgresql.asyncpg.InterfaceError
Fix — restart api and worker so the pool reconnects:
docker restart polar-app-<N>-api-1 polar-app-<N>-worker-1dev docker runs the shared infra under the project name polar-shared on
the polar-shared network. Running cd server && docker compose up from the
same checkout creates a parallel stack on server_default with server-
prefixed containers. They don't conflict by name, but: they double the
memory footprint, docker ps shows two of everything, and a later
docker compose down on one stack will leave the other half running with
broken cross-network references.
Pick one. For everything in this skill, prefer dev docker.
When all else fails:
dev docker cleanup -f
dev docker up -b -dThis removes all data and rebuilds from scratch.
- Check logs:
dev docker logs - Check status:
dev docker ps - Check Docker:
docker info - Try restart:
dev docker restart - Try cleanup:
dev docker cleanup