You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Julian Montgomery (Jira)" <ji...@apache.org> on 2020/03/30 16:11:00 UTC

[jira] [Comment Edited] (AIRFLOW-6754) PermissionError: [Errno 13] Permission denied: '/tmp/airflow/unittests.cfg'

    [ https://issues.apache.org/jira/browse/AIRFLOW-6754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17071096#comment-17071096 ] 

Julian Montgomery edited comment on AIRFLOW-6754 at 3/30/20, 4:10 PM:
----------------------------------------------------------------------

I am also encountering this same exact issue. My scenario is I am using the KubernetesExecutor on Openshift. When I trigger a DAG I can see a Pod gets created and a container runs on that dynamically created Pod. However, it fails fairly quickly with this error:

—

Traceback (most recent call last):
 File "/usr/local/bin/airflow", line 25, in <module>
 from airflow.configuration import conf
 File "/usr/local/lib/python3.7/site-packages/airflow/__init__.py", line 31, in <module>
 from airflow.utils.log.logging_mixin import LoggingMixin
 File "/usr/local/lib/python3.7/site-packages/airflow/utils/__init__.py", line 24, in <module>
 from .decorators import apply_defaults as _apply_defaults
 File "/usr/local/lib/python3.7/site-packages/airflow/utils/decorators.py", line 36, in <module>
 from airflow import settings
 File "/usr/local/lib/python3.7/site-packages/airflow/settings.py", line 37, in <module>
 from airflow.configuration import conf, AIRFLOW_HOME, WEBSERVER_CONFIG # NOQA F401
 File "/usr/local/lib/python3.7/site-packages/airflow/configuration.py", line 603, in <module>
 with open(TEST_CONFIG_FILE, 'w') as f:
 PermissionError: [Errno 13] Permission denied: '/usr/local/airflow/unittests.cfg'

—

The pod that gets created is configured with the following volume mounts:

{{airflow-dags → /usr/local/airflow/dags}}

{{airflow-logs → /usr/local/airflow/logs}}

 

The file /usr/local/airflow/unittests.cfg is actually there and has permissions that would allow it to be read. I'm suspecting what is happening is configuration.py executes the following line of code:

{{if not os.path.isfile(TEST_CONFIG_FILE)}}

Because it can't see the file it returns true so then it attempts to execute this line of code:

{{with open(TEST_CONFIG_FILE, 'w') as file:}}

And then that fails with a Permission Denied error. At this point I'm stuck. If there is a solution I am overlooking please let me know, otherwise it would be great if there could be a code fix for this issue.


was (Author: jmcigna):
I am also encountering this same exact. My scenario is I am using the KubernetesExecutor on Openshift. When I trigger a DAG I can see a Pod gets created and a container runs on that dynamically created Pod. However, it fails fairly quickly with this error:

---

Traceback (most recent call last):
 File "/usr/local/bin/airflow", line 25, in <module>
 from airflow.configuration import conf
 File "/usr/local/lib/python3.7/site-packages/airflow/__init__.py", line 31, in <module>
 from airflow.utils.log.logging_mixin import LoggingMixin
 File "/usr/local/lib/python3.7/site-packages/airflow/utils/__init__.py", line 24, in <module>
 from .decorators import apply_defaults as _apply_defaults
 File "/usr/local/lib/python3.7/site-packages/airflow/utils/decorators.py", line 36, in <module>
 from airflow import settings
 File "/usr/local/lib/python3.7/site-packages/airflow/settings.py", line 37, in <module>
 from airflow.configuration import conf, AIRFLOW_HOME, WEBSERVER_CONFIG # NOQA F401
 File "/usr/local/lib/python3.7/site-packages/airflow/configuration.py", line 603, in <module>
 with open(TEST_CONFIG_FILE, 'w') as f:
PermissionError: [Errno 13] Permission denied: '/usr/local/airflow/unittests.cfg'

---

The pod that gets created is configured with the following volume mounts:

{{airflow-dags → /usr/local/airflow/dags}}

{{airflow-logs → /usr/local/airflow/logs}}

 

The file /usr/local/airflow/unittests.cfg is actually there and has permissions that would allow it to be read. I'm suspecting what is happening is configuration.py executes the following line of code:

{{if not os.path.isfile(TEST_CONFIG_FILE)}}

Because it can't see the file it returns true so then it attempts to execute this line of code:

{{with open(TEST_CONFIG_FILE, 'w') as file:}}

And then that fails with a Permission Denied error. At this point I'm stuck. If there is a solution I am overlooking please let me know, otherwise it would be great if there could be a code fix for this issue.

> PermissionError: [Errno 13] Permission denied: '/tmp/airflow/unittests.cfg'
> ---------------------------------------------------------------------------
>
>                 Key: AIRFLOW-6754
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6754
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: build
>    Affects Versions: 1.10.7
>            Reporter: Karthick
>            Priority: Major
>
> I am trying to build the apache-airflow in our kubernetes platform and its always throws the below error , do you know how to fix this issue.
>  
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
> ImportError: No module named cryptography.fernet
> Traceback (most recent call last):
>  File "/usr/local/bin/airflow", line 25, in <module>
>  from airflow.configuration import conf
>  File "/usr/local/lib/python3.5/dist-packages/airflow/__init__.py", line 31, in <module>
>  from airflow.utils.log.logging_mixin import LoggingMixin
>  File "/usr/local/lib/python3.5/dist-packages/airflow/utils/__init__.py", line 24, in <module>
>  from .decorators import apply_defaults as _apply_defaults
>  File "/usr/local/lib/python3.5/dist-packages/airflow/utils/decorators.py", line 36, in <module>
>  from airflow import settings
>  File "/usr/local/lib/python3.5/dist-packages/airflow/settings.py", line 37, in <module>
>  from airflow.configuration import conf, AIRFLOW_HOME, WEBSERVER_CONFIG # NOQA F401
>  File "/usr/local/lib/python3.5/dist-packages/airflow/configuration.py", line 603, in <module>
>  with open(TEST_CONFIG_FILE, 'w') as f:
> PermissionError: [Errno 13] Permission denied: '/tmp/airflow/unittests.cfg'
> Traceback (most recent call last):
>  File "/usr/local/bin/airflow", line 25, in <module>
>  from airflow.configuration import conf
>  File "/usr/local/lib/python3.5/dist-packages/airflow/__init__.py", line 31, in <module>
>  from airflow.utils.log.logging_mixin import LoggingMixin
>  File "/usr/local/lib/python3.5/dist-packages/airflow/utils/__init__.py", line 24, in <module>
>  from .decorators import apply_defaults as _apply_defaults
>  File "/usr/local/lib/python3.5/dist-packages/airflow/utils/decorators.py", line 36, in <module>
>  from airflow import settings
>  File "/usr/local/lib/python3.5/dist-packages/airflow/settings.py", line 37, in <module>
>  from airflow.configuration import conf, AIRFLOW_HOME, WEBSERVER_CONFIG # NOQA F401
>  File "/usr/local/lib/python3.5/dist-packages/airflow/configuration.py", line 603, in <module>
>  with open(TEST_CONFIG_FILE, 'w') as f:



--
This message was sent by Atlassian Jira
(v8.3.4#803005)