vitessio/vitess · error
vindexType %q not found
Error message
vindexType %q not found
What it means
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.
Source
Thrown at go/vt/vtgate/vindexes/vindex.go:213
var registry = make(map[string]NewVindexFunc)
// Register registers a vindex factory under the specified vindexType.
// A duplicate vindexType will generate a panic.
// New vindexes will be created using these functions at the
// time of vschema loading.
func Register(vindexType string, newVindexFunc NewVindexFunc) {
if _, ok := registry[vindexType]; ok {
panic(vindexType + " is already registered")
}
registry[vindexType] = newVindexFunc
}
// CreateVindex creates a vindex of the specified type using the
// supplied params. The type must have been previously registered.
func CreateVindex(vindexType, name string, params map[string]string) (vindex Vindex, err error) {
f, ok := registry[vindexType]
if !ok {
return nil, fmt.Errorf("vindexType %q not found", vindexType)
}
return f(name, params)
}
// Map invokes the Map implementation supplied by the vindex.
func Map(ctx context.Context, vindex Vindex, vcursor VCursor, rowsColValues [][]sqltypes.Value) ([]key.ShardDestination, error) {
switch vindex := vindex.(type) {
case MultiColumn:
return vindex.Map(ctx, vcursor, rowsColValues)
case SingleColumn:
return vindex.Map(ctx, vcursor, firstColsOnly(rowsColValues))
}
return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "vindex '%T' does not have Map function", vindex)
}
// Verify invokes the Verify implementation supplied by the vindex.
func Verify(ctx context.Context, vindex Vindex, vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte) ([]bool, error) {
switch vindex := vindex.(type) {View on GitHub (pinned to 01a25a7d17)
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.
Example fix
// before (vschema)
"vindexes": { "my_vdx": { "type": "unicode_loose_md5_hash" } }
// after
"vindexes": { "my_vdx": { "type": "unicode_loose_md5" } } Defensive patterns
Strategy: validation
Validate before calling
// before applying vschema, check type against known registry:
// grep -R 'Register("' go/vt/vtgate/vindexes/ | grep unicode_loose_md5
// or in Go:
types := []string{"hash","unicode_loose_md5","unicode_loose_xxhash","binary_md5", ...}
if !slices.Contains(types, v.Type) {
return fmt.Errorf("unknown vindex type %q before ApplyVSchema", v.Type)
} Try / catch
v, err := vindexes.CreateVindex(vType, name, params)
if err != nil {
return fmt.Errorf("failed to create vindex %s: %w", name, err) // 'not found' → fix vschema type
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- BuildKeyspace(%v) failed: %v
- region_bytes must be 1 or 2: %v
- one or two tables must be specified
- at least one table must be specified
- vindex is in write-only mode
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/850c87b47d9aa014.
Report an issue: GitHub.