Client
All clients (monitoring, storage, bigtable, etc.)
Environment
- GKE with service account key file mounted as secret
GOOGLE_APPLICATION_CREDENTIALS=/run/secrets/google/key.json
$ go version: go1.24.9 linux/amd64
Code and Dependencies
package main
import (
"context"
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
)
func main() {
// Fails with: "dialing: multiple credential options provided"
client, err := monitoring.NewMetricClient(context.Background())
if err != nil {
panic(err)
}
defer client.Close()
}
go.mod
module example
go 1.24.9
require (
cloud.google.com/go/monitoring v1.24.3
)
// Indirect dep that causes the issue:
// cloud.google.com/go/auth v0.18.0
Expected behavior
Client initializes successfully when GOOGLE_APPLICATION_CREDENTIALS is set, as it did with cloud.google.com/go/auth v0.17.0.
Actual behavior
Client creation fails with:
dialing: multiple credential options provided
Error originates from google.golang.org/api/internal/settings.go validation.
Additional context
- Works with
cloud.google.com/go/auth v0.17.0
- Breaks with
cloud.google.com/go/auth v0.18.0 (released Dec 15, 2025)
- Affects all Google Cloud clients when
GOOGLE_APPLICATION_CREDENTIALS is set
- The new auth library appears to detect credentials via both old (
CredentialsFile) and new (AuthCredentialsFile) paths simultaneously, triggering validation that rejects multiple credential sources
- Workaround:
replace cloud.google.com/go/auth => cloud.google.com/go/auth v0.17.0 (untenable for large codebases)
Client
All clients (monitoring, storage, bigtable, etc.)
Environment
GOOGLE_APPLICATION_CREDENTIALS=/run/secrets/google/key.json$ go version: go1.24.9 linux/amd64Code and Dependencies
go.mod
Expected behavior
Client initializes successfully when
GOOGLE_APPLICATION_CREDENTIALSis set, as it did withcloud.google.com/go/authv0.17.0.Actual behavior
Client creation fails with:
Error originates from
google.golang.org/api/internal/settings.govalidation.Additional context
cloud.google.com/go/authv0.17.0cloud.google.com/go/authv0.18.0 (released Dec 15, 2025)GOOGLE_APPLICATION_CREDENTIALSis setCredentialsFile) and new (AuthCredentialsFile) paths simultaneously, triggering validation that rejects multiple credential sourcesreplace cloud.google.com/go/auth => cloud.google.com/go/auth v0.17.0(untenable for large codebases)