当前位置:网站首页>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,报错解决
边栏推荐
猜你喜欢
HCIP(16)
用大白话解释“什么是ERP?” 看完这篇就全明白了
技术分享 | 接口自动化测试中如何对xml 格式做断言验证?
微信小程序(一)
VS保存后Unity不刷新
markdown语法
1 - vector R language self-study
【使用pyside2遇到的问题】This application failed to start because no Qt platform plugin could be initialized.
No-code development platform form styling steps introductory course
Jmeter二次开发实现rsa加密
随机推荐
【TypeScript】深入学习TypeScript类(下)
「X」to「Earn」:赛道现状与破局思路
Sentinel vs Hystrix 限流对比,到底怎么选?
第十章 时序与延迟
测试人生 | 阿里实习 90 天:从实习生的视角谈谈个人成长
Software testing pen questions 1 (with answers)
WAF WebShell Trojan free to kill
Based on two levels of decomposition and the length of the memory network multi-step combined forecasting model of short-term wind speed
【使用pyside2遇到的问题】This application failed to start because no Qt platform plugin could be initialized.
学习基因富集工具DAVID(3)
Word operation: adjust the English font individually
牛客每日刷题之链表
mysql根据多字段分组——group by带两个或多个参数
IDEA 重复代码的黄色波浪线取消设置
基于奇异谱分析法和长短时记忆网络组合模型的滑坡位移预测
如何通过开源数据库管理工具 DBeaver 连接 TDengine
centos7安装mysql5.7
从月薪10k到30k的必走之路:自动化测试
多租户的多种实现方案
【Unity】Unity开发进阶(六)UnityEvent使用与源码解析