{"record":{"id":"dbff1e428ac9ae95","repo":"vitessio/vitess","slug":"v-please-provide-a-valid-uuid","errorCode":null,"errorMessage":"%v, please provide a valid UUID","messagePattern":"(.+?), please provide a valid UUID","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vdiff2.go","lineNumber":141,"sourceCode":"\t\t},\n\t\tReportOptions: &tabletmanagerdatapb.VDiffReportOptions{\n\t\t\tOnlyPks:       *onlyPks,\n\t\t\tDebugQuery:    *debugQuery,\n\t\t\tFormat:        format,\n\t\t\tMaxSampleRows: 10,\n\t\t},\n\t}\n\n\tvar vdiffUUID uuid.UUID\n\tswitch action {\n\tcase vdiff.CreateAction:\n\t\tif actionArg != \"\" {\n\t\t\tvdiffUUID, err = uuid.Parse(actionArg)\n\t\t} else {\n\t\t\tvdiffUUID, err = uuid.NewUUID()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"%v, please provide a valid UUID\", err)\n\t\t}\n\tcase vdiff.ShowAction:\n\t\tswitch actionArg {\n\t\tcase vdiff.AllActionArg, vdiff.LastActionArg:\n\t\tdefault:\n\t\t\tvdiffUUID, err = uuid.Parse(actionArg)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"can only show a specific vdiff, please provide a valid UUID; view all with: VDiff -- %s.%s show all\", keyspace, workflowName)\n\t\t\t}\n\t\t}\n\tcase vdiff.StopAction, vdiff.ResumeAction:\n\t\tvdiffUUID, err = uuid.Parse(actionArg)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"can only %s a specific vdiff, please provide a valid UUID; view all with: VDiff -- %s.%s show all\", action, keyspace, workflowName)\n\t\t}\n\tcase vdiff.DeleteAction:\n\t\tswitch actionArg {\n\t\tcase vdiff.AllActionArg:","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vdiff2.go#L123-L159","documentation":"For VDiff create/show actions, the optional third argument may be a UUID identifying a prior diff run. When it is supplied, commandVDiff2 parses it with uuid.Parse; a malformed UUID returns '%v, please provide a valid UUID'.","triggerScenarios":"`VDiff -- ks.wf show <text>` or `create <text>` where the third argument is not a canonical UUID (wrong length, missing hyphens, non-hex characters), so uuid.Parse fails and the wrapped error is returned.","commonSituations":"Truncating a UUID when copying from logs; passing a friendly name or shard key where a UUID is expected; passing 'all'/'last' to `create` (those keywords are only accepted for `show`); quoting issues stripping characters in the shell.","solutions":["Get a valid UUID from `VDiff -- ks.wf show all` output and pass it verbatim.","For show, use the keywords `all` or `last` instead of a partial UUID.","Check for shell mangling — quote the UUID argument.","If you meant to start a new diff, omit the third argument entirely; create generates a fresh UUID via uuid.NewUUID()."],"exampleFix":"// before\nVDiff -- commerce.sell show 6ba7b810-9dad-11d1-80b4  # truncated\n// after\nVDiff -- commerce.sell show 6ba7b810-9dad-11d1-80b4-00c04fd430c8","handlingStrategy":"validation","validationCode":"if _, err := uuid.Parse(candidate); err != nil {\n    return fmt.Errorf(\"%q is not a valid UUID\", candidate)\n}","typeGuard":"func isUUID(s string) bool { _, err := uuid.Parse(s); return err == nil }","tryCatchPattern":"if err := runVDiff(args); err != nil {\n    if strings.Contains(err.Error(), \"please provide a valid UUID\") {\n        out, _ := runVDiff([]string{\"ks.wf\", \"show\", \"all\"})\n        log.Warn(\"resolve UUID from full listing\", slog.String(\"listing\", out))\n    }\n}","preventionTips":["Copy full UUIDs without truncation; quote them in the shell.","Use show all / show last keywords instead of guessing UUID prefixes.","Omit the third arg on create to let the tool mint a fresh UUID."],"tags":["vtctl","vdiff","uuid-validation"],"backgroundTag":"invalid-uuid-format","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}