{"record":{"id":"23908652f6a80872","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-clusters-w","errorCode":null,"errorMessage":"failed to list clusters: %w","messagePattern":"failed to list clusters: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/admin_wrappers.go","lineNumber":96,"sourceCode":"\treturn instances, nil\n}\n\nfunc (s *Source) GetCluster(ctx context.Context, instanceId, clusterId string) (any, error) {\n\tcluster, err := s.InstanceAdmin.GetCluster(ctx, instanceId, clusterId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get cluster: %w\", err)\n\t}\n\treturn cluster, nil\n}\n\nfunc (s *Source) ListClusters(ctx context.Context, instanceId string) (any, error) {\n\tclusters, err := s.InstanceAdmin.Clusters(ctx, instanceId)\n\tif err != nil {\n\t\tvar partialErr bigtable.ErrPartiallyUnavailable\n\t\tif errors.As(err, &partialErr) {\n\t\t\treturn clusters, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"failed to list clusters: %w\", err)\n\t}\n\treturn clusters, nil\n}\n\nfunc (s *Source) CreateCluster(ctx context.Context, instanceId, clusterId, zone string, numNodes int32) (any, error) {\n\tconf := &bigtable.ClusterConfig{\n\t\tInstanceID: instanceId,\n\t\tClusterID:  clusterId,\n\t\tZone:       zone,\n\t\tNumNodes:   numNodes,\n\t}\n\terr := s.InstanceAdmin.CreateCluster(ctx, conf)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create cluster: %w\", err)\n\t}\n\treturn map[string]string{\"status\": \"cluster created successfully\"}, nil\n}\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/admin_wrappers.go#L78-L114","documentation":"Raised by ListClusters when the InstanceAdmin.Clusters RPC for the given instance fails outright. Like ListInstances, partial availability (bigtable.ErrPartiallyUnavailable) is swallowed and the partial cluster list is returned; this error signals a complete failure such as a bad instance ID, missing permissions, or transport problems.","triggerScenarios":"Calling ListClusters(ctx, instanceId) with a nonexistent or misspelled instanceId (NotFound), lacking bigtable.clusters.list permission, wrong project, or non-partial transient failures of the admin API.","commonSituations":"Passing an instance name instead of its ID; the instance was deleted between calls; service account missing Bigtable roles after credential rotation; brief Google API disruption causing full (not partial) RPC failure.","solutions":["Verify the instanceId with ListInstances or `gcloud bigtable instances describe`.","Fix IAM: grant roles/bigtable.reader or roles/bigtable.admin to the caller's service account.","Confirm the admin client targets the correct project.","Retry with exponential backoff only for transient gRPC codes (Unavailable, DeadlineExceeded); log the unwrapped status code otherwise."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// before calling ListClusters\ninstances, err := src.ListInstances(ctx)\nif err != nil {\n    return fmt.Errorf(\"cannot verify instance %q: %w\", instanceId, err)\n}\n// confirm instanceId exists among instances before listing its clusters","typeGuard":"func isPartialUnavailable(err error) bool {\n    var pe bigtable.ErrPartiallyUnavailable\n    return errors.As(err, &pe)\n}","tryCatchPattern":"clusters, err := src.ListClusters(ctx, instanceId)\nif err != nil {\n    if isGRPCCode(err, codes.NotFound) {\n        return fmt.Errorf(\"instance %q not found\", instanceId)\n    }\n    // fall back to one retry before surfacing\n    if clusters, err = retryOnce(ctx, src.ListClusters, instanceId); err != nil {\n        return err\n    }\n}","preventionTips":["Confirm the instance exists (ListInstances) before listing its clusters.","Keep IAM roles current for the runtime service account.","Handle the source's partial-availability fallback rather than treating partial results as failure.","Use bounded retries with backoff for transient admin API errors."],"tags":["gcp","bigtable","admin-api","list-clusters","error-wrapping"],"backgroundTag":"bigtable-admin-api-error","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"}