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

David Palmer commented on AIRFLOW-6754:
---------------------------------------

Hi [~ksk2k], [~jmcigna] and [~bharath3745],

In case you are still encountering this issue, this occurs because the 
Kubernetes worker pod runs as user 50000 by default. In our case we create a 
custom Airflow image with a user airflow with id 1000. This means the worker 
gets permission denied while trying to write to a directory owned by user 1000.

The fix is to specify _run_as_user_ in the Kubernetes executor config (in our 
case, to 1000 but you should pick whatever user has permission for that dir). 
Despite the documentation saying the _run_as_user_ config is a string, you have 
to specify the UID rather than the username for some reason, no idea why this 
is the case. Debugging is made extra hard if you have delete_worker_pods 
enabled too, because the pods get deleted before there is time to check why 
they didn't start. 

Hope that helps future bug hunters!

> 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)

Reply via email to