Reputation: 748
This is my systemd unit file for the airflow webserver:
#airflow-webserver.service
[Unit]
Description=Airflow webserver daemon
After=network.target postgresql.service
Wants=postgresql.service
[Service]
#EnvironmentFile=/etc/default/airflow
EnvironmentFile=/home/ubuntu/airflow/airflow.env
User=ubuntu
Group=ubuntu
Type=simple
ExecStart=/home/ubuntu/.local/bin/airflow webserver
Restart=on-failure
RestartSec=5s
PrivateTmp=true
[Install]
WantedBy=multi-user.target
When i run
$ /home/ubuntu/.local/bin/airflow webserver
from the command line the webserver starts up just fine. However when i check the status of my systemd process with
$ systemctl status airflow-webserver.service
I see this
● airflow-webserver.service - Airflow webserver daemon
Loaded: loaded (/etc/systemd/system/airflow-webserver.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2021-02-17 02:52:56 UTC; 1s ago
Process: 2010 ExecStart=/home/ubuntu/.local/bin/airflow webserver (code=exited, status=1/FAILURE)
Main PID: 2010 (code=exited, status=1/FAILURE)
This is an almost useless 'error code' because it doesn't show me what caused the failure, and I have no way of replicating it from the CLI.
Ubuntu 20.04.2 LTS
python 3.8.5
airflow 2.0.1
Upvotes: 1
Views: 883
Reputation: 2621
You can lookup the full logs with
journalctl -u airflow-webserver.service
Also note that there are issues with airflow using an EnvironmentFile on Ubuntu 18.
See https://www.ryanmerlin.com/2019/07/apache-airflow-installation-on-ubuntu-18-04-18-10/
Upvotes: 1