我在我的一个环境中使用 Anaconda 安装了 Airflow 1.10.12。
但是,当我尝试按照快速入门指南(在 https://airflow.apache.org/docs/stable/start.html 处)访问 http://localhost:8080/admin/后出现以下错误
Traceback (most recent call last):
File "/home/guilherme/anaconda3/envs/engdados/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/guilherme/anaconda3/envs/engdados/lib/python3.8/site-packages/flask/app.py", line 1953, in full_dispatch_request
return self.finalize_request(rv)
File "/home/guilherme/anaconda3/envs/engdados/lib/python3.8/site-packages/flask/app.py", line 1970, in finalize_request
response = self.process_response(response)
File "/home/guilherme/anaconda3/envs/engdados/lib/python3.8/site-packages/flask/app.py", line 2269, in process_response
self.session_interface.save_session(self, ctx.session, response)
File "/home/guilherme/anaconda3/envs/engdados/lib/python3.8/site-packages/flask/sessions.py", line 379, in save_session
response.set_cookie(
File "/home/guilherme/anaconda3/envs/engdados/lib/python3.8/site-packages/werkzeug/wrappers/base_response.py", line 468, in set_cookie
dump_cookie(
File "/home/guilherme/anaconda3/envs/engdados/lib/python3.8/site-packages/werkzeug/http.py", line 1217, in dump_cookie
raise ValueError("SameSite must be 'Strict', 'Lax', or 'None'.")
ValueError: SameSite must be 'Strict', 'Lax', or 'None'.
我试图设置 cookie_samesite
default_airflow.cfg
处的变量文件设置为 None、Lax 或 Strict,但错误仍然存在。我的 Airflow 环境的一些细节:
我使用
conda install -c anaconda airflow
在我的工作区中安装了 Apache Airflow 之后我在 Anaconda 上创建了一个环境并在这个环境中安装了 Airflow 包。然后我打开终端并运行
airflow initdb
和 airflow webserver -p 8080
.然后我去了网页,看到了错误。在此先感谢您的帮助。
最佳答案
凹凸 werkzeug
版本如下:
pip install 'werkzeug<1.0.0'
对于 Airflow >=2.0.0 更改配置 (airflow.cfg) [webserver] cookie_samesite
使用 Lax
( https://github.com/apache/airflow/blob/2.0.1/UPDATING.md#the-default-value-for-webserver-cookie_samesite-has-been-changed-to-lax )。
关于python - Airflow 网络服务器获取值错误 :Samesite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64971281/