{"record":{"id":"c7b85365463bd653","repo":"vitessio/vitess","slug":"findalltabletaliasesinshard-v-v-failed-v","errorCode":null,"errorMessage":"FindAllTabletAliasesInShard(%v, %v) failed: %v","messagePattern":"FindAllTabletAliasesInShard\\((.+?), (.+?)\\) failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/schema.go","lineNumber":86,"sourceCode":"\tlog.Info(fmt.Sprintf(\"Gathering schema for primary %v\", topoproto.TabletAliasString(si.PrimaryAlias)))\n\treq := &tabletmanagerdatapb.GetSchemaRequest{ExcludeTables: excludeTables, IncludeViews: includeViews}\n\tprimarySchema, err := schematools.GetSchema(ctx, wr.ts, wr.tmc, si.PrimaryAlias, req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"GetSchema(%v, nil, %v, %v) failed: %v\", si.PrimaryAlias, excludeTables, includeViews, err)\n\t}\n\n\tif includeVSchema {\n\t\terr := wr.ValidateVSchema(ctx, keyspace, []string{shard}, excludeTables, includeViews)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// read all the aliases in the shard, that is all tablets that are\n\t// replicating from the primary\n\taliases, err := wr.ts.FindAllTabletAliasesInShard(ctx, keyspace, shard)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"FindAllTabletAliasesInShard(%v, %v) failed: %v\", keyspace, shard, err)\n\t}\n\n\t// then diff with all replicas\n\ter := concurrency.AllErrorRecorder{}\n\twg := sync.WaitGroup{}\n\tfor _, alias := range aliases {\n\t\tif topoproto.TabletAliasEqual(alias, si.PrimaryAlias) {\n\t\t\tcontinue\n\t\t}\n\n\t\twg.Add(1)\n\t\tgo wr.diffSchema(ctx, primarySchema, si.PrimaryAlias, alias, excludeTables, includeViews, &wg, &er)\n\t}\n\twg.Wait()\n\tif er.HasErrors() {\n\t\treturn fmt.Errorf(\"schema diffs: %v\", er.Error().Error())\n\t}\n\treturn nil","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/schema.go#L68-L104","documentation":"Returned by ValidateSchemaShard when listing all tablet aliases in the shard via the topo (wr.ts.FindAllTabletAliasesInShard) fails. This step enumerates every tablet in the shard so their schemas can be diffed against the primary's.","triggerScenarios":"ValidateSchemaShard invocation where the topo call to list shard tablet aliases errors: topo server unavailable, shard record missing, or topo read timeout.","commonSituations":"etcd/zookeeper/consul outage; wrong topo configuration on vtctld; shard deleted between GetShard and this call; transient topo latency.","solutions":["Check topo server availability and vtctld topo flags","Retry the command — topo blips are often transient","Confirm the shard still exists in the topo (vtctldclient GetShard)","Inspect the wrapped topo error for connection/refused or permission details"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"aliases, err := ts.FindAllTabletAliasesInShard(ctx, keyspace, shard)\nif err != nil { return fmt.Errorf(\"precheck topo read failed: %w\", err) }\nif len(aliases) == 0 { return fmt.Errorf(\"no tablets found in shard\") }","typeGuard":"func shardHasTablets(ctx context.Context, ts topoclient.Server, keyspace, shard string) bool {\n    a, err := ts.FindAllTabletAliasesInShard(ctx, keyspace, shard)\n    return err == nil && len(a) > 0\n}","tryCatchPattern":"err := wr.ValidateSchemaShard(ctx, ks, shard, nil, true, false)\nif err != nil && strings.Contains(err.Error(), \"FindAllTabletAliasesInShard\") {\n    // topo transient error; back off and retry\n}","preventionTips":["Check topo health before bulk validation jobs","Retry topo reads with backoff","Watch topo latency metrics during maintenance windows"],"tags":["vitess","topo","schema-validation"],"backgroundTag":"topo-server-unavailable","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}