tailscale/tailscale · error

cannot specify both --version and --track

Error message

cannot specify both --version and --track

What it means

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.

Source

Thrown at cmd/tailscale/cli/update.go:87

}

const gokrazyUpdateFromURLMagicArg = "--gokrazy-update-from-url"

func runUpdate(ctx context.Context, args []string) error {
	if len(args) > 0 {
		if runtime.GOOS == "linux" && distro.Get() == distro.Gokrazy {
			gokArgs, err := gokrazyUpdateArgsFromMagicArg(args)
			if err != nil {
				return err
			}
			if gokArgs != nil {
				return clientupdate.GokrazyUpdateFromURL.Get()(ctx, *gokArgs)
			}
		}
		return flag.ErrHelp
	}
	if updateArgs.version != "" && updateArgs.track != "" {
		return errors.New("cannot specify both --version and --track")
	}
	err := clientupdate.Update(clientupdate.Arguments{
		Version: updateArgs.version,
		Track:   updateArgs.track,
		Logf:    func(f string, a ...any) { printf(f+"\n", a...) },
		Stdout:  Stdout,
		Stderr:  Stderr,
		Confirm: confirmUpdate,
	})
	if errors.Is(err, errors.ErrUnsupported) {
		return errors.New("The 'update' command is not supported on this platform; see https://tailscale.com/s/client-updates")
	}
	return err
}

func confirmUpdate(ver string) bool {
	if updateArgs.yes {
		fmt.Printf("Updating Tailscale from %v to %v; --yes given, continuing without prompts.\n", version.Short(), ver)

View on GitHub (pinned to cfe32b8be6)

Solutions

  1. Keep exactly one: `tailscale update --version 1.62.0` or `tailscale update --track stable`
  2. Run bare `tailscale update` to update within the current track
  3. Audit shell aliases/scripts that auto-append --track

Example fix

# before
$ tailscale update --version 1.62.0 --track stable
# after
$ tailscale update --version 1.62.0
Defensive patterns

Strategy: validation

Validate before calling

if updateArgs.version != "" && updateArgs.track != "" {
    return errors.New("specify either --version or --track, not both")
}

Prevention

When it happens

Trigger: Running `tailscale update --version 1.62.0 --track stable`; flags parsed from config, alias, or wrapper scripts supplying both.

Common situations: 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.

Related errors


AI-assisted analysis of tailscale/tailscale@cfe32b8be6 (2026-08-15). Data as JSON: /api/errors/010057970f6b5c1e. Report an issue: GitHub.