You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/02/06 10:25:00 UTC

[jira] [Commented] (AIRFLOW-6740) Setting webserver.proxy_fix_num_proxies raises exception

    [ https://issues.apache.org/jira/browse/AIRFLOW-6740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17031446#comment-17031446 ] 

ASF GitHub Bot commented on AIRFLOW-6740:
-----------------------------------------

ashb commented on pull request #7359: [AIRFLOW-6740] Remove Undocumented, Deprecated, Dysfunctional PROXY_FIX_NUM_PROXIES
URL: https://github.com/apache/airflow/pull/7359
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Setting webserver.proxy_fix_num_proxies raises exception
> --------------------------------------------------------
>
>                 Key: AIRFLOW-6740
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6740
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: webserver
>    Affects Versions: 1.10.7
>            Reporter: Sebastian Brandt
>            Assignee: Sebastian Brandt
>            Priority: Minor
>
> Following configuration variable always leads to an exception:
> {code}
> [webserver]
> proxy_fix_num_proxies = <any value>
> {code}
> Exception:
> {code}
> Error handling request /home                                                                                                                                              
> Traceback (most recent call last):                                                                                                                                                                                 
>   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 135, in handle                                                                                                                      
>     self.handle_request(listener, req, client, addr)                                                                                                                                                               
>   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request                                                                                                              
>     respiter = self.wsgi(environ, resp.start_response)                                                                                                                                                             
>   File "/usr/local/lib/python3.7/site-packages/werkzeug/middleware/dispatcher.py", line 66, in __call__                                                                                                            
>     return app(environ, start_response)                                                                                                                                                                            
>   File "/usr/local/lib/python3.7/site-packages/sentry_sdk/integrations/flask.py", line 70, in sentry_patched_wsgi_app                           
>     environ, start_response                                                                                                                  
>   File "/usr/local/lib/python3.7/site-packages/sentry_sdk/integrations/wsgi.py", line 126, in __call__                                       
>     reraise(*_capture_exception(hub))                                                                                                        
>   File "/usr/local/lib/python3.7/site-packages/sentry_sdk/_compat.py", line 57, in reraise                                           
>     raise value                                                                                                                      
>   File "/usr/local/lib/python3.7/site-packages/sentry_sdk/integrations/wsgi.py", line 122, in __call__                                             
>     _sentry_start_response, start_response, span                                                 
>   File "/usr/local/lib/python3.7/site-packages/sentry_sdk/integrations/flask.py", line 69, in <lambda>
>     return SentryWsgiMiddleware(lambda *a, **kw: old_app(self, *a, **kw))(                                                                         
>   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__                                                               
>     return self.wsgi_app(environ, start_response)                                                                                                                 
>   File "/usr/local/lib/python3.7/site-packages/werkzeug/middleware/proxy_fix.py", line 195, in __call__                                                                       
>     x_for = self._get_trusted_comma(self.x_for, environ_get("HTTP_X_FORWARDED_FOR"))                                                                                
>   File "/usr/local/lib/python3.7/site-packages/werkzeug/middleware/proxy_fix.py", line 166, in _get_trusted_comma                                              
>     if len(values) >= trusted:                                                                                                                                           
> TypeError: '>=' not supported between instances of 'int' and 'str'        
> {code}
> This is because the variable is retrieved as string from the config, which then causes the above TypeError. It was almost fixed in https://github.com/apache/airflow/pull/6901, but forgotten.
> Since {{num_proxies}} is set last, (https://github.com/pallets/werkzeug/blob/0.16.1/src/werkzeug/middleware/proxy_fix.py#L88), if someone sets the variable, they will *always* get an exception. The only way of not getting one is to not set the variable. Also, it is nowhere documented and deprected (https://github.com/pallets/werkzeug/blob/0.16.1/src/werkzeug/middleware/proxy_fix.py#L113-L120)
> Since the configuration variable was introduces quite recently in https://github.com/apache/airflow/commit/d90ddbd and never worked, it can be safely removed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)