Skip to content

Conversation

@Crowiant
Copy link
Contributor

@Crowiant Crowiant commented Oct 30, 2025

When Operators from the Kubernetes provider use the default connection ID (kubernetes_default) and the connection hasn't been created manually by a user (or via airflow connections create-default-connection), an ERROR is logged. This situation isn't actually an error for the provider. The KubernetesHook is designed to fall back to cluster-derived credentials if the default connection is not found:

def get_connection(cls, conn_id: str) -> Connection:
"""
Return requested connection.
If missing and conn_id is "kubernetes_default", will return empty connection so that hook will
default to cluster-derived credentials.
"""
try:
return super().get_connection(conn_id) # type: ignore[return-value]
except AirflowNotFoundException:
if conn_id == cls.default_conn_name:
return Connection(conn_id=cls.default_conn_name)
raise

PR reduces log_level for this provider from ERROR to WARNING.
Closes: #56360


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

ashb
ashb previously requested changes Oct 30, 2025
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just remove that log message entirely, it is just noise and will be exposed to tasks as an exception anyway.

@kaxil kaxil added this to the Airflow 3.1.2 milestone Oct 31, 2025
@kaxil kaxil dismissed ashb’s stale review October 31, 2025 14:29

Old comment - addressed

@kaxil kaxil merged commit 56106dd into apache:main Oct 31, 2025
81 checks passed
kaxil pushed a commit that referenced this pull request Oct 31, 2025
…n task-sdk. (#57548)

Co-authored-by: Anton Nitochkin <nitochkin@google.com>
(cherry picked from commit 56106dd)
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Nov 10, 2025
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
…n task-sdk. (apache#57548)

Co-authored-by: Anton Nitochkin <nitochkin@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:task-sdk type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Connection not found" error in KubernetesPodOperator logs

5 participants