Section 7

Common deployment errors

If your deploy isn't behaving as expected, check this table first. Most issues fall into one of these nine categories.

Error / symptomLikely causeFix
502 Bad GatewayApp not listening on APP_PORTBind to 0.0.0.0:$APP_PORT
CSRF verification failedCSRF_TRUSTED_ORIGINS not setAdd APP_DOMAIN to CSRF config (see Framework recipes → Django)
413 Request Entity Too LargeFile > 50 MBCompress or use external storage
App crashed on startMissing SECRET_KEY / APP_KEYSet it in user env vars before deploy
Files missing after redeployWriting outside /app/storageUse the APP_STORAGE path (see Persistent storage)
Static files 404collectstatic not in build commandAdd collectstatic to BUILD_COMMANDS
DB migration failedmigrate not in run commandRun migrate before gunicorn starts
WebSocket disconnectsIdle connection timeoutHandled by platform — contact support
Port already in usePrevious deploy still shutting downPlatform handles this — redeploy
Still stuck?Open your project in the dashboard and check the real-time logs tab — your app's stdout/stderr output is streamed live and usually shows the exact error within the first few lines of startup.

Need more help?

If you've checked the logs and the error isn't listed here, reach out to support. Include your project ID (APP_ID) and the first 20 lines of your startup log.

Contact support Service status