Technologies/Grafana/gunicorn.exceptions
GrafanaGrafanaMetric

gunicorn.exceptions

Total exceptions during request processing
Dimensions:None

Technical Annotations (47)

Configuration Parameters (11)
--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
scrape_configs.job_namerecommended: django_app
Identifier for the Django application scrape job in Prometheus
scrape_configs.static_configs.targetsrecommended: ['localhost:8000']
Target endpoint(s) for Prometheus to scrape Django/Gunicorn metrics
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
proxy_http_versionrecommended: 1.1
Ensures proper HTTP/1.1 handling at nginx proxy layer
proxy_set_header Connectionrecommended: ""
Prevents connection header issues in nginx proxy configuration
Error Signatures (11)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>exception
Worker failed to boot.log pattern
Worker failed to booterror code
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
gunicorn.errors.HaltServer: <HaltServer 'worker failed to boot.' 3>exception
ImportError: No module namedexception
400http status
CLI Commands (4)
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
pip install mymoduleremediation
Technical References (21)
HaltServerexceptionWORKER_BOOT_ERRORerror codehttp_requests_totalcomponentrate()conceptscrape_configscomponentstatic_configscomponentstderrfile pathSIGKILLconceptlogging deadlockconceptgunicorn.arbitercomponentPROPAGATE_EXCEPTIONScomponentFlask endpointcomponent@server.errorhandlercomponentlogging.config.dictConfigcomponentLOGGING dictionaryconceptTransfer-EncodingprotocolRFC 7230protocolCWE-444conceptchunked encodingprotocolgthread workercomponentissue #1976concept
Related Insights (13)
Application code errors prevent Gunicorn worker startupcritical
Syntax errors or exceptions in application code prevent worker bootcritical
Circular imports or improper module initialization cause boot failurescritical
High HTTP 500 error rate triggers critical alertcritical
Prometheus metrics scraping from Django applicationinfo
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
Flask error handlers not registered when defined in non-imported module with Gunicornwarning
Gunicorn exceptions hidden when custom Django logging disables existing loggerscritical
Module import errors prevent Gunicorn worker initializationcritical
Transfer-Encoding header smuggling enables security bypasscritical
gthread worker processes requests from closed connectionswarning