{"record":{"id":"138497c74c455ad9","repo":"vitessio/vitess","slug":"unknown-tablettype-v","errorCode":null,"errorMessage":"unknown TabletType %v","messagePattern":"unknown TabletType (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/topo/topoproto/tablet.go","lineNumber":177,"sourceCode":"\n// AllTabletTypes lists all the possible tablet types\nvar AllTabletTypes = []topodatapb.TabletType{\n\ttopodatapb.TabletType_PRIMARY,\n\ttopodatapb.TabletType_REPLICA,\n\ttopodatapb.TabletType_RDONLY,\n\ttopodatapb.TabletType_BATCH,\n\ttopodatapb.TabletType_SPARE,\n\ttopodatapb.TabletType_EXPERIMENTAL,\n\ttopodatapb.TabletType_BACKUP,\n\ttopodatapb.TabletType_RESTORE,\n\ttopodatapb.TabletType_DRAINED,\n}\n\n// ParseTabletType parses the tablet type into the enum.\nfunc ParseTabletType(param string) (topodatapb.TabletType, error) {\n\tvalue, ok := topodatapb.TabletType_value[strings.ToUpper(param)]\n\tif !ok {\n\t\treturn topodatapb.TabletType_UNKNOWN, fmt.Errorf(\"unknown TabletType %v\", param)\n\t}\n\treturn topodatapb.TabletType(value), nil\n}\n\n// ParseTabletTypes parses a comma separated list of tablet types and returns a slice with the respective enums.\nfunc ParseTabletTypes(param string) ([]topodatapb.TabletType, error) {\n\tvar tabletTypes []topodatapb.TabletType\n\tif param == \"\" {\n\t\treturn tabletTypes, nil\n\t}\n\tfor typeStr := range strings.SplitSeq(param, \",\") {\n\t\tt, err := ParseTabletType(typeStr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttabletTypes = append(tabletTypes, t)\n\t}\n\treturn tabletTypes, nil","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/topo/topoproto/tablet.go#L159-L195","documentation":"ParseTabletType could not map the input string to a topodatapb.TabletType enum value. Valid types include PRIMARY, REPLICA, RDONLY, SPARE, BACKUP, RESTORE, DRAINED, EXPERIMENTAL (case-insensitive). This is a client-side validation error before any topo operation.","triggerScenarios":"Passing an unrecognized string to ParseTabletType — via vtctldclient ChangeTabletType, SetShardTabletControl, or parsing destination types — e.g. 'master' on a version expecting 'PRIMARY', 'readonly' (should be RDONLY), empty string.","commonSituations":"Using the pre-Vitess-9 term 'master' with newer tooling or vice versa; abbreviating 'replica' as 'r'; lowercase config values that should still work (they do — case-insensitive) but misspellings do not; shell variables expanding empty.","solutions":["Use an exact valid type name: PRIMARY, REPLICA, RDONLY, SPARE, BACKUP, RESTORE, DRAINED","If migrating from older Vitess, replace 'master' with 'PRIMARY' (or the version-appropriate term)","Verify shell variables actually contain the type value (echo before running)"],"exampleFix":"// before\nvtctldclient ChangeTabletType zone1-100 master\n// after\nvtctldclient ChangeTabletType zone1-100 primary","handlingStrategy":"validation","validationCode":"switch strings.ToUpper(tt) {\ncase \"PRIMARY\", \"REPLICA\", \"RDONLY\", \"SPARE\", \"BACKUP\", \"RESTORE\", \"DRAINED\", \"EXPERIMENTAL\":\n    // ok\ndefault:\n    return fmt.Errorf(\"unknown tablet type %q\", tt)\n}","typeGuard":"func isValidTabletType(s string) bool {\n    _, ok := topodatapb.TabletType_value[strings.ToUpper(s)]\n    return ok\n}","tryCatchPattern":"tt, err := topoproto.ParseTabletType(typeFlag)\nif err != nil {\n    return fmt.Errorf(\"bad type %q: %w\", typeFlag, err)\n}","preventionTips":["Use canonical names: PRIMARY (not master), RDONLY (not readonly/batch)","Call ParseTabletType early in scripts to fail fast","Consult topodatapb.TabletType_value for the exact set in your version"],"tags":["topo","tablet-type","cli-validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}