Skip to content
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

PodRuntimeInfoEnv is not working in 1.10.11 #10456

Closed
dimon222 opened this issue Aug 21, 2020 · 9 comments · Fixed by #10478
Closed

PodRuntimeInfoEnv is not working in 1.10.11 #10456

dimon222 opened this issue Aug 21, 2020 · 9 comments · Fixed by #10478
Labels
kind:bug This is a clearly a bug

Comments

@dimon222
Copy link
Contributor

dimon222 commented Aug 21, 2020

Apache Airflow version: 1.10.11

Kubernetes version (if you are using kubernetes) (use kubectl version): 1.17.0

What happened:
PodRuntimeInfoEnv object is not working in Airflow 1.10.11. It might be result of some recent (past 1 year?) refactoring of kubernetes code or so.

Exception thrown is this

Invalid value for `field_path`, must not be `None`

What you expected to happen:
It's able to initialize and produce respective KubernestPodOperator with it.

How to reproduce it:
Create PodRuntimeInfoEnv object, try to plug it in KubernetesPodOperator. Kubernetes Pod Operator never gets submitted and stacktrace pops.

It happens 100% of times. I know for sure that it worked perfectly fine on Airflow 1.10.9. So might be in 1.10.10 or 1.10.11 there was introduced regression.

After some investigation it seem to bring me to this place -

field_ref=k8s.V1ObjectFieldSelector(
self.field_path
)

As you might see, field_path is first argument. However, if I look at official kubernetes-python code, the first argument in V1ObjectFieldSelector constructor is api_version.
https://github.com/kubernetes-client/python/blob/master/kubernetes/client/models/v1_object_field_selector.py#L45
Since its clearly not provided in here, we end up with exception related to field_path value:
https://github.com/kubernetes-client/python/blob/master/kubernetes/client/models/v1_object_field_selector.py#L103

Possible solutions could be:

  1. Pass hardcoded api_version as well, this way ensuring that in case Kubernetes API changes, its remembered which version it complies to
                field_ref=k8s.V1ObjectFieldSelector(
                    api_version='v1',
                    field_path=self.field_path
                )
  1. Instead of using positional arg, use kwarg in V1ObjectFieldSelector
                field_ref=k8s.V1ObjectFieldSelector(
                    field_path=self.field_path
                )

For people who might already be noticing issue right now the simplest approach would be inheritance that would overwrite or monkeypatch the PodRuntimeInfoEnv class (specifically its method to_k8s_client_obj) and then use with it one of above mentioned solutions.

@dimon222 dimon222 added the kind:bug This is a clearly a bug label Aug 21, 2020
@potiuk
Copy link
Member

potiuk commented Aug 22, 2020

@kaxil @dimberman -> I keep my 🤞 that it's already fixed in 1.10.12rc3

@kaxil
Copy link
Member

kaxil commented Aug 22, 2020

Yup this one is fixed or atleast I think we have

@potiuk
Copy link
Member

potiuk commented Aug 22, 2020

@dimon222 - there was a major Kubernetes refactor in 1.10.11 that introduced some errors that 1.10.12 fixes. We are going to mark 1.10.11 as "yanked" so that it will be skipped by default.

@potiuk potiuk added this to the Airflow 1.10.12 milestone Aug 22, 2020
@dimon222
Copy link
Contributor Author

@kaxil
Copy link
Member

kaxil commented Aug 22, 2020

Will try it out in a bit.

@kaxil
Copy link
Member

kaxil commented Aug 22, 2020

If it was a regression since 1.10.10 and there is a workaround available this will be fixed in 1.10.13 -- but if not we will create a new rc4 for it.

@potiuk
Copy link
Member

potiuk commented Aug 22, 2020

OH NO!!!!!!!

@potiuk
Copy link
Member

potiuk commented Aug 22, 2020

Just tested rc3 😢

kaxil added a commit to astronomer/airflow that referenced this issue Aug 22, 2020
kaxil added a commit that referenced this issue Aug 22, 2020
@kaxil
Copy link
Member

kaxil commented Aug 22, 2020

@dimon222 can you please test out the patch in #10478 :)

kaxil added a commit that referenced this issue Aug 22, 2020
kaxil added a commit that referenced this issue Aug 22, 2020
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this issue Mar 5, 2021
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 4, 2021
closes apache/airflow#10456

(cherry picked from commit 47c6657ce012f6db147fdcce3ca5e77f46a9e491)

GitOrigin-RevId: d2f55a440b5a8f9ce2867f8338830efe8cc04a54
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 4, 2021
closes apache/airflow#10456

(cherry picked from commit 47c6657ce012f6db147fdcce3ca5e77f46a9e491)

GitOrigin-RevId: d2f55a440b5a8f9ce2867f8338830efe8cc04a54
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 9, 2021
closes apache/airflow#10456

(cherry picked from commit 47c6657ce012f6db147fdcce3ca5e77f46a9e491)

GitOrigin-RevId: d2f55a440b5a8f9ce2867f8338830efe8cc04a54
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 15, 2021
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 17, 2021
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 23, 2021
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 25, 2021
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Mar 9, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 3, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 6, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jul 9, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Aug 27, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 4, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
aglipska pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 7, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Dec 7, 2022
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jan 27, 2023
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 11, 2024
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 12, 2024
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 16, 2024
closes apache/airflow#10456

GitOrigin-RevId: 47c6657ce012f6db147fdcce3ca5e77f46a9e491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants