Docker-airflow: Help - Can make it work - error: no such table: log

Created on 10 Sep 2018  路  7Comments  路  Source: puckel/docker-airflow

Hi,

i'm new to this. I run the following:
docker pull puckel/docker-airflow
docker run -d -p 8080:8080 puckel/docker-airflow webserver
docker run --rm -ti puckel/docker-airflow airflow list_dags
and the last command gives:

[2018-09-10 20:34:09,355] {__init__.py:51} INFO - Using executor SequentialExecutor
[2018-09-10 20:34:09,438] {cli_action_loggers.py:69} ERROR - Failed on pre-execution callback using
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: log

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/airflow/utils/cli_action_loggers.py", line 67, in on_pre_execution
cb(**kwargs)
File "/usr/local/lib/python3.6/site-packages/airflow/utils/cli_action_loggers.py", line 99, in default_action_log
session.commit()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 927, in commit
self.transaction.commit()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 467, in commit
self._prepare_impl()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 447, in _prepare_impl
self.session.flush()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2209, in flush
self._flush(objects)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2329, in _flush
transaction.rollback(_capture_exception=True)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2293, in _flush
flush_context.execute()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute
rec.execute(self)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute
uow
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 181, in save_obj
mapper, table, insert)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 835, in _emit_insert_statements
execute(statement, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 945, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: log [SQL: 'INSERT INTO log (dttm, dag_id, task_id, event, execution_date, owner, extra) VALUES (?, ?, ?, ?, ?, ?, ?)'] [parameters: ('2018-09-10 20:34:09.435507', None, None, 'cli_list_dags', None, 'root', '{"host_name": "79655fe5c7c3", "full_command": "[\'/usr/local/bin/airflow\', \'list_dags\']"}')]
[2018-09-10 20:34:09,441] {models.py:258} INFO - Filling up the DagBag from /root/airflow/dags


DAGS

Most helpful comment

Never mind.
need to run airflow initdb

All 7 comments

Never mind.
need to run airflow initdb

* @kifjj *, where do I run this command? I assume you mean to docker exec -it into bash shell of scheduler container and then run this command. Doing that gave me stacktrace(s) ending in KeyError: 'Variable <variable-name> does not exist' even though I've created those Variable(s) from _webui_

i have successfully up and run for about month, one day this same error message shows up. i still got same error after ran airflow initdb...

can someone please explain where to run airflow initdb? I'm using kube-airflow.

@imsrgadich try to run airflow initdb in the dir where you have airflow.cfg.

I encounter this error when I'm trying to get list of dags. Even though my dags are up and running in the web UI I get this error when I list_dag in terminal. I initdb in the directory that my dags are but still no result

I have a similar error, even though my backend is not sqlite on a working Airflow 1.10.10 instance.
Upon executing airflow trigger_dag ...:

Traceback (most recent call last):
File "/opt/miniconda3/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
cursor, statement, parameters, context
File "/opt/miniconda3/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 590, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: dag

The above exception was the direct cause of the following exception:
....

Need to find a way to pass the config for my db to the command.

Was this page helpful?
0 / 5 - 0 ratings