运行 mac 上的气流调度程序时出现 sqlite 错误
sqllite error when running airflow scheduler on mac
当 运行 气流时,我一直收到以下错误?有任何想法吗?一旦我启动气流调度程序,就会发生这种情况。它以前可以工作,但当我更新 mac.
时似乎已停止
Traceback (most recent call last):
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
cursor, statement, parameters, context
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: job
然后是下面的回溯
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/user1/.pyenv/versions/3.6.10/bin/airflow", line 37, in <module>
args.func(args)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/airflow/utils/cli.py", line 76, in wrapper
return f(*args, **kwargs)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/airflow/bin/cli.py", line 1221, in scheduler
job.run()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/airflow/jobs/base_job.py", line 212, in run
session.commit()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1036, in commit
self.transaction.commit()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 503, in commit
self._prepare_impl()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 482, in _prepare_impl
self.session.flush()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2496, in flush
self._flush(objects)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2637, in _flush
transaction.rollback(_capture_exception=True)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2597, in _flush
flush_context.execute()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
rec.execute(self)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
uow,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
insert,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1136, in _emit_insert_statements
statement, params
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 984, in execute
return meth(self, multiparams, params)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 293, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1103, in _execute_clauseelement
distilled_params,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1288, in _execute_context
e, statement, parameters, cursor, context
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1482, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
cursor, statement, parameters, context
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: job
[SQL: INSERT INTO job (dag_id, state, job_type, start_date, end_date, latest_heartbeat, executor_class, hostname, unixname) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: (None, 'running', 'SchedulerJob', '2020-12-10 23:11:18.838822', None, '2020-12-10 23:11:18.838839', 'SequentialExecutor', 'ip-192-168-0-53.us-west-2.compute.internal', 'user1')]
(Background on this error at: http://sqlalche.me/e/e3q8)
我已尝试降级到旧版本的 sqlalchemy,但问题仍然存在。我目前使用的版本:1.3.15
试试这个:
$气流初始化数据库
同时检查是否设置了 Airflow Home。
如果 initdb 不工作:
尝试使用 airflow resetdb,但在此之前,如果您有任何数据,请从 Airflow 主目录备份您的 DAGS 文件夹。
当 运行 气流时,我一直收到以下错误?有任何想法吗?一旦我启动气流调度程序,就会发生这种情况。它以前可以工作,但当我更新 mac.
时似乎已停止Traceback (most recent call last):
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
cursor, statement, parameters, context
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: job
然后是下面的回溯
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/user1/.pyenv/versions/3.6.10/bin/airflow", line 37, in <module>
args.func(args)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/airflow/utils/cli.py", line 76, in wrapper
return f(*args, **kwargs)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/airflow/bin/cli.py", line 1221, in scheduler
job.run()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/airflow/jobs/base_job.py", line 212, in run
session.commit()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1036, in commit
self.transaction.commit()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 503, in commit
self._prepare_impl()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 482, in _prepare_impl
self.session.flush()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2496, in flush
self._flush(objects)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2637, in _flush
transaction.rollback(_capture_exception=True)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2597, in _flush
flush_context.execute()
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
rec.execute(self)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
uow,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
insert,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1136, in _emit_insert_statements
statement, params
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 984, in execute
return meth(self, multiparams, params)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 293, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1103, in _execute_clauseelement
distilled_params,
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1288, in _execute_context
e, statement, parameters, cursor, context
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1482, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
cursor, statement, parameters, context
File "/Users/user1/.pyenv/versions/3.6.10/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 588, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: job
[SQL: INSERT INTO job (dag_id, state, job_type, start_date, end_date, latest_heartbeat, executor_class, hostname, unixname) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: (None, 'running', 'SchedulerJob', '2020-12-10 23:11:18.838822', None, '2020-12-10 23:11:18.838839', 'SequentialExecutor', 'ip-192-168-0-53.us-west-2.compute.internal', 'user1')]
(Background on this error at: http://sqlalche.me/e/e3q8)
我已尝试降级到旧版本的 sqlalchemy,但问题仍然存在。我目前使用的版本:1.3.15
试试这个: $气流初始化数据库
同时检查是否设置了 Airflow Home。 如果 initdb 不工作: 尝试使用 airflow resetdb,但在此之前,如果您有任何数据,请从 Airflow 主目录备份您的 DAGS 文件夹。