{"record":{"id":"79848896d52f6608","repo":"tailscale/tailscale","slug":"failed-tailscale-update-using-apk-w","errorCode":null,"errorMessage":"failed tailscale update using apk: %w","messagePattern":"failed tailscale update using apk: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clientupdate/clientupdate.go","lineNumber":735,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"failed checking apk for latest tailscale version: %w, output:\\n%s\", err, out)\n\t}\n\tver, err := parseAlpinePackageVersion(out)\n\tif err != nil {\n\t\treturn fmt.Errorf(`failed to parse latest version from \"apk info tailscale\": %w`, err)\n\t}\n\tif !up.confirm(ver) {\n\t\tif err := checkOutdatedAlpineRepo(up.Logf, apkDirPaths, ver, up.Track); err != nil {\n\t\t\tup.Logf(\"failed to check whether Alpine release is outdated: %v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tcmd := exec.Command(\"apk\", \"upgrade\", \"tailscale\")\n\tcmd.Stdout = up.Stdout\n\tcmd.Stderr = up.Stderr\n\tif err := cmd.Run(); err != nil {\n\t\treturn fmt.Errorf(\"failed tailscale update using apk: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc parseAlpinePackageVersion(out []byte) (string, error) {\n\ts := bufio.NewScanner(bytes.NewReader(out))\n\tvar maxVer string\n\tfor s.Scan() {\n\t\t// The line should look like this:\n\t\t// tailscale-1.44.2-r0 description:\n\t\tline := strings.TrimSpace(s.Text())\n\t\tif !strings.HasPrefix(line, \"tailscale-\") {\n\t\t\tcontinue\n\t\t}\n\t\tparts := strings.SplitN(line, \"-\", 3)\n\t\tif len(parts) < 3 {\n\t\t\treturn \"\", fmt.Errorf(\"malformed info line: %q\", line)\n\t\t}","sourceCodeStart":717,"sourceCodeEnd":753,"githubUrl":"https://github.com/tailscale/tailscale/blob/cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042/clientupdate/clientupdate.go#L717-L753","documentation":"The final step of updateAlpineLike executes 'apk upgrade tailscale' with cmd.Stdout/cmd.Stderr wired to the Updater's streams; a non-zero exit returns this error. All prior steps (index refresh, version discovery, user confirmation via up.confirm) already succeeded, so only the upgrade itself failed.","triggerScenarios":"exec.Command(\"apk\", \"upgrade\", \"tailscale\").Run() fails - unsatisfiable dependencies, no space left on disk, apk database locked by a concurrent run, or a package signature check failing.","commonSituations":"Disk full on / or /var; a partially upgraded system with conflicting dependency versions; another apk process running concurrently; broken mirrors mid-upgrade.","solutions":["Run 'sudo apk upgrade tailscale' manually - its output shows the exact dependency, space, or signature error","Free disk space ('df -h /') and clear apk caches if full","Run 'apk fix' if the database is corrupted, then retry","Resolve dependency conflicts reported by apk before retrying 'tailscale update'"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Cheap pre-flight: space and lock availability before upgrading.\nvar stat syscall.Statfs_t\nif err := syscall.Statfs(\"/\", &stat); err == nil && stat.Bavail*uint64(stat.Bsize) < 100<<20 {\n    return errors.New(\"less than 100MB free on /; apk upgrade will likely fail\")\n}","typeGuard":null,"tryCatchPattern":"if err := up.Update(); err != nil {\n    if strings.Contains(err.Error(), \"failed tailscale update using apk\") {\n        // discovery succeeded; only the upgrade failed. Safe to re-run after\n        // fixing disk space / dependencies - confirm() will not double-apply.\n    }\n}","preventionTips":["Check free disk space before scripted updates","Avoid concurrent apk operations on the same database","Keep system dependencies consistent so 'apk upgrade tailscale' can be satisfied"],"tags":["linux","alpine","apk","upgrade","package-manager"],"backgroundTag":null,"analyzedSha":"cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042","analyzedAt":"2026-08-15T19:58:31.583Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}