vitessio/vitess · error

UUID not allowed in '%s' command

Error message

UUID not allowed in '%s' command

What it means

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.

Source

Thrown at go/vt/vtctl/vtctl.go:2994

		return err
	}

	for _, uuid := range resp.UuidList {
		wr.Logger().Printf("%s\n", uuid)
	}

	return nil
}

func generateOnlineDDLQuery(command string, arg string, allSupported bool) (string, error) {
	// Accept inputs like so:
	//  "launch", "all"
	//  "launch", <uuid>
	//  "launch-all", <empty>
	if tokens := strings.Split(command, "-"); len(tokens) == 2 && tokens[1] == "all" {
		// command is e.g. "launch-all"
		if arg != "" {
			return "", fmt.Errorf("UUID not allowed in '%s' command", command)
		}
		// transform "launch-all" into "launch", "all"
		command = tokens[0]
		arg = "all"
	}
	switch arg {
	case "":
		return "", errors.New("UUID|all required")
	case "all":
		if !allSupported {
			return "", fmt.Errorf("'all' not supported for '%s' command", command)
		}
		return fmt.Sprintf(`alter vitess_migration %s all`, command), nil
	default:
		query := `alter vitess_migration %a ` + command
		return sqlparser.ParseAndBind(query, sqltypes.StringBindVariable(arg))
	}
}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Either drop the UUID: `complete-all` with empty arg, or drop '-all': `complete <uuid>`
  2. Pick the single-UUID form if you intend to act on one migration
  3. Pick the -all form only when acting on every migration in the workflow

Example fix

// before
vtctldclient workflow complete-all 82fa7e00_... 
// after
vtctldclient workflow complete-all
// or
vtctldclient workflow complete 82fa7e00_...
Defensive patterns

Strategy: validation

Validate before calling

if strings.HasSuffix(command, "-all") && uuid != "" {
  fail("-all commands take no UUID argument")
}

Type guard

func isAllForm(cmd string) bool { return strings.HasSuffix(cmd, "-all") }

Prevention

When it happens

Trigger: `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.

Common situations: Script refactoring where a UUID variable was left in place after switching to the -all variant; misunderstanding of the two command shapes.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/7e6c65e542c5e601. Report an issue: GitHub.