vectordotdev / vectordotdev/vector

GCP token generation can fail with obscure error message

Open
#2,361 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

domain: networking have: nice meta: regression provider: gcp sink: gcp_cloud_storage sink: gcp_pubsub sink: gcp_stackdriver_logs
Dominant language
Rust
Stars
22.6k
Forks
2.3k
Avg merge
1d 7h
Merged PRs (30d)
146

Description

As of PR #2351, when a GCP client running outside of the Google network is configured without credentials, it will fail with the following error message:

Apr 17 10:11:36.413 ERROR vector::topology: Configuration error: Sink "pubsub": Failed to get implicit GCP token

This error message used to indicate that no GCP credentials were configured, which is a less confusing error message.

This is happening because the same configuration, when run on a GCE instance, will be able to fetch a token from an internal hostname with no credentials.

I think the best way to check if Vector is running within GCP is to do a DNS lookup on the internal hostname and proceed with the instance token fetch if that succeeds.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PR #2351 and trace the GCP client's implicit token path used by the Pub/Sub sink. Compare behavior when credentials are missing outside GCP with token retrieval on a GCE instance, then verify that the former missing-credentials error is restored without breaking instance token fetching.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, rust
Domain
authentication, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.