{"record":{"id":"d60575883fe4fbed","repo":"googleapis/mcp-toolbox","slug":"unable-to-create-bigtable-newinstanceadminclient","errorCode":null,"errorMessage":"unable to create bigtable.NewInstanceAdminClient: %w","messagePattern":"unable to create bigtable\\.NewInstanceAdminClient: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/bigtable.go","lineNumber":250,"sourceCode":"\t\treturn nil, fmt.Errorf(\"unable to create bigtable.NewClient: %w\", err)\n\t}\n\n\treturn client, nil\n}\n\nfunc initBigtableInstanceAdminClient(ctx context.Context, tracer trace.Tracer, name, project string) (*bigtable.InstanceAdminClient, error) {\n\t//nolint:all // Reassigned ctx\n\tctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)\n\tdefer span.End()\n\n\tuserAgent, err := util.UserAgentFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient, err := bigtable.NewInstanceAdminClient(ctx, project, option.WithUserAgent(userAgent))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create bigtable.NewInstanceAdminClient: %w\", err)\n\t}\n\n\treturn client, nil\n}\n\nfunc initBigtableAdminClient(ctx context.Context, tracer trace.Tracer, name, project, instance string) (*bigtable.AdminClient, error) {\n\t//nolint:all // Reassigned ctx\n\tctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)\n\tdefer span.End()\n\n\tuserAgent, err := util.UserAgentFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient, err := bigtable.NewAdminClient(ctx, project, instance, option.WithUserAgent(userAgent))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create bigtable.NewAdminClient: %w\", err)","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/bigtable.go#L232-L268","documentation":"bigtable.NewInstanceAdminClient failed during source initialization. This admin client manages instance-level operations against the Bigtable admin endpoint for the given project. Failure typically means invalid project ID, missing/invalid credentials, or no network path to the admin API.","triggerScenarios":"Source Initialize() calls initBigtableInstanceAdminClient, which calls bigtable.NewInstanceAdminClient(ctx, project, option.WithUserAgent(userAgent)); the constructor returns non-nil error.","commonSituations":"Typo in `project`; no ADC credentials in the environment; firewall/proxy blocking bigtableadmin.googleapis.com; running locally without gcloud auth configured.","solutions":["Verify the `project` field is a valid GCP project ID containing the Bigtable instance","Configure Application Default Credentials (GOOGLE_APPLICATION_CREDENTIALS or gcloud auth application-default login)","Check network access to bigtableadmin.googleapis.com","Confirm the service account has Bigtable admin permissions on the project"],"exampleFix":"// before\nproject: my-projec   # typo\n// after\nproject: my-project","handlingStrategy":"validation","validationCode":"func preflightAdminAccess(ctx context.Context, project string) error {\n\tif project == \"\" {\n\t\treturn fmt.Errorf(\"bigtable source requires a project\")\n\t}\n\tcreds, err := google.FindDefaultCredentials(ctx, \"https://www.googleapis.com/auth/cloud-bigtable.admin\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"no valid credentials for bigtable admin API: %w\", err)\n\t}\n\t_ = creds\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"src, err := cfg.Initialize(ctx, tracer)\nif err != nil {\n\tif strings.Contains(err.Error(), \"NewInstanceAdminClient\") {\n\t\t// project ID or credentials/network problem for the admin endpoint\n\t}\n\treturn err\n}","preventionTips":["Validate the project ID format (6-30 lowercase letters/digits/hyphens) before configuring","Ensure the runtime identity has bigtable admin scope/roles","Confirm egress to bigtableadmin.googleapis.com in restricted networks","Keep ADC configured on all environments running the toolbox"],"tags":["gcp","bigtable","authentication","admin-api"],"backgroundTag":"client-initialization-failed","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"}