{"record":{"id":"e6cb5c31d04dbc33","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-impersonated-credentials-for-q-w","errorCode":null,"errorMessage":"failed to create impersonated credentials for %q with scopes %v: %w","messagePattern":"failed to create impersonated credentials for %q with scopes (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigquery/bigquery.go","lineNumber":501,"sourceCode":"\treturn s.TokenSource\n}\n\nfunc (s *Source) BigQueryTokenSourceWithScope(ctx context.Context, scopes []string) (oauth2.TokenSource, error) {\n\tif len(scopes) == 0 {\n\t\tscopes = s.Scopes\n\t\tif len(scopes) == 0 {\n\t\t\tscopes = []string{CloudPlatformScope}\n\t\t}\n\t}\n\n\tif s.ImpersonateServiceAccount != \"\" {\n\t\t// Create impersonated credentials token source with the requested scopes\n\t\tts, err := impersonate.CredentialsTokenSource(ctx, impersonate.CredentialsConfig{\n\t\t\tTargetPrincipal: s.ImpersonateServiceAccount,\n\t\t\tScopes:          scopes,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create impersonated credentials for %q with scopes %v: %w\", s.ImpersonateServiceAccount, scopes, err)\n\t\t}\n\t\treturn ts, nil\n\t}\n\treturn google.DefaultTokenSource(ctx, scopes...)\n}\n\nfunc (s *Source) GetMaxQueryResultRows() int {\n\treturn s.MaxQueryResultRows\n}\n\nfunc (s *Source) GetMaximumBytesBilled() int64 {\n\treturn s.MaximumBytesBilled\n}\n\nfunc (s *Source) BigQueryClientCreator() BigqueryClientCreator {\n\treturn s.ClientCreator\n}\n","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigquery/bigquery.go#L483-L519","documentation":"Error \"failed to create impersonated credentials for %q with scopes %v: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/bigquery/bigquery.go:501 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"}