Skip to content

KubernetesPodOperator Mark Task Failed after SUCCESS Randomly #21420

Closed

Description

@armandleopold

Apache Airflow version

2.2.3 (latest released)

What happened

We are using KubernetesPodOperator to schedule basically all of our tasks.
Sometimes, randomly some TASK finish and are marked as SUCCESS and then immediately marked FAILED.

....
2022-02-08, 06:09:51 CET - Bootstrap - INFO - *********************************************************
2022-02-08, 06:09:51 CET - Bootstrap - INFO - ***                        FIN                        ***
2022-02-08, 06:09:51 CET - Bootstrap - INFO - *********************************************************
Event: consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 had an event of type Succeeded
Event with job id consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 Succeeded
Event: consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 had an event of type Succeeded
Event with job id consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 Succeeded
Marking task as SUCCESS. dag_id=consore-by-window, task_id=consore-biologieclinique-interface-0.4, execution_date=20220207T215900, start_date=20220208T040444, end_date=20220208T040953
Task exited with return code 0
Marking task as FAILED. dag_id=consore-by-window, task_id=consore-biologieclinique-interface-0.4, execution_date=20220207T215900, start_date=20220208T040444, end_date=20220208T040953
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'execution_date' from the template is deprecated and will be removed in a future version. Please use 'data_interval_start' or 'logical_date' instead.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'next_ds' from the template is deprecated and will be removed in a future version. Please use '{{ data_interval_end | ds }}' instead.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'next_ds_nodash' from the template is deprecated and will be removed in a future version. Please use '{{ data_interval_end | ds_nodash }}' instead.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'next_execution_date' from the template is deprecated and will be removed in a future version. Please use 'data_interval_end' instead.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'prev_ds' from the template is deprecated and will be removed in a future version.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'prev_ds_nodash' from the template is deprecated and will be removed in a future version.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'prev_execution_date' from the template is deprecated and will be removed in a future version.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'prev_execution_date_success' from the template is deprecated and will be removed in a future version. Please use 'prev_data_interval_start_success' instead.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'tomorrow_ds' from the template is deprecated and will be removed in a future version.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'tomorrow_ds_nodash' from the template is deprecated and will be removed in a future version.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'yesterday_ds' from the template is deprecated and will be removed in a future version.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/context.py:152 AirflowContextDeprecationWarning: Accessing 'yesterday_ds_nodash' from the template is deprecated and will be removed in a future version.
/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/email.py:102 PendingDeprecationWarning: Fetching SMTP credentials from configuration variables will be deprecated in a future release. Please set credentials using a connection instead.
section/key [smtp/smtp_user] not found in config
Email alerting: attempt 1
...

What you expected to happen

What i expect is that the TASK is Marked as SUCCESS only .

...
2022-02-08, 06:09:51 CET - Bootstrap - INFO - *********************************************************
2022-02-08, 06:09:51 CET - Bootstrap - INFO - ***                        FIN                        ***
2022-02-08, 06:09:51 CET - Bootstrap - INFO - *********************************************************
Event: consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 had an event of type Succeeded
Event with job id consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 Succeeded
Event: consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 had an event of type Succeeded
Event with job id consore-biologieclinique-interface-0.4.f3afe897abf646c6b22642cb594b8745 Succeeded
Marking task as SUCCESS. dag_id=consore-by-window, task_id=consore-biologieclinique-interface-0.4, execution_date=20220207T215900, start_date=20220208T040444, end_date=20220208T040953
Task exited with return code 0
...

How to reproduce

I don't know how to reproduce.

Ideas :

  • Deploy airflow 2.2.3
  • Create DAG with KubernetesPodOperator
  • Schedule a task

Operating System

debian-buster

Versions of Apache Airflow Providers

can't have that

Deployment

Official Apache Airflow Helm Chart

Deployment details

using the bitnami helm https://artifacthub.io/packages/helm/bitnami/airflow

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. raphaelauv commented on Feb 14, 2022

    @raphaelauv
    Contributor

    you can go inside the container and do pip list

  2. armandleopold commented on Feb 14, 2022

    @armandleopold
    Author
    root@test-6494ccc5b8-7nlf6:/home# python -m pip list
    Package      Version
    ------------ -------
    distlib      0.3.4
    filelock     3.4.2
    pip          21.3.1
    platformdirs 2.4.1
    setuptools   46.4.0
    six          1.16.0
    virtualenv   20.11.0
    
  3. armandleopold commented on Feb 14, 2022

    @armandleopold
    Author

    This is strange :
    The task is "Failed" but don't appears as failed in the front-end DAG view
    image
    image
    image

    Ho no ok, it's because the last DAG run finished Successfully.

    image

  4. locked and limited conversation to collaborators on Feb 14, 2022
  5. converted this issue into a discussion #21558 on Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions