Quite straightforward: as your log suggested, the user you use to run Airflow doesn’t have write permission to the path/file you specified.
Simply updating the folder/file permission should fix. XD On Wed, Nov 21, 2018 at 06:16 rajasimmangan...@gmail.com < rajasimmangan...@gmail.com> wrote: > Hi, > > When I run the python program on the terminal , the script creates the new > files and writes on it but when I run it through the Airflow, it throws an > error. Don't know how to resolve it. > Any pointers would be helpful. > > > #### Error > > 11-21 16:06:14,071] {bash_operator.py:94} INFO - PermissionError: [Errno > 13] Permission denied: '/usr/share/airflow/documents/output/sales.csv' > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: > [2018-11-21 16:06:14,179] {bash_operator.py:97} INFO - Command exited with > return code 1 > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: > [2018-11-21 16:06:14,180] {models.py:1417} ERROR - Bash command failed > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: > Traceback (most recent call last): > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: File > "/usr/local/lib/python3.6/dist-packages/airflow/models.py", line 1374, in > run > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: > result = task_copy.execute(context=context) > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: File > "/usr/local/lib/python3.6/dist-packages/airflow/operators/bash_operator.py", > line 100, in execute > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: > raise AirflowException("Bash command failed") > [2018-11-21 16:06:14,184] {base_task_runner.py:95} INFO - Subtask: > airflow.exceptions.AirflowException: Bash command failed > > #### > > Thanks in advance! > Raj >