Skip to content

google: warn when remote_log_conn_id is configured but not found#67510

Open
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:google-gcs-log-handler-warn-on-missing-conn
Open

google: warn when remote_log_conn_id is configured but not found#67510
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:google-gcs-log-handler-warn-on-missing-conn

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 25, 2026

GCSRemoteLogIO.hook silently swallowed AirflowNotFoundException when the configured remote_log_conn_id did not exist, falling back to Application Default Credentials without any signal. That made a misconfigured remote-log connection (logs effectively going through the wrong credentials) invisible to operators — a security-control failure with no operational indication.

Reported as F-008 in the apache/tooling-agents L3 providers/google sweep b1aec75.

Change

Replace the silent pass at gcs_task_handler.py:97-98 with self.log.warning mentioning the unresolved conn_id so the fallback is visible in worker logs. Behaviour (falling back to ADC) is unchanged when no remote_log_conn_id is configured.

Test plan

  • test_hook_warns_when_remote_log_conn_id_missing — patches GCSHook to raise AirflowNotFoundException, asserts the warning is emitted with the unresolved conn_id name and hook is None.
  • test_hook_silent_when_no_remote_log_conn_id_configured — empty conn_id means silent fall-through to ADC, no warning emitted.
  • prek run ruff clean.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

``GCSRemoteLogIO.hook`` silently swallowed ``AirflowNotFoundException``
when the configured ``remote_log_conn_id`` did not exist, falling back
to Application Default Credentials without any signal. That made a
misconfigured remote-log connection (logs effectively going through
the wrong credentials) invisible to operators — a security-control
failure with no operational indication.

Replace the silent ``pass`` with a ``self.log.warning`` mentioning the
unresolved conn_id so the fallback is visible in worker logs. The
behaviour (falling back to ADC) is unchanged for the case where no
``remote_log_conn_id`` is configured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:logging area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant