Apache气流在运行气流Web服务器作为守护程序时的错误
我正在Oracle Linux计算机上运行Apache AirFlow 2.3.0,当我在2个不同的终端上运行命令时(命令 AirFlow Scheduler
和 airflow Weberver
),一切正常。但是,当我尝试以守护程序运行服务(命令 airflow Scheduler -d
和 airflow Weberver -d
)时,只有调度程序命令。 WebServer命令生成以下错误。
我配置了气流(因此 weberver_conf.py
文件)通过OAuth身份验证,添加了我自己的提供商,并扩展了 airflowsecuritymanager
class,所以它可以验证新提供商。正如我之前提到的,如果我运行服务通常一切正常(甚至可以登录到应用程序的身份验证)。我配置了 weberver_conf.py
apache documentation ,这是我对 weberver_conf.py
file的配置。
from airflow.www.security import AirflowSecurityManager
class BaseSecurityManagerTQ(AirflowSecurityManager):
def get_oauth_user_info(self, provider, resp):
if provider == "TQ":
me = self.appbuilder.sm.oauth_remotes[provider].get('/connect/userinfo')
data = me.json()
ans = {
"username": "tq_" + data.get('name', ""),
"email": data.get("email", ""),
}
return ans
else:
return {}
FAB_SECURITY_MANAGER_CLASS = "webserver_config.BaseSecurityManagerTQ"
我尝试使用 ementlib
库导入新的安全模块,但它不起作用。我还尝试了这些解决方案 1 , 2 ,而且它们也没有起作用。
关于如何解决问题的任何建议?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经设法解决了。我必须添加文件夹其中
weberver_config.py
文件位于python_path。另外,添加__ INIT __。py
文件以能够导入模块。I already managed to solve.I had to add the folder where
webserver_config.py
file is located to the PYTHON_PATH. Also, add a__init__.py
file to be able to import the module.