Troubleshooting
Common issues and solutions when deploying or running acodeaday.
Database Issues
Connection failed / timeout
Symptoms: Backend fails to start, "connection refused", or timeout errors.
Solutions:
Verify connection string format - Must use
postgresql+asyncpg://(notpostgresql://)For Supabase Cloud - Use the Transaction pooler URL (port 6543), not direct connection:
bash# ✅ Correct - Transaction pooler (port 6543) postgresql+asyncpg://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres # ❌ Wrong - Direct connection (port 5432) postgresql+asyncpg://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:5432/postgresTo get the correct string: Supabase Dashboard → Settings → Database → Connection string → URI → Transaction pooler
For local Supabase with Docker - Use
host.docker.internalinstead oflocalhost:bashDATABASE_URL=postgresql+asyncpg://postgres:postgres@host.docker.internal:54322/postgresCheck IP allowlist - In Supabase Dashboard → Settings → Database → Network, ensure your server's IP is allowed.
Authentication Issues
"Email not confirmed" error
Problem: User can't log in because email isn't confirmed.
Solutions:
Check email inbox (including spam folder) for confirmation link
Manually confirm in Supabase Dashboard:
- Go to Authentication → Users
- Find the user and click "Confirm email"
Use service role key for auto-confirm (recommended):
- Set
SUPABASE_SERVICE_ROLE_KEYin your environment - The backend will auto-confirm users when creating them
- Get this from Supabase Dashboard → Settings → API →
service_rolekey
- Set
"Invalid credentials" error
Problem: Login fails even with correct email/password.
Solutions:
- Verify
SUPABASE_URLandSUPABASE_KEYare correct - Check Supabase project is active (not paused)
- Verify user exists in Supabase Dashboard → Authentication → Users
- Ensure email is confirmed (see above)
Frontend Issues
Browser showing old API URLs after config change
Problem: After changing VITE_API_URL or other environment variables, the browser still makes requests to the old URL.
Cause: Browser caches JavaScript files. The frontend replaces environment variable placeholders at container startup, but browsers serve cached versions.
Solutions:
Hard refresh:
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac)Clear browser cache:
- Chrome: Settings → Privacy → Clear browsing data → Cached images and files
- Or: DevTools (F12) → Network tab → Check "Disable cache" → Refresh
Try incognito/private mode to verify with a clean cache
Log out and log back in to force fresh page load
After Changing Environment Variables
- Restart the frontend container
- Tell users to hard refresh their browsers
Frontend can't reach backend
Problem: API requests fail, CORS errors, or "Network Error".
Solutions:
Verify
VITE_API_URLis set correctly:- Local dev:
http://localhost:8000 - Subdomain routing:
https://api.yourdomain.com - Path-based routing:
/apiorhttps://yourdomain.com/api
- Local dev:
Check CORS configuration - Backend's
CORS_ORIGINSmust include the frontend domain:bashCORS_ORIGINS=https://yourdomain.com,https://www.yourdomain.comVerify backend is running:
bashcurl https://api.yourdomain.com/health
Double /api/api in URLs (path-based routing)
Problem: Requests go to /api/api/... instead of /api/....
Cause: VITE_API_URL includes /api suffix AND frontend code adds /api prefix to endpoints.
Solutions:
Use subdomain routing instead (recommended):
- Backend at
api.yourdomain.com - Set
VITE_API_URL=https://api.yourdomain.com - No path stripping needed
- Backend at
For path-based routing: Ensure the reverse proxy isn't stripping
/apiprefix, or adjustVITE_API_URLaccordingly.
Judge0 Issues
Judge0 not starting
Problem: Judge0 container fails to start or stays unhealthy.
Cause: Judge0 requires privileged mode for sandboxed code execution.
Solution: Ensure privileged: true is set:
services:
judge0-server:
privileged: true # Required!WARNING
Some platforms (like certain Kubernetes setups) don't support privileged containers. Use an external Judge0 instance or RapidAPI in that case.
Code execution times out
Problem: Submissions hang or timeout.
Solutions:
Check Judge0 is healthy:
bashcurl http://localhost:2358/aboutCheck Judge0 workers are running:
bashdocker compose logs judge0-workersRestart Judge0 services:
bashdocker compose restart judge0-server judge0-workers
Deployment Issues (Coolify/VPS)
502 Bad Gateway
Problem: Reverse proxy returns 502 error.
Solutions:
Check container is running:
bashdocker compose psCheck container logs:
bashdocker compose logs backend docker compose logs frontendVerify port configuration in your reverse proxy matches the container's exposed port
SSL/HTTPS issues
Problem: Mixed content errors or SSL certificate issues.
Solutions:
Ensure all URLs use HTTPS:
VITE_API_URL=https://...(not http)VITE_SUPABASE_URL=https://...
Verify SSL certificate is valid and not expired
Check reverse proxy SSL configuration
Getting Help
If you're still stuck:
Check container logs for detailed error messages:
bashdocker compose logs backend docker compose logs frontend docker compose logs judge0-serverSearch existing issues on GitHub
Open a new issue with:
- What you're trying to do
- Error messages (from logs and browser console)
- Your environment (Docker, Coolify, etc.)
- Relevant config (sanitize secrets!)