aneesh-joseph commented on pull request #9371:
URL: https://github.com/apache/airflow/pull/9371#issuecomment-659411990


   > I got an issue yesterday with git-sync and the K8s worker pods.
   > If we specify:
   > AIRFLOW__KUBERNETES__RUN_AS_USER="50000" in values, git-sync ends up with 
the following error in K8s worker pods:
   > `E0715 21:13:28.459419 9 main.go:347] "msg"="failed to sync repo, 
aborting" "error"="error running command: exit status 128: { stdout: \"\", 
stderr: \"Cloning into '/git'...\\nNo user exists for uid 50000\\r\\nfatal: 
Could not read from remote repository.\\n\\nPlease make sure you have the 
correct access rights\\nand the repository exists.\\n\" }" `
   > 
   > Nonetheless, git-sync along with the webserver and scheduler of Airflow 
works since the env var AIRFLOW__KUBERNETES__RUN_AS_USER="50000" **isn't set** 
which is not the case in the K8S worker pods.
   > 
   > To fix this, we have to define
   > AIRFLOW__KUBERNETES__GIT_SYNC_RUN_AS_USER="65553" corresponding to the 
default uid of git-sync.
   > 
   > Also, we have to set the UID to 50000 otherwise Airflow fails with the 
following error:
   > 
   > ```
   > Traceback (most recent call last):
   >   File "/home/airflow/.local/bin/airflow", line 23, in <module>
   >     import argcomplete
   > ModuleNotFoundError: No module named 'argcomplete'
   > ```
   
   yes it might be failing as the user 50000 doesn't exist in `/etc/passwd` and 
ssh needs that.  setting `AIRFLOW__KUBERNETES__GIT_SYNC_RUN_AS_USER` to 
65553(may need to set fs_group as well - not very sure) will fix it or setting 
`GIT_SYNC_ADD_USER` env var  on the init container  should fix it as well(we do 
this on scheduler & webserver).  I had added that change to the worker pods but 
that's not part of 1.10.11 
https://github.com/apache/airflow/pull/9371/files#r442960495. think 
`run_as_user` is already defaulted to 50000  (`{{ .Values.uid }}`) in the 
config map rendered by the chart 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to