googleapis/mcp-toolbox · error

unable to create bigtable.NewAdminClient: %w

Error message

unable to create bigtable.NewAdminClient: %w

What it means

bigtable.NewAdminClient — the table-level admin client scoped to a project AND instance — returned an error during source initialization. Like the other admin constructors, it validates identifiers and dials the admin API; failures usually mean the instance ID doesn't exist or credentials/network are misconfigured.

Source

Thrown at internal/sources/bigtable/bigtable.go:268

		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)
	}

	return client, nil
}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Confirm the instance exists: `gcloud bigtable instances list --project=<project>` and match the `instance` field exactly
  2. Validate credentials (GOOGLE_APPLICATION_CREDENTIALS / ADC) and Bigtable admin IAM roles
  3. Check network/proxy access to the Bigtable admin endpoint
  4. Retry if the failure was a transient gRPC dial error

Example fix

// before
instance: prod-instance-1   # deleted
// after
instance: prod-instance-2   # current instance ID
Defensive patterns

Strategy: validation

Validate before calling

func preflightInstanceAdmin(ctx context.Context, project, instance string) error {
	iac, err := bigtable.NewInstanceAdminClient(ctx, project)
	if err != nil {
		return err
	}
	defer iac.Close()
	_, err = iac.GetInstance(ctx, instance)
	return err // confirms the instance exists and is reachable before NewAdminClient
}

Try / catch

src, err := cfg.Initialize(ctx, tracer)
if err != nil {
	if strings.Contains(err.Error(), "NewAdminClient") {
		// verify instance exists and credentials are valid, then retry
	}
	return err
}

Prevention

When it happens

Trigger: Source Initialize() calls initBigtableAdminClient, which calls bigtable.NewAdminClient(ctx, project, instance, option.WithUserAgent(userAgent)); the constructor returns non-nil error.

Common situations: Instance deleted/renamed after config was written; instance ID typo; missing credentials; egress blocked to bigtableadmin.googleapis.com.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/1eecac5bda2b8186. Report an issue: GitHub.