Repository navigation
Closed
Labels
area:Executors-coreLocalExecutor & SequentialExecutorLocalExecutor & SequentialExecutorarea:helm-chartAirflow Helm ChartAirflow Helm Chartkind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yet
Description
Official Helm Chart version
1.16.0 (latest released)
Apache Airflow version
2.10.5
Kubernetes Version
1.31
Helm Chart configuration
No response
Docker Image customizations
No response
What happened
I'm afraid that then new multiple executor configuration does not work at all.
In when the scheduler parses the dags tasks are configured with:
executor='KubernetesExecutor`
but then when a pod is launched an environment variable is injected:
AIRFLOW__CORE__EXECUTOR=LocalExecutor
which next results in a validation error:
│ Traceback (most recent call last): │
│ File "/home/airflow/.local/lib/python3.12/site-packages/airflow/models/dag.py", line 852, in validate_executor_field │
│ ExecutorLoader.lookup_executor_name_by_str(task.executor) │
│ File "/home/airflow/.local/lib/python3.12/site-packages/airflow/executors/executor_loader.py", line 215, in lookup_executor_name_by_str │
│ raise UnknownExecutorException(f"Unknown executor being loaded: {executor_name_str}") │
│ airflow.exceptions.UnknownExecutorException: Unknown executor being loaded: KubernetesExecutor
What you think should happen instead
No response
How to reproduce
Configure the chart with CeleryExecutor,KubernetesExecutor and run any task
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
area:Executors-coreLocalExecutor & SequentialExecutorLocalExecutor & SequentialExecutorarea:helm-chartAirflow Helm ChartAirflow Helm Chartkind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yet
Activity
boring-cyborg commentedon Apr 2, 2025
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
[-]Failure with multiple execurors[/-][+]Task execution failure with multiple executors[/+]ms32035 commentedon Apr 2, 2025
Looks like the issue is here:
https://github.com/apache/airflow/blob/main/chart/files/pod-template-file.kubernetes-helm-yaml#L96
I managed to work around it by injecting
into
pod_overridebut that does not look like an ideal solutioneladkal commentedon Apr 4, 2025
cc @o-nikolas
o-nikolas commentedon Apr 4, 2025
Yes, a fundamental thing about Airflow is that the configuration should be the same in all machines. The tasks are using executors that are not configured in the pod it seems. So this is an issue with the helm chart itself (CC @jedcunningham I know you're OOTO, but I don't know who the next in-line Helm PoC is).
ihnokim commentedon Apr 18, 2025
I believe this issue stems from the fact that when a task is executed inside a Kubernetes Pod, the DAG attempts to load the executor via a parameter — and that’s the root cause of the problem. This isn’t an issue when using a single executor, but if you attempt to use multiple executors, each task must explicitly receive an executor parameter to specify which one to use.
For example, consider the following DAG file:
In this case, the scheduler dispatches the task to be executed via the
KubernetesExecutor, which pushes it into the task queue. When a Pod is spun up based on the pod_template, the executor is typically set using the environment variableAIRFLOW__CORE__EXECUTOR, which defaults toLocalExecutor.If the task didn't have an executor parameter explicitly passed, then the executor would be determined based on this environment variable by
airflow.executors.executor_loader. However, because the DAG explicitly passesexecutor='KubernetesExecutor', the task inside the Pod attempts to re-load and execute viaKubernetesExecutor— causing it to spin up yet another Pod.This results in the following error inside the container:
Therefore, I think tasks that are created and run via a pod_template should ignore any executor parameter defined in the DAG and instead rely solely on the
AIRFLOW__CORE__EXECUTORenvironment variable for executor selection. Until this is handled in code, it seems to me that using multiple executors in practice is not really feasible.If the maintainers agree with this approach, I’d love to submit a PR to contribute a fix for this. Would that be okay?
ihnokim commentedon Apr 18, 2025
Before complex changes, I just created a workaround PR to close this issue based on the idea of @ms32035
potiuk commentedon Apr 18, 2025
But I think this is quite fundamental change in the way how K8S executor works. It's always worked in the way (from what I remember) - that when POD was run by K8S executor, the
LocalExecutorhas been set unconditonally - because fundamentally we did not want to again trigger the executor when run - so the task in K8S executor is executed effectively by the LocalExecutor.ms32035 commentedon Apr 18, 2025
We see that it's still using a local executor inside the pod, and the check that's causing the root issue is purely a validation, but I might be wrong.
o-nikolas commentedon Apr 18, 2025
@ihnokim The issue is really not that complex. We simply have code in dag validation logic (when the dag is loaded) to check that all executors requested by tasks within the dag are present and configured (since we don't want users to get stuck trying to run tasks on executors that don't exist). Airflow assumes configuration is the same across all hosts, many things will break if it's not consistent (this was the biggest feedback @jedcunningham gave us ages ago when we started executor work).
So in this case when the new pod starts, it loads the dag, the validation logic runs, the configuration is not correct, so we fail.
Your PR to create a consistent config (at least for core.executor) is not a workaround, it's a perfectly fine fix 👍
ihnokim commentedon Apr 19, 2025
@potiuk @ms32035 @o-nikolas Thank you for your kind response!
As you explained, I was able to confirm through testing that after passing the validation inside the pod, it runs like it is using the local executor as expected.
I hope the PR I submitted helps reduce confusion for other Helm chart users 👍
morooshka commentedon Jun 6, 2025
@ihnokim Can you please finish with the PR? Highly appreciated
o-nikolas commentedon Jun 6, 2025
Last I looked there were approvals on the PR but also a request for changes blocking is merge (CC @potiuk). Would love to get that one done!