Skip to content

auth v0.18.0: "multiple credential options provided" when GOOGLE_APPLICATION_CREDENTIALS is set #13503

@maximelb

Description

@maximelb

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)

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions