While airflow initdb, AttributeError: module' object has no attribute 'client_auth'

While airflow initdb, AttributeError: module' object has no attribute 'client_auth'

我最近安装了 apache airflow 1.8.1,我执行了以下命令:

airflow initdb

返回以下错误:

Traceback (most recent call last):
  File "/usr/bin/airflow", line 18, in <module>
    from airflow.bin.cli import CLIFactory
  File "/usr/lib/python2.7/dist-packages/airflow/bin/cli.py", line 65, in <module>
    auth=api.api_auth.client_auth)
AttributeError: 'module' object has no attribute 'client_auth'

我尝试了几种解决方案,但都不起作用。

我在 airflow 1.8.1 和 python 2.7.11 上遇到了同样的错误。

我已禁用网络服务器身份验证(暂时)并切换到 auth_backend 的默认值。 (解决了问题)

我的airflow.cfg最终配置如下

auth_backend = airflow.api.auth.backend.default

验证=假

我发现我们做错了什么。字段 auth_backend=airflow.contrib.auth.backends.password_auth 需要在 webserver 下,而不是在 api 下。如果它不存在,请添加它。 auth_backend 有多个字段,因为有 authenticate 等。