I am trying to install apache airflow using wsl on windows 10.
I am following this tutorial: https://towardsdatascience.com/run-apache-airflow-on-windows-10-without-docker-3c5754bb98b4
I was able to run: airflow db init and airflow scheduler, without any errors.
Upon running airflow webserver, I encountered following error:
File "/home/glinty/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: job
[SQL: SELECT job.id AS job_id, job.dag_id AS job_dag_id, job.state AS job_state, job.job_type AS job_job_type, job.start_date AS job_start_date, job.end_date AS job_end_date, job.latest_heartbeat AS job_latest_heartbeat, job.executor_class AS job_executor_class, job.hostname AS job_hostname, job.unixname AS job_unixname
FROM job
WHERE job.id = ? AND job.job_type IN (?)]
[parameters: (2, 'SchedulerJob')]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
How to overcome this error.
CodePudding user response:
The error itself is no such table: job
so the database migrations must not have been run. The article referenced uses an older version of Airflow with a command (airflow initdb
) that no longer works. Use airflow db init
instead.
CodePudding user response:
I found the solution to my problem(not sure what resolved this), in my case:
1) I changed the wsl version from 1 to 2. (Restarted pc after this)
2) enabled virtualization windows feature(Restarted pc after this)
3) created an account using this command:
airflow users create --username admin --password admin --firstname --lastname --role Admin --email [email protected]
4) delete ALL files in AIRFLOW_HOME directory and run airlow db init.
Then, ran airflow webserver command.