googleapis/mcp-toolbox · error
unable to create bigtable.NewInstanceAdminClient: %w
Error message
unable to create bigtable.NewInstanceAdminClient: %w
What it means
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.
Source
Thrown at internal/sources/bigtable/bigtable.go:250
return nil, fmt.Errorf("unable to create bigtable.NewClient: %w", err)
}
return client, nil
}
func initBigtableInstanceAdminClient(ctx context.Context, tracer trace.Tracer, name, project string) (*bigtable.InstanceAdminClient, error) {
//nolint:all // Reassigned ctx
ctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)
defer span.End()
userAgent, err := util.UserAgentFromContext(ctx)
if err != nil {
return nil, err
}
client, err := bigtable.NewInstanceAdminClient(ctx, project, option.WithUserAgent(userAgent))
if err != nil {
return nil, fmt.Errorf("unable to create bigtable.NewInstanceAdminClient: %w", err)
}
return client, nil
}
func initBigtableAdminClient(ctx context.Context, tracer trace.Tracer, name, project, instance string) (*bigtable.AdminClient, error) {
//nolint:all // Reassigned ctx
ctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)
defer span.End()
userAgent, err := util.UserAgentFromContext(ctx)
if err != nil {
return nil, err
}
client, err := bigtable.NewAdminClient(ctx, project, instance, option.WithUserAgent(userAgent))
if err != nil {
return nil, fmt.Errorf("unable to create bigtable.NewAdminClient: %w", err)View on GitHub (pinned to 8cc6e09de2)
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
Example fix
// before project: my-projec # typo // after project: my-project
Defensive patterns
Strategy: validation
Validate before calling
func preflightAdminAccess(ctx context.Context, project string) error {
if project == "" {
return fmt.Errorf("bigtable source requires a project")
}
creds, err := google.FindDefaultCredentials(ctx, "https://www.googleapis.com/auth/cloud-bigtable.admin")
if err != nil {
return fmt.Errorf("no valid credentials for bigtable admin API: %w", err)
}
_ = creds
return nil
} Try / catch
src, err := cfg.Initialize(ctx, tracer)
if err != nil {
if strings.Contains(err.Error(), "NewInstanceAdminClient") {
// project ID or credentials/network problem for the admin endpoint
}
return err
} Prevention
- 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
When it happens
Trigger: Source Initialize() calls initBigtableInstanceAdminClient, which calls bigtable.NewInstanceAdminClient(ctx, project, option.WithUserAgent(userAgent)); the constructor returns non-nil error.
Common situations: Typo in `project`; no ADC credentials in the environment; firewall/proxy blocking bigtableadmin.googleapis.com; running locally without gcloud auth configured.
Related errors
- failed to delete instance: %w
- failed to list instances: %w
- failed to get cluster: %w
- failed to list clusters: %w
- failed to create cluster: %w
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/d60575883fe4fbed.
Report an issue: GitHub.