3

我正在将气流从 1.10.5 更新到 1.10.10。使用 google OAuth 时,我在网络服务器中收到以下错误

Traceback (most recent call last):
  File "/home/airflow/.local/bin/airflow", line 37, in <module>
    args.func(args)
  File "/home/airflow/.local/lib/python3.7/site-packages/airflow/utils/cli.py", line 75, in wrapper
    return f(*args, **kwargs)
  File "/home/airflow/.local/lib/python3.7/site-packages/airflow/bin/cli.py", line 900, in webserver
    app = cached_app_rbac(None) if settings.RBAC else cached_app(None)
  File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 295, in cached_app
    app, _ = create_app(config, session, testing)
  File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 108, in create_app
    update_perms=conf.getboolean('webserver', 'UPDATE_FAB_PERMS'))
  File "/home/airflow/.local/lib/python3.7/site-packages/flask_appbuilder/base.py", line 148, in __init__
    self.init_app(app, session)
  File "/home/airflow/.local/lib/python3.7/site-packages/flask_appbuilder/base.py", line 202, in init_app
    self.sm = self.security_manager_class(self)
  File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www_rbac/security.py", line 177, in __init__
    super(AirflowSecurityManager, self).__init__(appbuilder)
  File "/home/airflow/.local/lib/python3.7/site-packages/flask_appbuilder/security/sqla/manager.py", line 51, in __init__
    super(SecurityManager, self).__init__(appbuilder)
  File "/home/airflow/.local/lib/python3.7/site-packages/flask_appbuilder/security/manager.py", line 249, in __init__
    from flask_oauthlib.client import OAuth
  File "/home/airflow/.local/lib/python3.7/site-packages/flask_oauthlib/client.py", line 20, in <module>
    from .utils import to_bytes
  File "/home/airflow/.local/lib/python3.7/site-packages/flask_oauthlib/utils.py", line 5, in <module>
    from oauthlib.common import to_unicode, bytes_type
ImportError: cannot import name 'bytes_type' from 'oauthlib.common' (/home/airflow/.local/lib/python3.7/site-packages/oauthlib/common.py)

此错误是由于依赖项不匹配造成的。Airflow 1.10.10正在安装oauthlib==3.1.0andFlask-OAuthlib==0.9.53.1.0 version of oauthlib,没有 bytes_type 而 Flash-OAuthlib 期望它存在。

考虑到lepture已归档flask-oauthlib并创建了authlib,我在lepture 的airflow 中看到了有关此更改的PR https://github.com/apache/airflow/pull/6140/files但它没有被合并并被标记为陈旧机器人

有人在 Airflow 1.10.10 中遇到过这个问题吗?我已经通过更改inrequirement.txtoauthlib version to 2.1.0解决了这个问题

4

1 回答 1

0

我们遇到了同样的问题,并通过强制将 flask_oauthlib 升级到 0.9.6 来临时修复它:(当我们等待气流修复它的依赖项时)

pip install flask_oauthlib==0.9.6

于 2021-03-18T14:20:10.353 回答