-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"dag_id could not be found" when running airflow on KubernetesExecutor #13680
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
anybody ?? |
I'm having this issue too. After upgrading to 2.0.0, while running with
I access my DAGs via an Azure file store mounted as a volume using a pvc, and have found that the worker pods are not being created with the same mounted volume. It seems that the previously available
no longer exist in version 2.0.0, and the worker pods therefore cannot be created with the the proper volume mounts, leading to the above error. Any way around this? |
It turns out that as of 2.0.0, users are required to provide a |
@SulimanLab did you find a workaround? |
In your init container, you have In your main container:
In airflow.cfg So you airflow scheduler is expecting the dags to be placed under /opt/airflow/dags/repo/, however is that how you populate it in your init container? E.g do you have the "repo" directory ? |
yeah I have a repo contains all the dags files, when task pod is instantiated it tries to git aync files , the issue is that it's not able to get the the secrets from volumes for gitsync. this is what i think |
no , still trying. i changed the executor to celery executor |
What I meant is your scheduler is expecting /opt/airflow/dags/repo/bash.py, but it could be that your bash.py is in a different path such as make sure your file is located at the right place, it is very easy to inspect |
@SulimanLab I got it to work with by replacing - mountPath: {{ include "airflow_dags_mount_path" . }} with - mountPath: {{ include "airflow_dags" . }} in https://github.com/apache/airflow/blob/master/chart/files/pod-template-file.kubernetes-helm-yaml#L65 |
wow, I will test that. |
This commit is promising actually |
@SulimanLab I'm testing with that commit and it hasn't worked. |
@SulimanLab it's a fix but it doesn't solve our issue |
changing this line to 444 fixed the issue airflow/chart/templates/_helpers.yaml Line 114 in 9592be8
|
Really? I am using user and pass and webserver works but pods aren't. |
I have the same problem. I've been testing all the comments here as well with no results. |
At last, it works. |
Try ssh login, and change as mentioned above, pretty sure it will work. |
@ismaello This does the same as what I suggested right? If you are using gitSync and KubernetesExecutor, DAGs persistence in the worker pod is meaningless. I hope #13826 is merged. |
I had to create a pod template file : apiVersion: v1
kind: Pod
metadata:
name: dummy-name
spec:
containers:
- env:
- name: AIRFLOW__CORE__DAGS_FOLDER
value: /opt/bitnami/airflow/dags/git-airflow-dags/repo/
- name: AIRFLOW__CORE__EXECUTOR
value: LocalExecutor
- name: AIRFLOW__CORE__SQL_ALCHEMY_CONN
value: xxxxxxxxxxxxxx
- name: AIRFLOW__CORE__FERNET_KEY
value: xxxxxxxxxxxxxxx
image: bitnami/airflow-worker:2.0.0-debian-10-r5
name: base
volumeMounts:
- mountPath: /opt/bitnami/airflow/dags/git-airflow-dags
name: airflow-dags
readOnly: true
subPath: ./repo/
initContainers:
- env:
- name: GIT_SYNC_REPO
value: https://gitlab..........................
- name: GIT_SYNC_BRANCH
value: dev
- name: GIT_SYNC_ROOT
value: /dags-airflow-dags
- name: GIT_SYNC_DEST
value: repo
- name: GIT_SYNC_DEPTH
value: "1"
- name: GIT_SYNC_ONE_TIME
value: "true"
- name: GIT_SYNC_REV
- name: GIT_SYNC_USERNAME
value: aleopold
- name: GIT_SYNC_PASSWORD
value: xxxxxxxxxxxxxxxxxxxxxxxxxxx
- name: GIT_KNOWN_HOSTS
value: "false"
image: k8s.gcr.io/git-sync:v3.1.1
imagePullPolicy: IfNotPresent
name: git-sync-clone
securityContext:
runAsUser: 65533
volumeMounts:
- mountPath: /dags-airflow-dags
name: airflow-dags
securityContext:
fsGroup: 50000
runAsUser: 50000
serviceAccount: airflow-deployement
serviceAccountName: airflow-deployement
volumes:
- name: airflow-dags And in the helm-chart's airflow:
extraEnvVars:
- name: AIRFLOW_EXECUTOR
value: "KubernetesExecutor"
- name: AIRFLOW__KUBERNETES__POD_TEMPLATE_FILE
value: "/opt/bitnami/airflow/dags/git-airflow-dags/dev-airflow-worker.yaml"
- name: AIRFLOW__KUBERNETES__FS_GROUP
value: "50000" hope it helps |
I had the same problem. In my case, given gitSync.subPath as the empty string. I fixed that problem after give the correct value. dags:
gitSync:
subPath: path/to/dags hope it helps |
…13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves #13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]>
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]>
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
…(#13826) * Update pod-template-file.kubernetes-helm-yaml * Fix ssh-key access issue This change allows dags.gitSync.containerName to read ssh-key from file system. Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92 It solves apache/airflow#13680 issue for private repositories. Co-authored-by: Denis Krivenko <[email protected]> GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
Apache Airflow version: 2.0.0
Kubernetes version (if you are using kubernetes) (use
kubectl version
): v1.19.4What happened:
I get this error when try to execute tasks using kubernetes
What you expected to happen:
get executed and terminate
How to reproduce it:
deploy airflow helm chart using this values.yaml:
and this is the dag with its tasks
This is airflow.cfg file
This is the pod yaml file for the new tasks
-----------------------Important----------------------------
Debugging
for debugging purpose I have changed the pod args rather than running the task, I ran it with
and tried to look for the Dags , and found None. It seems like gitSync is not working with the pods triggered by kubernetesExecutor.
Any help please ???
The text was updated successfully, but these errors were encountered: