Troubleshooting

Common issues and how to fix them.

Common issues and how to fix them.

ProblemCauseFix
Invalid username or passwordALLOWED_ORIGINS mismatch (CORS block)Set ALLOWED_ORIGINS to exactly match the URL in your browser — not localhost if you're using the server IP
Backend crashes on startExtra fields in .envAdd "extra": "ignore" to model_config in config.py
Frontend can't reach backendWrong NEXT_PUBLIC_API_URLUpdate .env.local and rebuild with npm run build
venv not created on deployMissing python3-venvsudo apt install python3-venv
systemctl permission deniedNo passwordless sudo ruleAdd NOPASSWD: /bin/systemctl to /etc/sudoers
TS build error: unknown[]Missing type cast on API responseCast with data as User[]
useSearchParams Suspense errorNext.js requires Suspense boundaryWrap component using useSearchParams() in <Suspense>

Useful Debug Commands

# View backend logs
sudo journalctl -u pycon-backend -f

# Test login directly
curl -s -X POST http://YOUR_IP:8000/api/auth/login \
  -d "username=admin&password=yourpassword" \
  -H "Content-Type: application/x-www-form-urlencoded"

# Health check
curl -s http://YOUR_IP:8000/api/health

# Check service status
sudo systemctl status pycon-backend pycon-frontend