Skip to content

Fix GCP token refresh "context canceled" error#12

Merged
bbrowning merged 1 commit intomainfrom
gcp-token-refresh
Apr 2, 2026
Merged

Fix GCP token refresh "context canceled" error#12
bbrowning merged 1 commit intomainfrom
gcp-token-refresh

Conversation

@bbrowning
Copy link
Copy Markdown
Owner

The context passed to google.CredentialsFromJSON was created with a
30-second timeout and immediately canceled via defer when init()
returned. The oauth2 library stores this context internally and reuses
it for all subsequent token refresh HTTP calls, so every refresh
attempt failed with "context canceled". Use context.Background()
instead, which remains valid for the lifetime of the proxy.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

The context passed to google.CredentialsFromJSON was created with a
30-second timeout and immediately canceled via defer when init()
returned. The oauth2 library stores this context internally and reuses
it for all subsequent token refresh HTTP calls, so every refresh
attempt failed with "context canceled". Use context.Background()
instead, which remains valid for the lifetime of the proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bbrowning bbrowning merged commit 3d5124d into main Apr 2, 2026
6 checks passed
@bbrowning bbrowning deleted the gcp-token-refresh branch April 2, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant