-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Cannot convert a non-kubernetes.client.models.V1Pod object into a KubernetesExecutorConfig #26008
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Hello @dstandish ! Could you pay attention, if it possible, thank you |
I was just seeing a separate case for this particular error, and the setup also has a similar pattern—the DAG file imports a helper module ( airflow/airflow/kubernetes/pod_generator.py Lines 169 to 182 in 39c9169
Since there’s an custom_executor_config = {
"KubernetesExecutor": {
# Put worker configuration here. Possible arguments see:
# PodGenerator in airflow/kubernetes/pod_generator_deprecated.py
},
} If this is a serialisation issue, #26191 may be the fix for this. |
Is there a way to avoid serializing+deserializing the executor_config.pod_override in the first place? It should be enough that the scheduler loads it from the dag right before launching the pod? Why does it need to be in the database at all? |
The scheduler never loads the DAG from file because it would enable arbitrary code execution that may break the scheduler internals. The documentation explains this: https://airflow.apache.org/docs/apache-airflow/stable/dag-serialization.html |
Yes. Scheduler ONLY works on serialized version of the DAG where only structure and relations are kept. Actually in 2.3 to some extent and in 2.4. where we completed DAGFIleProcessor separation, technically you could run scheduler similarly as webserver without accessing DAG folder I believe (and possibly in the next chart we might support this case and do not mount DAG files to scheduler at all. |
On some of our dags tasks became stuck in queued state with scheduler reporting invalid executor config (assigned with pod_override: V1Pod), after we tried to upgrade to 2.3.4. Not sure if this is the same issue though. Upgrading to 2.4.0 doesn't help. Downgrading to 2.3.3 fixes the issue. |
@george-zubrienko can you share the executor config / sample dag and the traceback? Please also comment on whether this is an inflight dag run or whether it's new dag runs created after upgrade? |
Yeah i can repro this on 2.3.4 but not on 2.4.0 |
Closing then - we can always reopen if we get reports it is not fixed. |
Apache Airflow version
2.3.4
What happened
I have tasks in K8s with KubernetesExecutor for which I need to use a unique pod label. In version 2.3.4, I started catching an error
Cannot convert a non-kubernetes.client.models.V1Pod object into a KubernetesExecutorConfig
when executing a task but pods are created successfully.What you think should happen instead
I think this is the effect of these changes, but I'm not sure.
How to reproduce
I came to the conclusion that this error is due to the random name generation at "svc_name" variable.
Because if you remove the variable "svc_name" or make it unchanged, everything is fine.
It's not only related to the "metadata" parameter.
I will give a simple example.
template.py
my_dag.py
Operating System
Debian GNU/Linux 9 (stretch)
Versions of Apache Airflow Providers
apache-airflow-providers-apache-hdfs==3.1.0
apache-airflow-providers-apache-hive==4.0.0
apache-airflow-providers-apache-spark==3.0.0
apache-airflow-providers-cncf-kubernetes==4.3.0
apache-airflow-providers-common-sql==1.1.0
apache-airflow-providers-ftp==3.1.0
apache-airflow-providers-http==4.0.0
apache-airflow-providers-imap==3.0.0
apache-airflow-providers-jdbc==3.2.0
apache-airflow-providers-postgres==5.2.0
apache-airflow-providers-sftp==4.0.0
apache-airflow-providers-sqlite==3.2.0
apache-airflow-providers-ssh==3.1.0
Deployment
Other Docker-based deployment
Deployment details
kubectl version
Python 3.7.7 and all Airflow constraints
DB - PostgreSQL v12
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: