{"record":{"id":"6c83f52da70d5c7c","repo":"googleapis/mcp-toolbox","slug":"failed-to-find-default-credentials-w","errorCode":null,"errorMessage":"failed to find default credentials: %w","messagePattern":"failed to find default credentials: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/alloydbadmin/alloydbadmin.go","lineNumber":81,"sourceCode":"\treturn SourceType\n}\n\nfunc (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error) {\n\tua, err := util.UserAgentFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error in User Agent retrieval: %s\", err)\n\t}\n\n\tvar client *http.Client\n\tif r.UseClientOAuth {\n\t\tclient = &http.Client{\n\t\t\tTransport: util.NewUserAgentRoundTripper(ua, http.DefaultTransport),\n\t\t}\n\t} else {\n\t\t// Use Application Default Credentials\n\t\tcreds, err := google.FindDefaultCredentials(ctx, alloydbrestapi.CloudPlatformScope)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to find default credentials: %w\", err)\n\t\t}\n\t\tbaseClient := oauth2.NewClient(ctx, creds.TokenSource)\n\t\tbaseClient.Transport = util.NewUserAgentRoundTripper(ua, baseClient.Transport)\n\t\tclient = baseClient\n\t}\n\n\tservice, err := alloydbrestapi.NewService(ctx, option.WithHTTPClient(client))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating new alloydb service: %w\", err)\n\t}\n\n\ts := &Source{\n\t\tConfig:  r,\n\t\tBaseURL: \"https://alloydb.googleapis.com\",\n\t\tService: service,\n\t}\n\n\treturn s, nil","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/alloydbadmin/alloydbadmin.go#L63-L99","documentation":"Error \"failed to find default credentials: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/alloydbadmin/alloydbadmin.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}