Skip to content

Installing 2.4.0 results in import error for PodOperatorHookProtocol #32056

@hyler

Description

@hyler

Apache Airflow version

Other Airflow 2 version (please specify below)

What happened

We installed 2.4.0 like this:

apache-airflow[crypto,postgres,docker,cncf.kubernetes,kubernetes,sqlite,statsd]==2.4.0

Our previous Docker image, built sometime in January, worked fine. Building it today results in broken Airflow, with this in the UI:

airflow-error

This is the text:

Broken DAG: [/usr/local/airflow/dags/dag_generator.py] Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/airflow/providers/cncf/kubernetes/operators/pod.py", line 51, in <module>
    from airflow.providers.cncf.kubernetes.hooks.kubernetes import KubernetesHook
  File "/usr/local/lib/python3.8/site-packages/airflow/providers/cncf/kubernetes/hooks/kubernetes.py", line 35, in <module>
    from airflow.providers.cncf.kubernetes.utils.pod_manager import PodOperatorHookProtocol
ImportError: cannot import name 'PodOperatorHookProtocol' from 'airflow.providers.cncf.kubernetes.utils.pod_manager' (/usr/local/lib/python3.8/site-packages/airflow/providers/cncf/kubernetes/utils/pod_manager.py)

If I enter the container and dig around site-packages/airflow/, I can indeed verify that PodOperatorHookProtocol is not in the pod_manager.py file.

I found a discussion here about this change, with some questions raised about the potential implications of the work (#31298). Is this related?

What you think should happen instead

No response

How to reproduce

Install Airflow 2.4.0 and visit the URL. Error appears on main page.

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

apache-airflow-providers-cncf-kubernetes==7.0.0
apache-airflow-providers-common-sql==1.5.1
apache-airflow-providers-docker==3.7.0
apache-airflow-providers-ftp==3.4.1
apache-airflow-providers-http==4.4.1
apache-airflow-providers-imap==3.2.1
apache-airflow-providers-postgres==5.5.0
apache-airflow-providers-sqlite==3.4.1

Deployment

Other Docker-based deployment

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can't ReproduceThe problem cannot be reproducedarea:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions