Tobias Edvardsson created AIRFLOW-6567:

             Summary: Configuration broken when using proxy_fix
                 Key: AIRFLOW-6567
             Project: Apache Airflow
          Issue Type: Bug
          Components: webserver
    Affects Versions: 1.10.7
            Reporter: Tobias Edvardsson

We tried to upgrade from 1.10.6 to 1.10.7 but encountered an issue when trying 
to access the webserver. We are running the solution in kubernetes at AWS 
behind Kong as proxy/gateway.

1.10.6 works niceley but after the upgrade we get the following exception:
[2020-01-15 08:12:02 +0000] [111] [ERROR] Error handling request /1/15/2020 
9:12:02 AM Traceback (most recent call last):1/15/2020 9:12:02 AM   File 
"/usr/local/lib/python3.7/site-packages/gunicorn/workers/", line 135, in 
handle1/15/2020 9:12:02 AM     self.handle_request(listener, req, client, 
addr)1/15/2020 9:12:02 AM   File 
"/usr/local/lib/python3.7/site-packages/gunicorn/workers/", line 176, in 
handle_request1/15/2020 9:12:02 AM     respiter = self.wsgi(environ, 
resp.start_response)1/15/2020 9:12:02 AM   File 
line 66, in __call__1/15/2020 9:12:02 AM     return app(environ, 
start_response)1/15/2020 9:12:02 AM   File 
"/usr/local/lib/python3.7/site-packages/flask/", line 2463, in 
__call__1/15/2020 9:12:02 AM     return self.wsgi_app(environ, 
start_response)1/15/2020 9:12:02 AM   File 
"/usr/local/lib/python3.7/site-packages/werkzeug/middleware/", line 
195, in __call__1/15/2020 9:12:02 AM     x_for = 
environ_get("HTTP_X_FORWARDED_FOR"))1/15/2020 9:12:02 AM   File 
"/usr/local/lib/python3.7/site-packages/werkzeug/middleware/", line 
166, in _get_trusted_comma1/15/2020 9:12:02 AM     if len(values) >= 
trusted:1/15/2020 9:12:02 AM TypeError: '>=' not supported between instances of 
'int' and 'str'
>From my own investigation the issue seem to be the new configuration options 
>for the proxy where the configuration which are fetched returns strings rather 
>then integers as it should.

x_for=conf.get("webserver", "PROXY_FIX_X_FOR", fallback=1),            
x_proto=conf.get("webserver", "PROXY_FIX_X_PROTO", fallback=1),            
x_host=conf.get("webserver", "PROXY_FIX_X_HOST", fallback=1),            
x_port=conf.get("webserver", "PROXY_FIX_X_PORT", fallback=1),            
x_prefix=conf.get("webserver", "PROXY_FIX_X_PREFIX", fallback=1)
(row 51-56 in airflow/www/

The following values are expected to be integers and not strings.


This message was sent by Atlassian Jira

Reply via email to