You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Berislav Lopac (JIRA)" <ji...@apache.org> on 2018/03/12 16:56:00 UTC

[jira] [Created] (AIRFLOW-2209) AttributeError: module 'airflow.contrib.auth.backends.password_auth' has no attribute 'login_required'

Berislav Lopac created AIRFLOW-2209:
---------------------------------------

             Summary: AttributeError: module 'airflow.contrib.auth.backends.password_auth' has no attribute 'login_required'
                 Key: AIRFLOW-2209
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2209
             Project: Apache Airflow
          Issue Type: Bug
          Components: authentication
            Reporter: Berislav Lopac


After updating to the latest {{master}}, the following error shows the error in the title in {{airflow-webserver}} logs. Apparently, ~AIRFLOW-1760 has removed `login_required` from the `password_auth` module, so the webserver fails.

h3. Steps to repeat:

1. Set in configuration

{code}
authenticate = True
auth_backend = airflow.contrib.auth.backends.password_auth
{code}

2. Run:

{code}AIRFLOW_HOME=/path/to/config airflow webserver{code}

The webserver fails with the error message:

{code:python}
Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/opt/airflow/src/apache-airflow/airflow/bin/airflow", line 27, in <module>
    args.func(args)
  File "/opt/airflow/src/apache-airflow/airflow/bin/cli.py", line 697, in webserver
    app = cached_app(conf)
  File "/opt/airflow/src/apache-airflow/airflow/www/app.py", line 177, in cached_app
    app = create_app(config, testing)
  File "/opt/airflow/src/apache-airflow/airflow/www/app.py", line 63, in create_app
    from airflow.www import views
  File "/opt/airflow/src/apache-airflow/airflow/www/views.py", line 98, in <module>
    login_required = airflow.login.login_required
AttributeError: module 'airflow.contrib.auth.backends.password_auth' has no attribute 'login_required'
{code}

h3. Proposed solution

Restore import of `login_required` in `airflow.contrib.auth.backends.password_auth`.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)