我在python 3.10上运行的是airflow 2.4.1版,在docker中本地运行airflow时没有问题,但是当我使用他们的容器注册表将其部署到heroku时,airflow webserver
命令失败,并显示以下引用通告:
____________ _____________
____ |__( )_________ __/__ /________ __
____ /| |_ /__ ___/_ /_ __ /_ __ \_ | /| / /
___ ___ | / _ / _ __/ _ / / /_/ /_ |/ |/ /
_/_/ |_/_/ /_/ /_/ /_/ \____/____/|__/
Running the Gunicorn Server with:
Workers: 4 sync
Host: 0.0.0.0:55811
Timeout: 120
Logfiles: - -
Access Logformat:
=================================================================
[2022-11-10 00:19:39 +0000] [43] [INFO] Starting gunicorn 20.1.0
Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.10/site-packages/gunicorn/__main__.py", line 7, in <module>
run()
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 231, in run
super().run()
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 198, in run
self.start()
File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 138, in start
self.cfg.on_starting(self)
File "/usr/local/lib/python3.10/site-packages/airflow/www/gunicorn_config.py", line 40, in on_starting
ProvidersManager().connection_form_widgets
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 908, in connection_form_widgets
self.initialize_providers_hooks()
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 300, in wrapped_function
func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 386, in initialize_providers_hooks
self.initialize_providers_list()
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 300, in wrapped_function
func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 363, in initialize_providers_list
self._discover_all_providers_from_packages()
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 429, in _discover_all_providers_from_packages
for entry_point, dist in entry_points_with_dist('apache_airflow_provider'):
File "/usr/local/lib/python3.10/site-packages/airflow/utils/entry_points.py", line 40, in entry_points_with_dist
key = canonicalize_name(dist.metadata["Name"])
File "/usr/local/lib/python3.10/site-packages/packaging/utils.py", line 34, in canonicalize_name
value = _canonicalize_regex.sub("-", name).lower()
TypeError: expected string or bytes-like object
[2022-11-10 00:21:38,935] {webserver_command.py:217} ERROR - No response from gunicorn master within 120 seconds
[2022-11-10 00:21:38,935] {webserver_command.py:218} ERROR - Shutting down webserver
以前有人遇到过这个错误吗?如果需要更多信息,请告诉我。
1条答案
按热度按时间ig9co6j11#
我刚刚解决了这个问题,在我的情况下,我有包,其中没有
METADATA
字段的NAME
。首先,您可以检查它的计数None:
之后,您需要找到导致问题的软件包,然后卸载并安装它。
我使用
vscode
调试器和justMycode: false
解决了这个问题。我正在调试下一个代码:
这里的要点是在下一个路径/
PATH/lib/PYTHON_VERSION/site-package/importlib_metadata/__init__.py
中添加一个if condition
和一个断点,例如在我的例子中:设置
if condition
和print('now')
中的断点(第598行):您可以在调试窗口中看到类似内容,
字段
_normalized_name
将指示您需要卸载的软件包名称,因为当名称为None
时,其余字段将为None
可能是
pip uninstall name_package
不起作用。我建议您在
/PATH/lib/PYTHON_VERSION/site-package
中搜索软件包,检查NAME不在METADATA
文件中或METADATA
文件不存在并删除整个软件包,最后,您可以使用pip install name-package
并检查NAME
是否在METADATA
文件中然后,您检查
METADATA
中没有NAME
的软件包数量,运行:你会看到它减少了一。