Airflow Bashoperator Can't Find Bash
I'm using Airflow in Centos 7, using Python 3.7. When I run a Bash command through BashOperator, I run in to the following problem: [2019-11-13 23:20:08,238] {taskinstance.py:1058}
Solution 1:
It turns out I had to modify PATH variable in my systemctl file.
Adding :/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin
to PATH
fixed my problem.
My setup is using Airflow + virtualenv managed through Systemctl on Centos 7.
Airflow scheduler systemctl file
[Unit]Description=Airflow scheduler daemon
After=network.target postgresql.service mysql.service redis.service rabbitmq-server.service
Wants=postgresql.service mysql.service redis.service rabbitmq-server.service
[Service]EnvironmentFile=/etc/sysconfig/airflow
Environment=VIRTUAL_ENV=/home/airflow/virtualenvs/airflow_env
Environment=PATH=/home/airflow/virtualenvs/airflow_env/bin:$PATH:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin
User=airflow
Group=airflow
Type=simple
ExecStart=/home/airflow/virtualenvs/airflow_env/bin/airflow scheduler
Restart=always
RestartSec=5s
RuntimeDirectory=airflow
RuntimeDirectoryMode=0775[Install]WantedBy=multi-user.target
Post a Comment for "Airflow Bashoperator Can't Find Bash"