You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kunaljubce (via GitHub)" <gi...@apache.org> on 2026/05/28 12:06:22 UTC
[I] KubernetesExecutor: Task stuck in queued when using deprecated executor_config dict format [airflow]
kunaljubce opened a new issue, #67643:
URL: https://github.com/apache/airflow/issues/67643
### Under which category would you file this issue?
Providers
### Apache Airflow version
3.3
### What happened and how to reproduce it?
When we try to run a dag with `executor_config={"KubernetesExecutor": {"config_file": "/some/path/kubeconfig.yaml"}}`, the task gets stuck in a `Queued` state and never actually triggers or fails. Further inspecting the scheduler logs shows the below:
```
→ export KUBECONFIG=/Users/81045729/Documents/constant_variables/airflow/.build/.k8s-clusters/airflow-python-3.10-v1.30.13/.kubeconfig && kubectl logs -n airflow airflow-scheduler-58dcc9f6cf-qnbvj -c scheduler 2>&1 | grep -i "Invalid executor_config\|TypeError\|error.*executor\|execute_async\|run_next\|Cannot convert" | tail -20
2026-05-28T11:06:02.185119Z [error ] Invalid executor_config for TaskInstanceKey(dag_id='test_k8s_executor_config_legacy', task_id='check_for_failure', run_id='manual__2026-05-28T11:06:01.899410+00:00', try_number=1, map_index=-1). Executor_config: {'KubernetesExecutor': {'config_file': '/some/path/kubeconfig.yaml'}} [airflow.providers.cncf.kubernetes.executors.kubernetes_executor.KubernetesExecutor] loc=kubernetes_executor.py:221
```
### What you think should happen instead?
Task should fail gracefully or continue with a deprecation warning to switch to using `pod_override` attribute inside `executor_config`.
### Operating System
MacOS
### Deployment
Virtualenv installation
### Apache Airflow Provider(s)
cncf-kubernetes
### Versions of Apache Airflow Providers
Issue not restricted to a specific provider version
### Official Helm Chart version
Not Applicable
### Kubernetes Version
_No response_
### Helm Chart configuration
_No response_
### Docker Image customizations
_No response_
### Anything else?
To reproduce, you can create the below dag, place it in `airflow-core/src/airflow/example_dags/`, and deploy the airflow server with `KubernetesExecutor` as mentioned in [contribution docs](https://github.com/kunaljubce/airflow/blob/main/contributing-docs/testing/k8s_tests.rst#typical-testing-pattern-for-kubernetes-tests):
```
from airflow.providers.standard.operators.python import PythonOperator
from airflow.sdk import DAG
import pendulum
def useless_func():
pass
with DAG(
dag_id = "test_k8s_executor_config_legacy",
schedule = None,
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
catchup=False,
) as dag:
run_this = PythonOperator(
task_id = "check_for_failure",
python_callable = useless_func,
executor_config={"KubernetesExecutor": {"config_file": "/some/path/kubeconfig.yaml"}}
)
run_this
```
Once all commands have executed successfully, you should see the URL for the airflow UI in the console logs, looking like below (your port might be different to mine, verify from console logs):
```
KinD Cluster API server URL: http://localhost:44498
Connecting to localhost:34814. Num try: 1
Error when connecting to localhost:34814 : ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Sleeping for 5 seconds.
Connecting to localhost:34814. Num try: 2
Error when connecting to localhost:34814 : ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Sleeping for 5 seconds.
Connecting to localhost:34814. Num try: 3
Established connection to api server at http://localhost:34814/api/v2/monitor/health and it is healthy.
Airflow API server URL: http://localhost:34814 (admin/admin) <<<<---- Airflow UI URL
NEXT STEP: You might now run tests or interact with airflow via shell (kubectl, pytest etc.) or k9s commands:
```
Copy and paste the URL on your browser, trigger the DAG and watch it go into queued state
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] KubernetesExecutor: Task stuck in queued when using deprecated executor_config dict format [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #67643:
URL: https://github.com/apache/airflow/issues/67643#issuecomment-4567389518
@kunaljubce if you have an idea for a fix feel free to raise a PR
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] KubernetesExecutor: Task stuck in queued state when using deprecated `executor_config` dict format [airflow]
Posted by "sjyangkevin (via GitHub)" <gi...@apache.org>.
sjyangkevin commented on issue #67643:
URL: https://github.com/apache/airflow/issues/67643#issuecomment-6086540794
Hi, noticed the PR had been closed a while ago. Wonder if I could pick this up, I've opened a PR attempt to resolve the issue continuing on the existing work.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] KubernetesExecutor: Task stuck in queued state when using deprecated `executor_config` dict format [airflow]
Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil closed issue #67643: KubernetesExecutor: Task stuck in queued state when using deprecated `executor_config` dict format
URL: https://github.com/apache/airflow/issues/67643
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] KubernetesExecutor: Task stuck in queued when using deprecated executor_config dict format [airflow]
Posted by "kunaljubce (via GitHub)" <gi...@apache.org>.
kunaljubce commented on issue #67643:
URL: https://github.com/apache/airflow/issues/67643#issuecomment-4563849743
I actually came across this issue while investigating another issue - #46293. Tracing the code flow through the [KubernetesExecutor.execute_async()](https://github.com/apache/airflow/blob/b66f4433e004fad81b66023bd8caccee55e6e4f7/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py#L219) call down to where the `KubernetesExecutor` param is being fetched from the `executor_config` attribute inside [PodGenerator.from_obj()](https://github.com/apache/airflow/blob/b66f4433e004fad81b66023bd8caccee55e6e4f7/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/pod_generator.py#L189), I found the block as below:
```
def from_obj(obj) -> dict | k8s.V1Pod | None:
"""Convert to pod from obj."""
if obj is None:
return None
k8s_legacy_object = obj.get("KubernetesExecutor", None)
k8s_object = obj.get("pod_override", None)
if k8s_legacy_object and k8s_object:
raise AirflowConfigException(
"Can not have both a legacy and new"
"executor_config object. Please delete the KubernetesExecutor"
"dict and only use the pod_override kubernetes.client.models.V1Pod"
"object."
)
if not k8s_object and not k8s_legacy_object:
return None
if isinstance(k8s_object, k8s.V1Pod):
return k8s_object
raise TypeError(
"Cannot convert a non-kubernetes.client.models.V1Pod object into a KubernetesExecutorConfig"
)
```
As I understand, the `k8s_legacy_object` is storing the value of `KubernetesExecutor` param but not doing anything with it. And with `k8s_object` being set to `None` due to the absence of the `pod_override` param, all conditions are failed and a `TypeError` is raised. This is being caught by the `exception` block in `KubernetesExecutor.execute_async()`.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] KubernetesExecutor: Task stuck in queued when using deprecated executor_config dict format [airflow]
Posted by "kunaljubce (via GitHub)" <gi...@apache.org>.
kunaljubce commented on issue #67643:
URL: https://github.com/apache/airflow/issues/67643#issuecomment-4572219507
> [@kunaljubce](https://github.com/kunaljubce) if you have an idea for a fix feel free to raise a PR
Yeah working on it!
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org