{"record":{"id":"bb49055b6015b2e6","repo":"tailscale/tailscale","slug":"unexpected-unsupported-s-contents","errorCode":null,"errorMessage":"unexpected/unsupported %s contents","messagePattern":"unexpected/unsupported (.+?) contents","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clientupdate/clientupdate.go","lineNumber":582,"sourceCode":"\t\t\t\tif bytes.Equal(m, trackURLPrefix) {\n\t\t\t\t\thadCorrect = true\n\t\t\t\t} else {\n\t\t\t\t\tchanges++\n\t\t\t\t}\n\t\t\t\treturn trackURLPrefix\n\t\t\t})\n\t\t}\n\t\tbuf.Write(line)\n\t\tbuf.WriteByte('\\n')\n\t}\n\tif hadCorrect || (changes == 1 && bytes.Equal(bytes.TrimSpace(was), bytes.TrimSpace(buf.Bytes()))) {\n\t\t// Unchanged or close enough.\n\t\treturn was, nil\n\t}\n\tif changes != 1 {\n\t\t// No changes, or an unexpected number of changes (what?). Bail.\n\t\t// They probably editted it by hand and we don't know what to do.\n\t\treturn nil, fmt.Errorf(\"unexpected/unsupported %s contents\", aptSourcesFile)\n\t}\n\treturn buf.Bytes(), nil\n}\n\nfunc (up *Updater) archPackageInstalled() bool {\n\terr := exec.Command(\"pacman\", \"--query\", \"tailscale\").Run()\n\treturn err == nil\n}\n\nfunc (up *Updater) updateArchLike() error {\n\t// Arch maintainer asked us not to implement \"tailscale update\" or\n\t// auto-updates on Arch-based distros:\n\t// https://github.com/tailscale/tailscale/issues/6995#issuecomment-1687080106\n\treturn errors.New(`individual package updates are not supported on Arch-based distros, only full-system updates are: https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported.\nyou can use \"pacman --sync --refresh --sysupgrade\" or \"pacman -Syu\" to upgrade the system, including Tailscale.`)\n}\n\nfunc (up *Updater) updateNixos() error {","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/tailscale/tailscale/blob/cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042/clientupdate/clientupdate.go#L564-L600","documentation":"updateDebianAptSourcesList rewrites /etc/apt/sources.list.d/tailscale.list when switching tracks and expects its rewrite to change exactly one line (or leave the file equivalent). This error means the pass produced zero or multiple changes, so the file no longer matches the shape the updater understands; it bails instead of guessing.","triggerScenarios":"Hand-edited tailscale.list: extra deb lines, rewritten URLs, reformatted comments, or options added to the deb stanza; a file previously repaired manually after past repo changes.","commonSituations":"Admins pinning internal mirrors or adding arch filters; config management that rewrote the file; residue from older repo layouts.","solutions":["Replace the file with a single canonical line: deb https://pkgs.tailscale.com/<suite>/<track> <suite> main","Then rerun 'tailscale update'","Or manage the sources file yourself (Ansible, scripts) and stop relying on 'tailscale update' to switch tracks on Debian"],"exampleFix":"# before (/etc/apt/sources.list.d/tailscale.list)\ndeb https://pkgs.tailscale.com/stable/debian bookworm main\ndeb [arch=amd64] https://mirror.example.com/tailscale bookworm main\n\n# after\ndeb https://pkgs.tailscale.com/stable/debian bookworm main","handlingStrategy":"validation","validationCode":"func aptSourcesFileIsCanonical(path string) bool {\n\tdata, err := os.ReadFile(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\tdebLines := 0\n\tfor _, l := range strings.Split(string(data), \"\\n\") {\n\t\tif strings.HasPrefix(strings.TrimSpace(l), \"deb \") {\n\t\t\tdebLines++\n\t\t}\n\t}\n\treturn debLines == 1\n}\n\nif !aptSourcesFileIsCanonical(aptSourcesFile) {\n\t// Refuse track-switching updates; fix or manage the file manually.\n}","typeGuard":null,"tryCatchPattern":"err := up.Update()\nif err != nil && strings.Contains(err.Error(), \"unexpected/unsupported\") && strings.Contains(err.Error(), \"tailscale.list\") {\n\t// Reset the sources file to one canonical deb line, then re-run the update.\n}","preventionTips":["Keep /etc/apt/sources.list.d/tailscale.list to exactly one stock deb line","Manage repo files with config management instead of hand edits","If you must customize the file, also disable 'tailscale update' track switching to avoid the conflict"],"tags":["debian","ubuntu","clientupdate","apt","config"],"backgroundTag":null,"analyzedSha":"cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042","analyzedAt":"2026-08-15T19:58:31.583Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}