{"record":{"id":"5e5b3761996188d3","repo":"vitessio/vitess","slug":"getvschemas-cluster-s-w","errorCode":null,"errorMessage":"GetVSchemas(cluster = %s): %w","messagePattern":"GetVSchemas\\(cluster = (.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtadmin/api.go","lineNumber":1685,"sourceCode":"\n\t\t\t\tgo func(keyspace *vtctldatapb.Keyspace) {\n\t\t\t\t\tdefer clusterWG.Done()\n\t\t\t\t\tvschema, err := c.GetVSchema(ctx, keyspace.Name)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tclusterRec.RecordError(fmt.Errorf(\"GetVSchema(keyspace = %s): %w\", keyspace.Name, err))\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tclusterM.Lock()\n\t\t\t\t\tclusterVSchemas = append(clusterVSchemas, vschema)\n\t\t\t\t\tclusterM.Unlock()\n\t\t\t\t}(keyspace)\n\t\t\t}\n\n\t\t\tclusterWG.Wait()\n\n\t\t\tif clusterRec.HasErrors() {\n\t\t\t\trec.RecordError(fmt.Errorf(\"GetVSchemas(cluster = %s): %w\", c.ID, clusterRec.Error()))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tm.Lock()\n\t\t\tvschemas = append(vschemas, clusterVSchemas...)\n\t\t\tm.Unlock()\n\t\t}(c)\n\t}\n\n\twg.Wait()\n\n\tif rec.HasErrors() {\n\t\treturn nil, rec.Error()\n\t}\n\n\treturn &vtadminpb.GetVSchemasResponse{\n\t\tVSchemas: vschemas,\n\t}, nil","sourceCodeStart":1667,"sourceCodeEnd":1703,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/api.go#L1667-L1703","documentation":"After a cluster finishes fetching all its per-keyspace vschemas, any previously recorded per-keyspace errors are collapsed into a single cluster-level error with this wrapper (\"GetVSchemas(cluster = <ID>): <aggregated>\") and recorded on the outer recorder, so one bad keyspace fails the whole cluster and the overall GetVSchemas RPC.","triggerScenarios":"Calling GetVSchemas when any c.GetVSchema call within the cluster failed (see error 795) — the aggregated clusterRec.Error() is wrapped here with the cluster ID.","commonSituations":"One or more keyspace vschemas invalid or unreadable; topo instability during the fan-out; keyspace deleted mid-request.","solutions":["Inspect the aggregated inner errors to find which keyspaces failed","Fix the failing keyspaces' vschemas in the topo (validate JSON, re-apply)","Verify topo server health and retry the request","Handle errors.ErrUnsupportedCluster separately if the cluster ID itself was wrong"],"exampleFix":"// before\nif clusterRec.HasErrors() {\n\trec.RecordError(fmt.Errorf(\"GetVSchemas(cluster = %s): %w\", c.ID, clusterRec.Error()))\n\treturn\n}\n// after: repair failing keyspaces' vschemas first, then the cluster aggregates cleanly\nif clusterRec.HasErrors() {\n\trec.RecordError(fmt.Errorf(\"GetVSchemas(cluster = %s): %w\", c.ID, clusterRec.Error()))\n\treturn\n}","handlingStrategy":"try-catch","validationCode":"// ensure all keyspaces in the cluster have readable vschemas first\nkeyspaces, _ := vtctldClient.GetKeyspaces(ctx, &vtctldatapb.GetKeyspacesRequest{})\nfor _, ks := range keyspaces.Keyspaces {\n\tif _, err := vtctldClient.GetVSchema(ctx, &vtctldatapb.GetVSchemaRequest{Keyspace: ks.Name}); err != nil {\n\t\tlog.Printf(\"keyspace %s has bad vschema: %v\", ks.Name, err)\n\t}\n}","typeGuard":"func clusterVSchemaFailed(msg string) bool { return strings.Contains(msg, \"GetVSchemas(cluster = \") }","tryCatchPattern":"resp, err := client.GetVSchemas(ctx, req)\nif err != nil {\n\tif strings.Contains(err.Error(), \"GetVSchemas(cluster = \") {\n\t\t// drill into aggregated per-keyspace causes in the message\n\t}\n\treturn err\n}","preventionTips":["Fix per-keyspace vschema errors promptly (they aggregate into cluster failures)","Validate vschema JSON before applying","Keep topo healthy during bulk reads","Consider partial-success handling for multi-keyspace clusters"],"tags":["vtadmin","vschema","aggregation","cluster"],"backgroundTag":"invalid-vschema","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}