Soeren Laursen created AIRFLOW-1947:
---------------------------------------

             Summary: /tmp airflow json file get wrong permissions
                 Key: AIRFLOW-1947
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1947
             Project: Apache Airflow
          Issue Type: Bug
          Components: DagRun
    Affects Versions: Airflow 1.8
         Environment: ubuntu 16.04 LTS
            Reporter: Soeren Laursen
            Priority: Critical


We are using run_as_user on two specific task, to make sure that the resulting 
files are assigned to the correct user.

If we are running the task as the Airflow user the task get done as expected.

When we run the tast with a user called prod by using the run_as_user, the 
file(s) are generated In the /tmp
-rw-------  1 airflow airflow 2205 dec 19 11:46 tmpicu87_au

But the prod user cannot read the file. From the log file we have:
[2017-12-19 11:46:31,803] {base_task_runner.py:112} INFO - Running: ['bash', 
'-c', 'sudo -H -u prod airflow run Archive_Sentinel-1_data_from_FCOO_ftp_server 
Archive_yesterdays_data 2017-12-19T00:00:00 --job_id 1047 --raw -sd 
DAGS_FOLDER/archive-Sentinel-1-data-from-ftp-server.py --cfg_path 
/tmp/tmpicu87_au']
[2017-12-19 11:46:32,463] {base_task_runner.py:95} INFO - Subtask: [2017-12-19 
11:46:32,462] {__init__.py:57} INFO - Using executor SequentialExecutor
[2017-12-19 11:46:32,587] {base_task_runner.py:95} INFO - Subtask: [2017-12-19 
11:46:32,587] {driver.py:120} INFO - Generating grammar tables from 
/usr/lib/python3.5/lib2to3/Grammar.txt
[2017-12-19 11:46:32,630] {base_task_runner.py:95} INFO - Subtask: [2017-12-19 
11:46:32,630] {driver.py:120} INFO - Generating grammar tables from 
/usr/lib/python3.5/lib2to3/PatternGrammar.txt
[2017-12-19 11:46:33,124] {base_task_runner.py:95} INFO - Subtask: 
/usr/local/lib/python3.5/dist-packages/airflow/www/app.py:23: 
FlaskWTFDeprecationWarning: "flask_wtf.CsrfProtect" has been renamed to 
"CSRFProtect" and will be removed in 1.0.
[2017-12-19 11:46:33,124] {base_task_runner.py:95} INFO - Subtask:   csrf = 
CsrfProtect()
[2017-12-19 11:46:33,344] {base_task_runner.py:95} INFO - Subtask: Traceback 
(most recent call last):
[2017-12-19 11:46:33,344] {base_task_runner.py:95} INFO - Subtask:   File 
"/usr/local/bin/airflow", line 28, in <module>
[2017-12-19 11:46:33,344] {base_task_runner.py:95} INFO - Subtask:     
args.func(args)
[2017-12-19 11:46:33,344] {base_task_runner.py:95} INFO - Subtask:   File 
"/usr/local/lib/python3.5/dist-packages/airflow/bin/cli.py", line 329, in run
[2017-12-19 11:46:33,344] {base_task_runner.py:95} INFO - Subtask:     with 
open(args.cfg_path, 'r') as conf_file:
[2017-12-19 11:46:33,344] {base_task_runner.py:95} INFO - Subtask: 
PermissionError: [Errno 13] Permission denied: '/tmp/tmpicu87_au'
[2017-12-19 11:46:36,770] {jobs.py:2125} INFO - Task exited with return code 1








--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to