{"record":{"id":"010057970f6b5c1e","repo":"tailscale/tailscale","slug":"cannot-specify-both-version-and-track","errorCode":null,"errorMessage":"cannot specify both --version and --track","messagePattern":"cannot specify both --version and --track","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/tailscale/cli/update.go","lineNumber":87,"sourceCode":"}\n\nconst gokrazyUpdateFromURLMagicArg = \"--gokrazy-update-from-url\"\n\nfunc runUpdate(ctx context.Context, args []string) error {\n\tif len(args) > 0 {\n\t\tif runtime.GOOS == \"linux\" && distro.Get() == distro.Gokrazy {\n\t\t\tgokArgs, err := gokrazyUpdateArgsFromMagicArg(args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif gokArgs != nil {\n\t\t\t\treturn clientupdate.GokrazyUpdateFromURL.Get()(ctx, *gokArgs)\n\t\t\t}\n\t\t}\n\t\treturn flag.ErrHelp\n\t}\n\tif updateArgs.version != \"\" && updateArgs.track != \"\" {\n\t\treturn errors.New(\"cannot specify both --version and --track\")\n\t}\n\terr := clientupdate.Update(clientupdate.Arguments{\n\t\tVersion: updateArgs.version,\n\t\tTrack:   updateArgs.track,\n\t\tLogf:    func(f string, a ...any) { printf(f+\"\\n\", a...) },\n\t\tStdout:  Stdout,\n\t\tStderr:  Stderr,\n\t\tConfirm: confirmUpdate,\n\t})\n\tif errors.Is(err, errors.ErrUnsupported) {\n\t\treturn errors.New(\"The 'update' command is not supported on this platform; see https://tailscale.com/s/client-updates\")\n\t}\n\treturn err\n}\n\nfunc confirmUpdate(ver string) bool {\n\tif updateArgs.yes {\n\t\tfmt.Printf(\"Updating Tailscale from %v to %v; --yes given, continuing without prompts.\\n\", version.Short(), ver)","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/tailscale/tailscale/blob/cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042/cmd/tailscale/cli/update.go#L69-L105","documentation":"The update command accepts either --version <x.y.z> (pin an exact version) or --track <stable|unstable|...> (follow a channel), never both; runUpdate returns this error when updateArgs.version and updateArgs.track are both non-empty before calling clientupdate.Update.","triggerScenarios":"Running `tailscale update --version 1.62.0 --track stable`; flags parsed from config, alias, or wrapper scripts supplying both.","commonSituations":"Wrapper scripts appending --track while an operator added --version; copy-paste combining flags from two docs examples; automation defaults injecting --track with an explicit pin.","solutions":["Keep exactly one: `tailscale update --version 1.62.0` or `tailscale update --track stable`","Run bare `tailscale update` to update within the current track","Audit shell aliases/scripts that auto-append --track"],"exampleFix":"# before\n$ tailscale update --version 1.62.0 --track stable\n# after\n$ tailscale update --version 1.62.0","handlingStrategy":"validation","validationCode":"if updateArgs.version != \"\" && updateArgs.track != \"\" {\n    return errors.New(\"specify either --version or --track, not both\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep update flag templating single-source in scripts","Default to bare `tailscale update` for channel-following","Lint wrappers that append --track unconditionally"],"tags":["cli","update","usage","argument-validation"],"backgroundTag":null,"analyzedSha":"cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042","analyzedAt":"2026-08-15T19:58:31.583Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}