{"record":{"id":"4a88e9431913f8f8","repo":"vitessio/vitess","slug":"vindex-name-should-be-of-the-form-keyspace-vindex","errorCode":null,"errorMessage":"vindex name should be of the form keyspace.vindex: %s","messagePattern":"vindex name should be of the form keyspace\\.vindex: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/materializer.go","lineNumber":818,"sourceCode":"\tsource := sqlescape.EscapeID(sourceVindexCol)\n\ttarget := sqlescape.EscapeID(vindexFromCol)\n\n\tfor _, line := range lines[1:] {\n\t\tif strings.Contains(line, source) {\n\t\t\tline = strings.Replace(line, source, target, 1)\n\t\t\tline = strings.Replace(line, \" AUTO_INCREMENT\", \"\", 1)\n\t\t\tline = strings.Replace(line, \" DEFAULT NULL\", \"\", 1)\n\t\t\treturn line, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"column %s not found in schema %v\", sourceVindexCol, lines)\n}\n\n// ExternalizeVindex externalizes a lookup vindex that's finished backfilling or has caught up.\nfunc (wr *Wrangler) ExternalizeVindex(ctx context.Context, qualifiedVindexName string) error {\n\tsplits := strings.Split(qualifiedVindexName, \".\")\n\tif len(splits) != 2 {\n\t\treturn fmt.Errorf(\"vindex name should be of the form keyspace.vindex: %s\", qualifiedVindexName)\n\t}\n\tsourceKeyspace, vindexName := splits[0], splits[1]\n\tsourceVSchema, err := wr.ts.GetVSchema(ctx, sourceKeyspace)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsourceVindex := sourceVSchema.Vindexes[vindexName]\n\tif sourceVindex == nil {\n\t\treturn fmt.Errorf(\"vindex %s not found in vschema\", qualifiedVindexName)\n\t}\n\n\ttargetKeyspace, targetTableName, err := wr.env.Parser().ParseTable(sourceVindex.Params[\"table\"])\n\tif err != nil || targetKeyspace == \"\" {\n\t\treturn fmt.Errorf(\"vindex table name must be in the form <keyspace>.<table>. Got: %v\", sourceVindex.Params[\"table\"])\n\t}\n\tworkflow := targetTableName + \"_vdx\"\n\ttargetShards, err := wr.ts.GetServingShards(ctx, targetKeyspace)\n\tif err != nil {","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/materializer.go#L800-L836","documentation":"ExternalizeVindex requires the vindex name to be fully qualified as keyspace.vindex. Wrangler splits the argument on '.' and rejects anything that is not exactly two parts. This ensures the code can look up the correct keyspace's VSchema before mutating it.","triggerScenarios":"Calling ExternalizeVindex (via vtctldclient ExternalizeVindex / commandExternalizeVindex) with an unqualified name like 'my_vdx', or with too many dots like 'ks1.vdx.extra'.","commonSituations":"Typing the vindex name without its keyspace prefix in the vtctldclient command; copying an example where the vindex was referenced unqualified; programmatic callers building the name by joining strings incorrectly.","solutions":["Pass the vindex name in the form keyspace.vindex, e.g. 'commerce.corder_vdx'.","Verify the string does not contain extra dots (e.g. from a fully qualified table name pasted by mistake).","Check the vschema with vtctldclient GetVSchema to confirm the exact vindex key before re-running."],"exampleFix":"// before\nwr.ExternalizeVindex(ctx, \"corder_vdx\")\n// after\nwr.ExternalizeVindex(ctx, \"commerce.corder_vdx\")","handlingStrategy":"validation","validationCode":"const name = \"commerce.corder_vdx\"\nconst parts = name.split(\".\")\nif (parts.length !== 2 || !parts[0] || !parts[1]) {\n  throw new Error(`vindex name must be keyspace.vindex: ${name}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass fully qualified keyspace.vindex names to ExternalizeVindex.","Store qualified vindex names in config/constants instead of ad-hoc strings.","Sanity-check names for stray dots before invoking the command."],"tags":["vindex","argument-validation","vreplication"],"backgroundTag":"invalid-argument-format","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}