当前位置:网站首页>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,报错解决
边栏推荐
- 图像识别从零写出dnf脚本关键要点
- JS Date 时间戳 getTune data.parse 倒计时小程序
- Token、Redis实现单点登录
- CWE4.8:2022年危害最大的25种软件安全问题
- Matplotlib drawing core principles explain (more detailed)
- Teach you how to kill if else
- Technology Sharing | How to do assertion verification for xml format in interface automation testing?
- Mysql查看慢查询日志
- 【Unity】Unity开发进阶(七)双刃剑:扩展方法
- 若依集成minio实现分布式文件存储
猜你喜欢

You and I will meet the needs of: how to export the data in a MySQL simple ~!Practical!

工业元宇宙的价值和发展

centos7安装mysql5.7步骤(图解版)

No-code development platform form styling steps introductory course

Shunted Self-Attention via Multi-Scale Token Aggregation

反弹shell原理与实现

vscode 自定义快捷键——设置eslint

VS保存后Unity不刷新

MySQL 与InnoDB 下的锁做朋友 (四)行锁/记录锁

第十章 时序与延迟
随机推荐
You and I will meet the needs of: how to export the data in a MySQL simple ~!Practical!
MySQL删除数据后,释放磁盘空间
IDEA 重复代码的黄色波浪线取消设置
Technology Sharing | How to do assertion verification for xml format in interface automation testing?
MySQL 用id分库使用name查询
【TypeScript】深入学习TypeScript类(下)
谷粒商城-day13-es和商品上架
虚拟内存 virualmemory
B站回应HR称用户是Loser:涉事面试官去年底已被劝退
Web APIs BOM- 操作浏览器-Window对象
【斯坦福计网CS144项目】Lab5: NetworkInterface
JS Date 时间戳 getTune data.parse 倒计时小程序
Week 7 CNN Architectures - LeNet-5、AlexNet、VGGNet、GoogLeNet、ResNet
Unity WallFxPack使用
工业元宇宙的价值和发展
RuoYi-App Startup Tutorial
How many ways do you know the singleton pattern?
【C语言】带头双向循环链表(list)详解(定义、增、删、查、改)
Rebound shell principle and implementation
Yocto系列讲解[实战篇]85 - 制作ubi镜像和自动挂载ubifs文件系统