当前位置:网站首页>airflow db init 报错
airflow db init 报错
2022-08-02 22:25:00 【schwert_ddd】
报错一:
[2022-08-01 11:34:38,224] {manager.py:763} WARNING - No user yet created, use flask fab command to do it.
INFO [alembic.runtime.migration] Running upgrade a13f7613ad25 -> 97cdd93827b8, Add queued_at column to dagrun table
INFO [alembic.runtime.migration] Running upgrade 97cdd93827b8 -> 092435bf5d12, Add max_active_runs column to dagmodel table
INFO [alembic.runtime.migration] Running upgrade 092435bf5d12 -> ccde3e26fe78, Add index on state, dag_id for queued dagrun
INFO [alembic.runtime.migration] Running upgrade ccde3e26fe78 -> 83f031fd9f1c, improve mssql compatibility
INFO [alembic.runtime.migration] Running upgrade 83f031fd9f1c -> e9304a3141f0, make xcom pkey columns non-nullable
INFO [alembic.runtime.migration] Running upgrade e9304a3141f0 -> 30867afad44a, Rename concurrency column in dag table to max_active_tasks
INFO [alembic.runtime.migration] Running upgrade 30867afad44a -> 54bebd308c5f, Add trigger table and task info
INFO [alembic.runtime.migration] Running upgrade 54bebd308c5f -> 142555e44c17, Add data_interval_[start|end] to DagModel and DagRun.
INFO [alembic.runtime.migration] Running upgrade 142555e44c17 -> 7b2661a43ba3, TaskInstance keyed to DagRun
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/airflow/models/crypto.py", line 86, in get_fernet
[Fernet(fernet_part.encode('utf-8')) for fernet_part in fernet_key.split(',')]
File "/usr/local/lib/python3.6/site-packages/airflow/models/crypto.py", line 86, in <listcomp>
[Fernet(fernet_part.encode('utf-8')) for fernet_part in fernet_key.split(',')]
File "/usr/local/lib64/python3.6/site-packages/cryptography/fernet.py", line 35, in __init__
"Fernet key must be 32 url-safe base64-encoded bytes."
ValueError: Fernet key must be 32 url-safe base64-encoded bytes.
报错二:
File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 112, in create_default_connections
extra='''{"account_url": "<ACCOUNT_URL>"}''',
File "<string>", line 4, in __init__
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/state.py", line 433, in _initialize_instance
manager.dispatch.init_failure(self, args, kwargs)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
with_traceback=exc_tb,
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/state.py", line 430, in _initialize_instance
return manager.original_init(*mixed[1:], **kwargs)
File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 146, in __init__
self.extra = extra
File "<string>", line 1, in __set__
File "/usr/local/lib/python3.6/site-packages/airflow/models/connection.py", line 272, in set_extra
fernet = get_fernet()
File "/usr/local/lib/python3.6/site-packages/airflow/models/crypto.py", line 90, in get_fernet
raise AirflowException(f"Could not create Fernet object: {value_error}")
airflow.exceptions.AirflowException: Could not create Fernet object: Incorrect padding
原因是airflow.cfg缺少了fernet_key没填写导致
# Secret key to save connection passwords in the db
fernet_key =
具体操作如下:
1 把airflow的数据库表清空
2 生成一个fernet_key,用于airflow db init阶段使用(确保有cryptography的包)
python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
3 填入上面生成的key,保存
fernet_key = xxxxx
4 重新运行airflow db init,报错解决
边栏推荐
猜你喜欢
随机推荐
最近公共祖先(LCA)学习笔记 | P3379 【模板】最近公共祖先(LCA)题解
WebShell 木马免杀过WAF
VMware workstation 程序启动慢
测试人生 | 阿里实习 90 天:从实习生的视角谈谈个人成长
markdown语法
反弹shell原理与实现
ROS2初级知识(9):bag记录过程数据和重放
谷粒商城-day14-商城业务与压力测试
CKA、CKAD、CKS、KCNA、CFCD考试
resubmit 渐进式防重复提交框架简介
The CTF command execution subject their thinking
GameStop NFT 市场分析
Web APIs BOM- 操作浏览器-Window对象
MYSQL查看表结构
centos7安装mysql5.7步骤(图解版)
执子手,到永恒
如何通过开源数据库管理工具 DBeaver 连接 TDengine
B站回应“HR 称核心用户都是 Loser”:该面试官去年底已被劝退,会吸取教训加强管理
MySQL 用id分库使用name查询
PHP实现登录失败三次需要输入验证码需求