When I try to start the Airflow services with docker compose --profile flower up, the following errors occur when starting the airflow-airflow-init-1 container:
chown: changing ownership of '/sources/logs': Invalid argument
chown: changing ownership of '/sources/dags': Invalid argument
chown: changing ownership of '/sources/plugins': Invalid argument
The container is run as root user. For security, consider using a regular user account.
What else should I do in order for the three chowns to work (so that the files created in dags, logs and plugins be created with root user ownership)?
I followed every step in https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html to run Airflow in Docker on an Ubuntu 20.04.6 LTS host, including the following two commands ("Setting the right Airflow user"):
mkdir -p ./dags ./logs ./plugins ./config
echo -e "AIRFLOW_UID=$(id -u)" > .env
I confirm that there is an .env file with the following variable in the folder containing docker-compose.yaml:
AIRFLOW_UID=<uid>
And that equals the Uid in the result of stat {logs,dags,plugins}.
I expected the setting of the AIRFLOW_UID envirnoment variable to be enough for the chowns to be able to succeed, but every one of them threw an 'Invalid argument' excepction.
The filesystem on the host is ext4 and the ones in the container, per df -T, are overlay for / and virtiofs for /opt/airflow/logs.