【问题标题】:Airflow Fail To Initialize DB气流无法初始化数据库
【发布时间】:2019-08-08 22:37:45
【问题描述】:

已安装 apache 气流并使用 mysql db 进行配置,没有任何错误。 问题是当我airflow initdbairflow resetdb 抛出以下错误/异常

sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1292, "Incorrect datetime value: '2019-03-18 13:44:21.317153+00:00' for column 'last_scheduler_run' at row 1") [SQL: u'INSERT INTO dag (dag_id, is_paused, is_subdag, is_active, last_scheduler_run, last_pickled, last_expired, scheduler_lock, pickle_id, fileloc, owners) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'] [parameters: ('example_skip_dag', 1, 0, 1, datetime.datetime(2019, 3, 18, 13, 44, 21, 317153, tzinfo=<Timezone [UTC]>), None, None, None, None, '/usr/local/lib/python2.7/dist-packages/airflow/example_dags/example_skip_dag.py', u'airflow')] (Background on this error at: http://sqlalche.me/e/e3q8)

我怎样才能成功运行 apache airflow 1.10.2

【问题讨论】:

标签: python-2.7 airflow ubuntu-18.04


【解决方案1】:

只是为未来的用户回顾一下:

停止服务:

systemctl stop mysql

获取当前状态:

mysql> select @@sql_mode;

在配置中添加不带“STRICT_TRANS_TABLES”的语句:

sudo nano /etc/mysql/my.cnf

在[mysqld]下:

sql_mode="paste "select @@sql_mode;" output **without** STRICT_TRANS_TABLES"

然后再次启动服务:

systemctl start mysql

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 2017-05-11
    • 1970-01-01
    相关资源
    最近更新 更多