Troubleshooting¶
Common issues and how to fix them.
Database Connection Refused¶
Symptoms: Server crashes on startup with ECONNREFUSED or Can't reach database server.
Causes and fixes:
- PostgreSQL isn't running. Start it with
docker compose up -d db(Docker) orbrew services start postgresql@17/sudo systemctl start postgresql(manual). - Wrong
DATABASE_URL. Double-check the host, port, username, password, and database name inapps/server/.env. - Docker Compose: host must be
db(the service name), notlocalhost. - Manual setup: host is
localhost(or your PG host). - Docker network issues. If the server container can't resolve
db, trydocker compose down && docker compose up -dto recreate the network.
# Test the connection directly
docker compose exec db psql -U postgres -d freezer_tracker -c "SELECT 1;"
Port 3000 Already in Use¶
Symptom: Error: listen EADDRINUSE: address already in use :::3000
Fix: Change the PORT variable in apps/server/.env:
If using Docker Compose, also update the port mapping in docker-compose.yml:
Or find and stop the process using port 3000:
CORS Errors¶
Symptom: Browser console or client shows CORS policy: No 'Access-Control-Allow-Origin' header.
Fix: Set ALLOWED_ORIGINS in apps/server/.env to include the exact origin the client uses:
# Tauri desktop app
ALLOWED_ORIGINS=tauri://localhost,http://localhost:1420
# If accessing from another device on the network
ALLOWED_ORIGINS=tauri://localhost,http://localhost:1420,http://192.168.1.50:1420
Warning
Origins must match exactly — protocol, host, and port. http://localhost:1420 and http://localhost:3000 are different origins. Do not use trailing slashes.
Restart the server after changing this value.
JWT Secret Missing¶
Symptom: Server fails to start with an error about missing JWT configuration.
Fix: Both JWT_SECRET and JWT_REFRESH_SECRET must be set in apps/server/.env. Generate strong random values:
Warning
If you change JWT secrets after users have registered, all existing sessions are invalidated. Users will need to log in again.
Prisma Migration Failures¶
Symptom: bunx prisma migrate deploy fails with errors.
Common causes:
- Database doesn't exist. Create it first:
- Connection string is wrong. Verify
DATABASE_URLinapps/server/.env— the database name, user, and password must match your PostgreSQL setup. - Migrations out of sync. If you're on a development branch with migration conflicts:
Warning
prisma migrate reset drops all data in the database. Only use this in development.
Client Can't Connect to Server¶
Symptom: The client app shows a connection error or spins indefinitely.
Fixes:
- Wrong server URL. Open the client settings and verify the server URL. It should be the full base URL (e.g.,
http://192.168.1.100:3000), not just an IP. - Server not reachable from the client device. If the client is on a different device (e.g., iPhone), make sure the server is accessible over the network. Test from the client device:
- Firewall blocking port 3000. Open the port on the server machine's firewall.
- HTTPS required in production. If you've set
NODE_ENV=productionand are connecting over the internet, some clients enforce HTTPS. Use a reverse proxy (e.g., Caddy, nginx) to terminate TLS.
Tip
For local network usage, http:// is fine. You only need HTTPS if you're exposing the server to the internet.
Docker Compose Build Fails¶
Symptom: docker compose up -d fails during the build step.
Fixes:
- Docker not installed or not running. Verify with: Make sure Docker Desktop (macOS) or the Docker daemon (Linux) is running.
- Insufficient disk space. Docker images need ~1 GB. Check with
docker system dfand clean up withdocker system pruneif needed. - Network issues pulling images. If
postgres:17-alpinefails to pull, check your internet connection and Docker Hub status.
Tauri Build Prerequisites¶
If you're building the client from source and the build fails, you likely need to install platform-specific dependencies.
macOS¶
- Xcode — install from the Mac App Store.
- Xcode Command Line Tools:
- Rust toolchain:
- Verify:
iOS¶
All macOS prerequisites above, plus:
- iOS simulator or device configured in Xcode.
- Tauri iOS target:
Note
See the Tauri v2 prerequisites guide for the full list of system dependencies per platform.
Still Stuck?¶
- Check the server logs:
docker compose logs -f server(Docker) or check the terminal output (manual). - Search existing issues on GitHub.
- Open a new issue with your error output and environment details.