suhail-zemoso commented on issue #54175:
URL: https://github.com/apache/airflow/issues/54175#issuecomment-3219067159
@adrian-edbert I have tested with two different users using the steps below
**Workaround Steps**
1. Create users
- sudo adduser worker
- sudo adduser run_as_user
2. Configure sudoers for user switching
- sudo visudo
Add:
- worker ALL=(run_as_user) NOPASSWD: ALL
3. Create shared DAG bundles directory
sudo mkdir -p /opt/airflow/shared_dag_bundles
sudo chown -R worker:worker /opt/airflow/shared_dag_bundles
sudo chmod 775 /opt/airflow/shared_dag_bundles
sudo usermod -a -G worker run_as_user
4. Update Airflow config (airflow.cfg)
[dag_processor]
dag_bundle_storage_path = /opt/airflow/shared_dag_bundles
dag_bundle_config_list = [
{ "name": "git-bundle-test",
"classpath": "airflow.providers.git.bundles.git.GitDagBundle",
"kwargs": {
"subdir": "dags",
"tracking_ref": "main",
"git_conn_id": "my_git_conn",
"refresh_interval": 0
}
}
]
5. Install the Git provider
pip install apache-airflow-providers-git==0.0.4
6. Create the Airflow Git connection
sudo -u worker airflow connections add my_git_conn \
--conn-type git \
--conn-extra '{"repo": "https://github.com/your-org/your-repo.git"}'
7. Initialize the Airflow DB
sudo -u worker airflow db reset -y
8. Start Airflow with LocalExecutor
sudo -u worker airflow standalone
9. Fix Git safe directory issue (if needed)
git config --global --add safe.directory /opt/airflow/shared_dag_bundles
10. Verify that the user exists
id run_as_user
ValueError: Requested bundle 'git-bundle-test' is not configured.
1. Switch to worker (or root) and copy the file:
sudo -i
cp /home/worker/airflow/airflow.cfg /home/run_as_user/airflow/airflow.cfg
chown run_as_user:run_as_user /home/run_as_user/airflow/airflow.cfg
--
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]