potiuk commented on issue #17320:
URL: https://github.com/apache/airflow/issues/17320#issuecomment-1566853128

   What exact stack track do you have? You mentioned "similar" but you forgot 
to attach the error or stack trace you have (which - unless you have also some 
modificaiton in your image or variables you pass to it s
   
    I believe the problem might be, that you also override AIRFLOW_HOME 
variable or something similal.
   
   By default when you set the AIRFLOW_UID variable, the following things are 
happening:
   
   1)  The new user is created and what you observe is correct: It should have 
home set to /airflow/home, it should have UID=1002 and GID=0. So far so good.
   
   This is what I have when I enter the image with UID=1002. This is exactly as 
expected:
   
   ```
   default@aa130926bd39:/opt/airflow$ cat /etc/passwd | grep default
   default:x:1002:0:default user:/home/airflow:/sbin/nologin
   ```
   
   2) The AIRFLOW_HOME variable should be set to `/opt/airflow` and the default 
`airflow.cfg` should be already created there:
   
   ```
   default@aa130926bd39:/opt/airflow$ set |grep AIRFLOW_HOME
   AIRFLOW_HOME=/opt/airflow
   default@aa130926bd39:/opt/airflow$ ls ${AIRFLOW_HOME}
   airflow.cfg  airflow.db  dags  logs  webserver_config.py
   ```
   
   3) I can run `airflow config list` and it works all right - showing the 
values from airflow.cfg. Because `default` user belongs to 0 group and the 
`/opt/airflow` folder is owned by the `0` group and the group has all the 
permissions there. I can even remove the `airflow.cfg` and run `airlfow help` 
or another command at it will get recreated:
   
   ```
   default@aa130926bd39:/opt/airflow$ airflow config list
   [core]
   dags_folder = /opt/airflow/dags
   hostname_callable = airflow.utils.net.getfqdn
   
   (removed for brevity)
   
   default@aa130926bd39:/opt/airflow$ ls
   airflow.cfg  airflow.db  dags  logs  webserver_config.py
   default@aa130926bd39:/opt/airflow$ rm airflow.cfg
   default@aa130926bd39:/opt/airflow$ ls
   airflow.db  dags  logs  webserver_config.py
   default@aa130926bd39:/opt/airflow$ airflow help
   usage: airflow [-h] GROUP_OR_COMMAND ...
   
   (removed for brevity)
   
   default@aa130926bd39:/opt/airflow$ ls
   airflow.cfg  airflow.db  dags  logs  webserver_config.py
   default@aa130926bd39:/opt/airflow$ ls -la
   total 84
   drwxrwxr-x 1 airflow root  4096 May 29 09:33 .
   drwxr-xr-x 1 root    root  4096 Mar 31 22:55 ..
   -rw------- 1 default root 51721 May 29 09:33 airflow.cfg
   -rw-r--r-- 1 default root     0 May 29 09:24 airflow.db
   drwxrwxr-x 2 airflow root  4096 Mar 31 22:55 dags
   drwxrwxr-x 1 airflow root  4096 May 29 09:24 logs
   -rw-rw-r-- 1 default root  4771 May 29 09:24 webserver_config.py
   default@aa130926bd39:/opt/airflow$
   ```
   
   So I wonder - what's your error @MingTaLee and what the above commands show?


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to