{"record":{"id":"5c13cbb63dd28cc8","repo":"vitessio/vitess","slug":"invalid-key-value-pair","errorCode":null,"errorMessage":"invalid key:value pair","messagePattern":"invalid key:value pair","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/flagutil/flagutil.go","lineNumber":29,"sourceCode":"distributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Package flagutil contains flags that parse string lists and string\n// maps.\npackage flagutil\n\nimport (\n\t\"errors\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/spf13/pflag\"\n)\n\nvar errInvalidKeyValuePair = errors.New(\"invalid key:value pair\")\n\n// StringListValue is a []string flag that accepts a comma separated\n// list of elements. To include an element containing a comma, quote\n// it with a backslash '\\'.\ntype StringListValue []string\n\n// Get returns the []string value of this flag.\nfunc (value StringListValue) Get() any {\n\treturn []string(value)\n}\n\nfunc parseListWithEscapes(v string, delimiter rune) (value []string) {\n\tvar escaped, lastWasDelimiter bool\n\n\tcurrent := make([]rune, 0, len(v))\n\tfor _, r := range v {\n\t\tlastWasDelimiter = false\n\t\tif !escaped {","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/flagutil/flagutil.go#L11-L47","documentation":"After acquiring the topoReadPool, vtadmin calls vtctld's ShardReplicationPositions RPC. Any error returned by that RPC for a keyspace/shard is wrapped with context and recorded, and that shard's replication position is skipped.","triggerScenarios":"Calling Cluster.GetShardReplicationPositions when the vtctld RPC fails for a specific shard: unreachable vtctld, shard missing from topo, or tablet-level RPC errors inside vtctld.","commonSituations":"vtctld restarted or overloaded mid-request; shard removed between listing and querying; network partition to tablets vtctld dials; permissions/rpc auth failures.","solutions":["Inspect the wrapped cause for the underlying RPC failure and address it (vtctld health, network, topo state)","Retry the request; transient tablet dial failures are common during maintenance","Verify the shard still exists and its tablets are registered correctly in the topo server"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"resp, err := cluster.GetShardReplicationPositions(ctx, ks, shard)\nif err != nil {\n\tvar recerr interface{ Unwrap() error }\n\tif errors.As(err, &recerr) { log.Printf(\"underlying vtctld error: %v\", recerr.Unwrap()) }\n\t// fall back to partial results or retry\n}","preventionTips":["Retry transient vtctld RPC failures with backoff","Keep vtctld healthy and reachable from vtadmin","Verify shard existence in topo before per-shard queries"],"tags":["vtadmin","vtctld","rpc","replication"],"backgroundTag":"rpc-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}