{"record":{"id":"7e6c65e542c5e601","repo":"vitessio/vitess","slug":"uuid-not-allowed-in-s-command","errorCode":null,"errorMessage":"UUID not allowed in '%s' command","messagePattern":"UUID not allowed in '(.+?)' command","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":2994,"sourceCode":"\t\treturn err\n\t}\n\n\tfor _, uuid := range resp.UuidList {\n\t\twr.Logger().Printf(\"%s\\n\", uuid)\n\t}\n\n\treturn nil\n}\n\nfunc generateOnlineDDLQuery(command string, arg string, allSupported bool) (string, error) {\n\t// Accept inputs like so:\n\t//  \"launch\", \"all\"\n\t//  \"launch\", <uuid>\n\t//  \"launch-all\", <empty>\n\tif tokens := strings.Split(command, \"-\"); len(tokens) == 2 && tokens[1] == \"all\" {\n\t\t// command is e.g. \"launch-all\"\n\t\tif arg != \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"UUID not allowed in '%s' command\", command)\n\t\t}\n\t\t// transform \"launch-all\" into \"launch\", \"all\"\n\t\tcommand = tokens[0]\n\t\targ = \"all\"\n\t}\n\tswitch arg {\n\tcase \"\":\n\t\treturn \"\", errors.New(\"UUID|all required\")\n\tcase \"all\":\n\t\tif !allSupported {\n\t\t\treturn \"\", fmt.Errorf(\"'all' not supported for '%s' command\", command)\n\t\t}\n\t\treturn fmt.Sprintf(`alter vitess_migration %s all`, command), nil\n\tdefault:\n\t\tquery := `alter vitess_migration %a ` + command\n\t\treturn sqlparser.ParseAndBind(query, sqltypes.StringBindVariable(arg))\n\t}\n}","sourceCodeStart":2976,"sourceCodeEnd":3012,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L2976-L3012","documentation":"generateOnlineDDLQuery converts '<verb>-all' commands (e.g. 'complete-all', 'cancel-all') into the verb plus an 'all' argument. The '-all' form takes no UUID argument; supplying one is rejected because it is ambiguous — the caller probably wanted the single-UUID form.","triggerScenarios":"`vtctldclient workflow complete-all <uuid>` — mixing the all-form with a UUID argument; copying a launch <uuid> command and appending '-all' while keeping the argument.","commonSituations":"Script refactoring where a UUID variable was left in place after switching to the -all variant; misunderstanding of the two command shapes.","solutions":["Either drop the UUID: `complete-all` with empty arg, or drop '-all': `complete <uuid>`","Pick the single-UUID form if you intend to act on one migration","Pick the -all form only when acting on every migration in the workflow"],"exampleFix":"// before\nvtctldclient workflow complete-all 82fa7e00_... \n// after\nvtctldclient workflow complete-all\n// or\nvtctldclient workflow complete 82fa7e00_...","handlingStrategy":"validation","validationCode":"if strings.HasSuffix(command, \"-all\") && uuid != \"\" {\n  fail(\"-all commands take no UUID argument\")\n}","typeGuard":"func isAllForm(cmd string) bool { return strings.HasSuffix(cmd, \"-all\") }","tryCatchPattern":null,"preventionTips":["Choose one command shape: either verb+UUID or verb-all with no arg","Don't reuse single-UUID script templates for -all commands without removing the arg"],"tags":["onlineddl","argument-validation","vtctl"],"backgroundTag":"conflicting-command-arguments","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}