{"record":{"id":"deb0616e4970989f","repo":"googleapis/mcp-toolbox","slug":"unable-to-create-client-w-deb061","errorCode":null,"errorMessage":"unable to create client: %w","messagePattern":"unable to create client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/spanner/spanner.go","lineNumber":69,"sourceCode":"\ntype Config struct {\n\tName           string          `yaml:\"name\" validate:\"required\"`\n\tType           string          `yaml:\"type\" validate:\"required\"`\n\tProject        string          `yaml:\"project\" validate:\"required\"`\n\tInstance       string          `yaml:\"instance\" validate:\"required\"`\n\tDialect        sources.Dialect `yaml:\"dialect\" validate:\"required\"`\n\tDatabase       string          `yaml:\"database\" validate:\"required\"`\n\tUseClientOAuth bool            `yaml:\"useClientOAuth\"`\n}\n\nfunc (r Config) SourceConfigType() string {\n\treturn SourceType\n}\n\nfunc (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error) {\n\tclient, err := initSpannerClient(ctx, tracer, r.Name, r.Project, r.Instance, r.Database)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create client: %w\", err)\n\t}\n\n\tonDataplexEvict := func(key string, value interface{}) {\n\t\tif client, ok := value.(*dataplexapi.CatalogClient); ok && client != nil {\n\t\t\tclient.Close()\n\t\t}\n\t}\n\n\ts := &Source{\n\t\tConfig: r,\n\t\tClient: client,\n\t\tdataplexMgr: &searchcatalog.DataplexClientManager{\n\t\t\tUseClientOAuth: r.UseClientOAuth,\n\t\t\tCache:          sources.NewCache(onDataplexEvict),\n\t\t},\n\t}\n\treturn s, nil\n}","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/spanner/spanner.go#L51-L87","documentation":"spanner.NewClient failed during source Initialize — the Spanner client could not be created for the configured project/instance/database, usually due to missing credentials, disabled API, or an invalid database path.","triggerScenarios":"Thrown at internal/sources/spanner/spanner.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify ADC credentials and spanner API enablement","Confirm project, instance and database names are correct","Check network access to Spanner endpoints"],"exampleFix":null,"handlingStrategy":"retry","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"}