Technologies/Flask/gunicorn.log.error
FlaskFlaskMetric

gunicorn.log.error

Number of error log messages
Dimensions:None

Technical Annotations (74)

Configuration Parameters (14)
--error-logfilerecommended: /var/log/gunicorn/error.log
enables detailed error logging for startup failures
--preloadrecommended: enabled
loads application code before forking workers to detect import and initialization errors
rate_windowrecommended: 5m
Time window for calculating error rate to smooth transient spikes
error_thresholdrecommended: 0.01
1% error rate threshold triggering critical alert
max_requestsrecommended: 1000
recycles workers after N requests to prevent long-running logging issues
max_requests_jitterrecommended: 100
adds randomness to worker recycling to avoid thundering herd
workersrecommended: 4
reduce worker count to limit concurrent stderr writes during peak hours
PROPAGATE_EXCEPTIONSrecommended: True
Flask config to enable exception propagation to Gunicorn logs
disable_existing_loggersrecommended: False
Top-level key in Django LOGGING dict; prevents disabling Gunicorn's handlers
--log-levelrecommended: debug
Gunicorn CLI parameter controlling log verbosity; propagates to Flask when handlers synchronized
preload_apprecommended: True
Required in Gunicorn config when using custom Dockerfile on Cloud Run to eliminate timeout cycle
timeoutrecommended: 1200
User tested 20-minute timeout but it only延ed each worker death—did not resolve root cause
/var/run/gunicorn.pid
PID file location for targeting master process in shutdown commands
KillModerecommended: mixed
systemd workaround to avoid ERROR logs but prevents graceful worker shutdown
Error Signatures (17)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>exception
Worker failed to boot.log pattern
Worker failed to booterror code
gunicorn.errors.HaltServer: HaltServer 'Worker failed to boot.' 3exception
5xxhttp status
status=~"5.."log pattern
status=500http status
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>exception
Worker with pid [0-9]+ was terminated due to signal 9log pattern
9error code
Worker with pid %s was terminated due to signal %slog pattern
WORKER TIMEOUT (pid:log pattern
Worker (pid:*) was sent SIGKILL! Perhaps out of memory?log pattern
upstream prematurely closed connection while reading response header from upstreamlog pattern
502http status
Worker (pid:*) was sent SIGTERM!log pattern
15error code
CLI Commands (7)
gunicorn app:app --error-logfile /var/log/gunicorn/error.log --access-logfile /var/log/gunicorn/access.log --preloaddiagnostic
gunicorn app:app --workers=4 --max-requests=1000 --max-requests-jitter=100remediation
gunicorn myapp:server --bind localhost:8000 -chdir /path/to/project --workers 2diagnostic
gunicorn --workers=2 --bind=0.0.0.0:8000 --log-level=debug app:appdiagnostic
kill -TERM $(cat /var/run/gunicorn.pid)remediation
pkill --oldest -TERM "gunicorn"remediation
systemctl stop gunicorn.serviceremediation
Technical References (36)
HaltServerexceptionWORKER_BOOT_ERRORerror codeWSGI applicationcomponentapp.pyfile pathdotenvcomponenthttp_requests_totalcomponentrate()conceptstderrfile pathSIGKILLconceptlogging deadlockconceptgunicorn.arbitercomponentPROPAGATE_EXCEPTIONScomponentFlask endpointcomponent/var/log/upstart/myapp.logfile pathupstartcomponent@server.errorhandlercomponentlogging.config.dictConfigcomponentLOGGING dictionaryconceptgunicorn.errorcomponentapp.loggercomponentWerkzeugcomponentGoogle App EnginecomponentGoogle Cloud RuncomponentB2 instance classcomponentgthread workercomponentB4 instance classcomponentarbiter.pyfile pathmaster processcomponentworker processcomponentWIFSIGNALEDconceptwaitpidconceptsignal handlercomponentSIGTERMconceptsystemdcomponentsession hijackingconceptcache poisoningconcept
Related Insights (20)
Application code errors prevent Gunicorn worker startupcritical
Incorrect WSGI application entry point prevents worker bootcritical
Syntax errors or exceptions in application code prevent worker bootcritical
Missing or misconfigured environment variables cause worker startup crashcritical
Enable verbose logging to diagnose worker boot failuresinfo
High 5xx error rate indicates service degradationcritical
High HTTP 500 error rate triggers critical alertcritical
Reentrant logging deadlock causes worker termination with SIGKILLcritical
Gunicorn workers crash with reentrant logging errors causing intermittent downtimecritical
Flask uncaught exceptions not logged by Gunicornwarning
Gunicorn logs location for upstart deploymentsinfo
Flask error handlers not registered when defined in non-imported module with Gunicornwarning
Gunicorn exceptions hidden when custom Django logging disables existing loggerscritical
Missing Flask application logs when Gunicorn log level not synchronizedwarning
Gunicorn workers enter infinite timeout-SIGKILL cycle on Google App Enginecritical
Gunicorn SIGKILL message incorrectly suggests OOM when memory is availablewarning
SIGTERM signals to workers create false positive error logs during deploymentswarning
Worker signal handling failure indicates fatal worker problemcritical
SIGTERM during graceful shutdown logged as error in v21+warning
Session hijacking and unauthorized endpoint access via smuggled requestscritical