{"record":{"id":"4f2bac1c819a02ee","repo":"vitessio/vitess","slug":"invalid-format-for-keyspace-workflow-s","errorCode":null,"errorMessage":"invalid format for <keyspace.workflow>: %s","messagePattern":"invalid format for <keyspace\\.workflow>: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":2625,"sourceCode":"\t\t\twr.Logger().Printf(\"\\nVDiff took %d seconds\\n\", int64(time.Since(now).Seconds()))\n\t\t}\n\t}()\n\n\t_, err = wr.VDiff(ctx, keyspace, workflow, *sourceCell, *targetCell, *tabletTypesStr, *filteredReplicationWaitTime, *format,\n\t\t*maxRows, *tables, *debugQuery, *onlyPks, *maxExtraRowsToCompare)\n\tif err != nil {\n\t\tlog.Error(fmt.Sprintf(\"vdiff returning with error: %v\", err))\n\t\tif strings.Contains(err.Error(), \"context deadline exceeded\") {\n\t\t\treturn errors.New(\"vdiff timed out: you may want to increase it with the flag --filtered_replication_wait_time=<timeoutSeconds>\")\n\t\t}\n\t}\n\treturn err\n}\n\nfunc splitKeyspaceWorkflow(in string) (keyspace, workflow string, err error) {\n\tsplits := strings.Split(in, \".\")\n\tif len(splits) != 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid format for <keyspace.workflow>: %s\", in)\n\t}\n\treturn splits[0], splits[1], nil\n}\n\nfunc commandFindAllShardsInKeyspace(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {\n\tif err := subFlags.Parse(args); err != nil {\n\t\treturn err\n\t}\n\tif subFlags.NArg() != 1 {\n\t\treturn errors.New(\"the <keyspace> argument is required for the FindAllShardsInKeyspace command\")\n\t}\n\n\tkeyspace := subFlags.Arg(0)\n\tresult, err := wr.VtctldServer().FindAllShardsInKeyspace(ctx, &vtctldatapb.FindAllShardsInKeyspaceRequest{\n\t\tKeyspace: keyspace,\n\t})\n\tif err != nil {\n\t\treturn err","sourceCodeStart":2607,"sourceCodeEnd":2643,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L2607-L2643","documentation":"splitKeyspaceWorkflow parses the positional argument for vreplication workflow commands, which must be in the form <keyspace>.<workflow> with exactly one dot separating the two parts. Any input that does not split into exactly two segments is rejected. This is a pure input-format guard.","triggerScenarios":"Passing `commerce` (missing .workflow), `commerce.reshard.extra` (extra dot), or an empty argument; keyspace or workflow names containing dots cannot be expressed in this format.","commonSituations":"Forgetting the workflow name; pasting a workflow UUID with dots; autocomplete inserting an extra segment; quoting mistakes in shell scripts.","solutions":["Provide the argument as exactly `keyspace.workflow`, e.g. `commerce.reshard`","Ensure neither part contains a '.' character","Quote the argument in shell to avoid word-splitting surprises"],"exampleFix":"// before\nvtctldclient Reshard cancel commerce\n// after\nvtctldclient Reshard cancel commerce.reshard","handlingStrategy":"validation","validationCode":"parts := strings.Split(arg, \".\")\nif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n  return errors.New(\"argument must be keyspace.workflow with no dots in either part\")\n}","typeGuard":"func parseKeyspaceWorkflow(in string) (ks, wf string, ok bool) {\n  p := strings.Split(in, \".\")\n  if len(p) != 2 || p[0] == \"\" || p[1] == \"\" { return \"\", \"\", false }\n  return p[0], p[1], true\n}","tryCatchPattern":null,"preventionTips":["Quote the keyspace.workflow argument in shell","Avoid dots in workflow names when creating them"],"tags":["argument-parsing","vtctl","input-validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}