{"record":{"id":"850c87b47d9aa014","repo":"vitessio/vitess","slug":"vindextype-q-not-found","errorCode":null,"errorMessage":"vindexType %q not found","messagePattern":"vindexType %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtgate/vindexes/vindex.go","lineNumber":213,"sourceCode":"var registry = make(map[string]NewVindexFunc)\n\n// Register registers a vindex factory under the specified vindexType.\n// A duplicate vindexType will generate a panic.\n// New vindexes will be created using these functions at the\n// time of vschema loading.\nfunc Register(vindexType string, newVindexFunc NewVindexFunc) {\n\tif _, ok := registry[vindexType]; ok {\n\t\tpanic(vindexType + \" is already registered\")\n\t}\n\tregistry[vindexType] = newVindexFunc\n}\n\n// CreateVindex creates a vindex of the specified type using the\n// supplied params. The type must have been previously registered.\nfunc CreateVindex(vindexType, name string, params map[string]string) (vindex Vindex, err error) {\n\tf, ok := registry[vindexType]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"vindexType %q not found\", vindexType)\n\t}\n\treturn f(name, params)\n}\n\n// Map invokes the Map implementation supplied by the vindex.\nfunc Map(ctx context.Context, vindex Vindex, vcursor VCursor, rowsColValues [][]sqltypes.Value) ([]key.ShardDestination, error) {\n\tswitch vindex := vindex.(type) {\n\tcase MultiColumn:\n\t\treturn vindex.Map(ctx, vcursor, rowsColValues)\n\tcase SingleColumn:\n\t\treturn vindex.Map(ctx, vcursor, firstColsOnly(rowsColValues))\n\t}\n\treturn nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, \"vindex '%T' does not have Map function\", vindex)\n}\n\n// Verify invokes the Verify implementation supplied by the vindex.\nfunc Verify(ctx context.Context, vindex Vindex, vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte) ([]bool, error) {\n\tswitch vindex := vindex.(type) {","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtgate/vindexes/vindex.go#L195-L231","documentation":"CreateVindex looks up the requested vindex type in the process-wide vindex registry (populated by Register calls in package init()); if the type name is not registered it returns 'vindexType %q not found'. This is a vschema-configuration error: the type string in the keyspace's vschema JSON does not match any compiled-in or plugin-registered vindex.","triggerScenarios":"VSchema JSON contains a vindex with a \"type\" that is misspelled, unsupported by this Vitess build, or from a plugin that failed to load/import; calling vindexes.CreateVindex directly with an unregistered name.","commonSituations":"Typo like unicode_loose_md5hash vs unicode_loose_md5_hash; using a newer vindex type on an older VTGate; custom vindex in a separate binary that was never imported (blank import missing); case-sensitivity mistakes.","solutions":["Check the vindex type string in the vschema against the list of registered types (docs / vindexes package init() Register calls).","Fix typos in the vschema JSON and re-apply it (ApplySchema/vtctl ApplyVSchema).","Verify the VTGate binary version supports the vindex type; upgrade if it was added later.","If using a custom vindex, ensure the package is imported (blank import) into the vtgate binary you run.","Use a standard alternative (hash, binary_md5, unicode_loose_md5) if the intended type doesn't exist."],"exampleFix":"// before (vschema)\n\"vindexes\": { \"my_vdx\": { \"type\": \"unicode_loose_md5_hash\" } }\n// after\n\"vindexes\": { \"my_vdx\": { \"type\": \"unicode_loose_md5\" } }","handlingStrategy":"validation","validationCode":"// before applying vschema, check type against known registry:\n// grep -R 'Register(\"' go/vt/vtgate/vindexes/ | grep unicode_loose_md5\n// or in Go:\ntypes := []string{\"hash\",\"unicode_loose_md5\",\"unicode_loose_xxhash\",\"binary_md5\", ...}\nif !slices.Contains(types, v.Type) {\n    return fmt.Errorf(\"unknown vindex type %q before ApplyVSchema\", v.Type)\n}","typeGuard":null,"tryCatchPattern":"v, err := vindexes.CreateVindex(vType, name, params)\nif err != nil {\n    return fmt.Errorf(\"failed to create vindex %s: %w\", name, err) // 'not found' → fix vschema type\n}","preventionTips":["Validate vschema JSON against the vindex type list for your Vitess version","Pin the same Vitess version across environments","Blank-import custom vindex plugins into the vtgate binary","Keep vschema in a version-controlled template with lint checks"],"tags":["vtgate","vschema","vindex","configuration"],"backgroundTag":"vindex-type-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}