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

Noël BARDELOT commented on AIRFLOW-6865:
----------------------------------------

First thing, with import flask being the declaration of flask (with lowercase f 
as in the error log), it seems to mean that the whole flask module is not 
available at the time the before_request annotated method is called.

Second thing, I don't understand why I see packge 
/usr/local/lib/python3.7/site-packages/airflow/www_rbac/app.py being used while 
I'd expect www/app.py -> probably some Python magic here...

> [Airflow] webserver crashes with both RBAC and 'force_log_out_after' set
> ------------------------------------------------------------------------
>
>                 Key: AIRFLOW-6865
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6865
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: webserver
>    Affects Versions: 1.10.9
>            Reporter: Noël BARDELOT
>            Priority: Major
>
> To reproduce:
> * activate authentication (AIRFLOW__WEBSERVER__AUTHENTICATE = True)
> * activate RBAC (AIRFLOW__WEBSERVER__RBAC = True)
> * set AIRFLOW__WEBSERVER__FORCE_LOG_OUT_AFTER to something different than the 
> default 0 (example: 5 minutes)
> I've traced back the issue to the following commit:
> [https://github.com/apache/airflow/commit/0721d62bf1b23a471d7fe97ccf108db9f92403ef]
> {code}
> [2020-02-20 16:43:54,426] {{app.py:1891}} ERROR - Exception on /health [GET]
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in 
> wsgi_app
>     response = self.full_dispatch_request()
>   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in 
> full_dispatch_request
>     rv = self.handle_user_exception(e)
>   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in 
> handle_user_exception
>     reraise(exc_type, exc_value, tb)
>   File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in 
> reraise
>     raise value
>   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1947, in 
> full_dispatch_request
>     rv = self.preprocess_request()
>   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2241, in 
> preprocess_request
>     rv = func()
>   File "/usr/local/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 
> 246, in before_request
>     flask.session.permanent = True
> NameError: name 'flask' is not defined
> {code}
>  



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

Reply via email to