{"record":{"id":"aac20544e7545d3b","repo":"JanDeDobbeleer/oh-my-posh","slug":"failed-to-find-checksum-for-asset","errorCode":null,"errorMessage":"failed to find checksum for asset","messagePattern":"failed to find checksum for asset","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/upgrade/verify.go","lineNumber":133,"sourceCode":"\treturn &ed25519PubKey, nil\n}\n\nfunc validateChecksum(asset string, sha256sums, binary []byte) error {\n\tvar assetChecksum string\n\tchecksums := strings.SplitSeq(string(sha256sums), \"\\n\")\n\n\tfor line := range checksums {\n\t\tif !strings.HasSuffix(line, asset) {\n\t\t\tcontinue\n\t\t}\n\n\t\tassetChecksum = strings.Fields(line)[0]\n\t\tbreak\n\t}\n\n\tif assetChecksum == \"\" {\n\t\tlog.Debug(\"failed to find checksum for asset\")\n\t\treturn fmt.Errorf(\"failed to find checksum for asset\")\n\t}\n\n\t// calculate the checksum of the binary\n\tbinaryChecksum := fmt.Sprintf(\"%x\", sha256.Sum256(binary))\n\n\tif assetChecksum != binaryChecksum {\n\t\tlog.Debugf(\"checksum mismatch, expected: %s, got: %s\", assetChecksum, binaryChecksum)\n\t\treturn fmt.Errorf(\"checksum mismatch\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":115,"sourceCodeEnd":146,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/cli/upgrade/verify.go#L115-L146","documentation":"validateChecksum scans the downloaded SHA256SUMS content line by line looking for a checksum matching the asset filename. If no line matches (assetChecksum stays empty), it fails with this error. It means the checksums file exists but does not list the asset the updater downloaded.","triggerScenarios":"verify → downloadAndVerify → validateChecksum with a checksums file lacking a line for the target asset name — asset renamed between versions, OS/arch variant missing from the release, or the wrong (older/newer) checksums file downloaded.","commonSituations":"Upgrading to a freshly cut release where checksums.txt was uploaded before/after the asset; nightly/prerelease channels with incomplete assets; custom UPGRADE channel env var pointing at a mismatched release.","solutions":["Retry the upgrade to pick up a fully published release","Pin/choose a stable release version instead of a prerelease channel","Check the GitHub release page confirms the asset is listed in checksums.txt","Install manually via a package manager if the self-updater keeps failing"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := cli.Upgrade(); err != nil {\n    if strings.Contains(err.Error(), \"failed to find checksum for asset\") {\n        // release assets/checksums out of sync: retry later or use a stable version\n    }\n}","preventionTips":["Upgrade against stable releases, not freshly cut prereleases","Confirm the asset and checksums.txt are both published before upgrading","Keep custom upgrade-channel env vars pointing at complete releases"],"tags":["upgrade","checksum","release-assets"],"backgroundTag":"asset-checksum-not-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}