kaxil commented on pull request #17882:
URL: https://github.com/apache/airflow/pull/17882#issuecomment-907689176


   > > Well. Actually the latest docker-compose already has it :)
   > > ```
   > >         if [[ -z "${AIRFLOW_UID}" ]]; then
   > >           echo -e "\033[1;31mERROR!!!: AIRFLOW_UID not set!\e[0m"
   > >           echo "Please follow these instructions to set AIRFLOW_UID and 
AIRFLOW_GID environment variables:
   > >             
https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html#initializing-environment";
   > >           exit 1
   > >         fi
   > > ```
   > 
   > @kaxil - did you use the latest one ?
   
   Yup:
   
   ```
   ❯ docker-compose up airflow-init
   WARNING: The AIRFLOW_UID variable is not set. Defaulting to a blank string.
   WARNING: The AIRFLOW_GID variable is not set. Defaulting to a blank string.
   start_redis_1 is up-to-date
   start_postgres_1 is up-to-date
   Recreating start_airflow-init_1 ... done
   Attaching to start_airflow-init_1
   airflow-init_1       | Traceback (most recent call last):
   airflow-init_1       |   File "/usr/local/lib/python3.9/pathlib.py", line 
1313, in mkdir
   airflow-init_1       |     self._accessor.mkdir(self, mode)
   airflow-init_1       | PermissionError: [Errno 13] Permission denied: 
'/root/airflow'
   airflow-init_1       |
   airflow-init_1       | During handling of the above exception, another 
exception occurred:
   airflow-init_1       |
   airflow-init_1       | Traceback (most recent call last):
   airflow-init_1       |   File "/usr/local/bin/airflow", line 33, in <module>
   airflow-init_1       |     sys.exit(load_entry_point('apache-airflow', 
'console_scripts', 'airflow')())
   airflow-init_1       |   File "/usr/local/bin/airflow", line 25, in 
importlib_load_entry_point
   airflow-init_1       |     return next(matches).load()
   airflow-init_1       |   File 
"/usr/local/lib/python3.9/importlib/metadata.py", line 77, in load
   airflow-init_1       |     module = import_module(match.group('module'))
   airflow-init_1       |   File 
"/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
   airflow-init_1       |     return _bootstrap._gcd_import(name[level:], 
package, level)
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 1030, in 
_gcd_import
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 1007, in 
_find_and_load
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 972, in 
_find_and_load_unlocked
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 228, in 
_call_with_frames_removed
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 1030, in 
_gcd_import
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 1007, in 
_find_and_load
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 986, in 
_find_and_load_unlocked
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 680, in 
_load_unlocked
   airflow-init_1       |   File "<frozen importlib._bootstrap_external>", line 
850, in exec_module
   airflow-init_1       |   File "<frozen importlib._bootstrap>", line 228, in 
_call_with_frames_removed
   airflow-init_1       |   File "/opt/airflow/airflow/__init__.py", line 34, 
in <module>
   airflow-init_1       |     from airflow import settings
   airflow-init_1       |   File "/opt/airflow/airflow/settings.py", line 34, 
in <module>
   airflow-init_1       |     from airflow.configuration import AIRFLOW_HOME, 
WEBSERVER_CONFIG, conf  # NOQA F401
   airflow-init_1       |   File "/opt/airflow/airflow/configuration.py", line 
1114, in <module>
   airflow-init_1       |     conf = initialize_config()
   airflow-init_1       |   File "/opt/airflow/airflow/configuration.py", line 
834, in initialize_config
   airflow-init_1       |     pathlib.Path(AIRFLOW_HOME).mkdir(parents=True, 
exist_ok=True)
   airflow-init_1       |   File "/usr/local/lib/python3.9/pathlib.py", line 
1322, in mkdir
   airflow-init_1       |     if not exist_ok or not self.is_dir():
   airflow-init_1       |   File "/usr/local/lib/python3.9/pathlib.py", line 
1429, in is_dir
   airflow-init_1       |     return S_ISDIR(self.stat().st_mode)
   airflow-init_1       |   File "/usr/local/lib/python3.9/pathlib.py", line 
1222, in stat
   airflow-init_1       |     return self._accessor.stat(self)
   airflow-init_1       | PermissionError: [Errno 13] Permission denied: 
'/root/airflow'
   airflow-init_1       | ERROR!!!: AIRFLOW_UID not set!
   airflow-init_1       | Please follow these instructions to set AIRFLOW_UID 
and AIRFLOW_GID environment variables:
   airflow-init_1       |     
https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html#initializing-environment
   start_airflow-init_1 exited with code 1
   ```


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