Flask Extension Gunicorn GLogging Error With Access Logs #354
Labels
bug
Something isn't working
good first issue
Good first issue
priority:p2
Issues that are less important than priority:p1
Describe your environment
Using Python 3.6, with a basic flask application with gunicorn.
Python Libs:
Reproducible Structure
app/__init__.py
app/api.py
app/wsgi.py
config/gunicorn_config.py
config/log_config.py
Steps to reproduce
At the root of the above, run
gunicorn -c config/gunicorn_config.py app.wsgi:app
Hit the base endpoint
curl http://localhost:8000
Get the following error thrown by gunicorn:
It appears that the error is caused by adding Objects as keys to the environment, which is done by OpenTelemetry here:
https://github.com/open-telemetry/opentelemetry-python/blob/master/ext/opentelemetry-ext-flask/src/opentelemetry/ext/flask/__init__.py#L15-L17
This ends up triggering the error in Gunicorn Glogging:
https://github.com/benoitc/gunicorn/blob/master/gunicorn/glogging.py#L326
Note: Gunicorn only executes this if certain logging configuration is enabled (access logs), as indicated by the if statement here:
https://github.com/benoitc/gunicorn/blob/master/gunicorn/glogging.py#L335-L338
What is the expected behavior?
No errors :)
I'd expect that we wouldn't be storing objects as a key in the environment.
The text was updated successfully, but these errors were encountered: