Reputation: 379
I've installed Apache Airflow version 2.2.4 on my system Ubuntu 20.0.4 LTS and I'm using these steps
When I'm running my server using this command
I've got an error saying
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: session
How can I solve this error?
Upvotes: 3
Views: 7543
Reputation: 11
I had the same error message. I made the mistake and naively installed airflow through pip.
I fixed the issue by deleting the directory AIRFLOW_HOME points to and reinstalling airflow through pip with a constraint. Then I initiated the automated airflow setup with the airflow standalone
command.
Upvotes: 0
Reputation: 7952
For me the issue was that I have set the AIRFLOW_HOME
on one tab of my terminal, but on the other tab (from where I was running the webserver) I forgot to set it. So the solution is to do the following in ALL TERMINAL TABS that you're using for Airflow:
Activate the virtual environment where your Airflow is installed
source your_airflow_venv/bin/activate
Navigate to the directory where your Airflow project is
cd /path_to_your_airflow_dir
Update your AIRFLOW_HOME
environment variable
export AIRFLOW_HOME=$(pwd)
Initialize the Airflow database
airflow db init
Start the Airflow Web Server or the Airflow Scheduler (depending on which terminal tab you currently are)
airflow scheduler
airflow webserver
Upvotes: 4
Reputation: 21
Before running webserver using command airflow webserver
, make sure to set AIRFLOW_HOME using below command:
export AIRFLOW_HOME="your_airflow_directory"
Upvotes: 0