{"record":{"id":"b6671381168c7b2e","repo":"ipfs/kubo","slug":"no-stashed-binaries-found-in-s","errorCode":null,"errorMessage":"no stashed binaries found in %s","messagePattern":"no stashed binaries found in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/update.go","lineNumber":697,"sourceCode":"\t\t\treturn -1\n\t\t}\n\t\tif b.parsed.GreaterThan(a.parsed) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t})\n\n\treturn stashes, nil\n}\n\n// findLatestStash finds the most recently versioned stash file.\nfunc findLatestStash(dir string) (path, ver string, err error) {\n\tstashes, err := listStashes(dir)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"reading stash directory: %w\", err)\n\t}\n\tif len(stashes) == 0 {\n\t\treturn \"\", \"\", fmt.Errorf(\"no stashed binaries found in %s\", dir)\n\t}\n\treturn stashes[0].path, stashes[0].ver, nil\n}\n\n// replaceBinary atomically replaces the binary at targetPath with data.\nfunc replaceBinary(targetPath string, data []byte) error {\n\taf, err := atomicfile.New(targetPath, 0o755)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := af.Write(data); err != nil {\n\t\t_ = af.Abort()\n\t\treturn err\n\t}\n\n\treturn af.Close()\n}","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/update.go#L679-L715","documentation":"`findLatestStash` throws this when the stash directory was readable but contained no files matching the `ipfs-<semver>` naming convention, so there is no backed-up binary to revert to. Kubo stashes the previous binary during `ipfs update`; without one, rollback is impossible.","triggerScenarios":"`ipfs update revert` (or code paths calling findLatestStash) when no update has ever run, the stash was emptied by `ipfs update clean`, stash files were manually deleted/renamed, or only files not matching the `ipfs-<version>` pattern exist in the directory.","commonSituations":"Reverting on a fresh install; running `update clean` then trying to revert; user files placed in the stash dir that don't parse as versions; updates installed from a dist file without stashing.","solutions":["List what is actually there: `ls -la \"$IPFS_PATH/stash\"` — confirm no `ipfs-*` files exist.","If the desired version's stash file exists under a wrong name, rename it to the convention: `ipfs-<semver>` (e.g. `ipfs-0.29.0`).","If there is genuinely no stash, reinstall the target version directly (download from dist.ipfs.tech or your package manager) instead of reverting.","Avoid `ipfs update clean` if you want to keep rollback ability for the current version."],"exampleFix":"# before: stash emptied, revert impossible\nipfs update clean\nipfs update revert   # no stashed binaries found in /home/u/.ipfs/stash\n\n# after: install the desired version explicitly\nipfs update install v0.29.0","handlingStrategy":"fallback","validationCode":"entries, _ := os.ReadDir(filepath.Join(repoPath, \"stash\"))\nhasStash := false\nfor _, e := range entries {\n\tif strings.HasPrefix(e.Name(), \"ipfs-\") {\n\t\thasStash = true\n\t\tbreak\n\t}\n}\nif !hasStash {\n\t// no rollback possible: plan a direct install of the target version instead\n}","typeGuard":"func hasAnyStash(dir string) bool {\n\tentries, err := os.ReadDir(dir)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn slices.ContainsFunc(entries, func(e os.DirEntry) bool {\n\t\treturn strings.HasPrefix(e.Name(), \"ipfs-\")\n\t})\n}","tryCatchPattern":"path, ver, err := findLatestStash(dir)\nif err != nil {\n\tif strings.Contains(err.Error(), \"no stashed binaries\") {\n\t\t// fallback: download and install the desired version directly\n\t\treturn installDirectly(targetVersion)\n\t}\n\treturn err\n}","preventionTips":["Do not run `ipfs update clean` while you may still want to roll back.","Keep at least the previous version's stash file (`ipfs-<semver>`) in the stash dir.","Never store unrelated files in the stash directory; name leftovers correctly or remove them.","If reverting across major jumps, prefer `ipfs update install <version>` as the explicit fallback."],"tags":["update","rollback","stash","missing-file"],"backgroundTag":"no-stashed-binary","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}