Skip to content

Report the missing secret id when Google get_secret raises NotFound - #73035

Merged
henry3260 merged 1 commit into
apache:mainfrom
rjgoyln:fix/google-get-secret-notfound-message
Sep 15, 2026
Merged

henry3260 merged 1 commit into
apache:mainfrom
rjgoyln:fix/google-get-secret-notfound-message

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

get_secret passed the secret id as a second positional argument to NotFound. That argument is errors, not a format argument — google.api_core renders only the status code and message, and silently drops errors entries that do not expose .code and .message.

So the placeholder was never filled and the id never surfaced anywhere:

404 The secret '%s' not found

Which secret is missing is the only detail that makes the error actionable.

Change

  • Interpolate secret_id into the message.
  • Point example_ads.py at the shared helper rather than its own copy, which carried the same bug.
  • Tighten the existing not-found test with match=, which the old message fails.

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

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

@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Sep 12, 2026
NotFound comes from google.api_core, whose constructor signature is
(message, errors=(), ...) and whose __str__ renders only the code and the
message. Passing the secret id as a second positional argument bound it
to errors instead of interpolating it, so the error read
"404 The secret '%s' not found" and the one piece of information a user
needs in order to act on it never reached them.

The system test Dag reached the same raise through a copy of the helper,
so it now goes through the shared one rather than gaining a second
definition that would have to be kept in step.
@rjgoyln
rjgoyln force-pushed the fix/google-get-secret-notfound-message branch from ae45301 to ebe355b Compare September 12, 2026 16:44
@rjgoyln
rjgoyln marked this pull request as ready for review September 15, 2026 05:35
@rjgoyln
rjgoyln requested a review from shahar1 as a code owner September 15, 2026 05:35

@henry3260 henry3260 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch!

@henry3260
henry3260 merged commit 2240e91 into apache:main Sep 15, 2026
166 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants