{"record":{"id":"f42ab9b61ef9c1b6","repo":"siyuan-note/siyuan","slug":"errupdatepackageunavailable","errorCode":"errUpdatePackageUnavailable","errorMessage":"update package is unavailable","messagePattern":"update package is unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/updater.go","lineNumber":59,"sourceCode":"\t\treturn \"\"\n\t}\n\n\tdownloadPkgURLs, checksum, err := getUpdatePkg()\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\tpkg := path.Base(downloadPkgURLs[0])\n\tpkgPath := filepath.Join(util.TempDir, \"install\", pkg)\n\tlocalChecksum, _ := sha256Hash(pkgPath)\n\tif checksum != localChecksum {\n\t\treturn \"\"\n\t}\n\treturn pkgPath\n}\n\nvar checkDownloadInstallPkgLock = sync.Mutex{}\nvar errUpdatePackageUnavailable = errors.New(\"update package is unavailable\")\n\nfunc checkDownloadInstallPkg(notifyPackageUnavailable bool) {\n\tdefer logging.Recover()\n\n\tif skipNewVerInstallPkg() {\n\t\treturn\n\t}\n\n\tif !checkDownloadInstallPkgLock.TryLock() {\n\t\treturn\n\t}\n\tdefer checkDownloadInstallPkgLock.Unlock()\n\n\tdownloadPkgURLs, checksum, err := getUpdatePkg()\n\tif err != nil {\n\t\tif notifyPackageUnavailable && errors.Is(err, errUpdatePackageUnavailable) {\n\t\t\tif release, releaseErr := getUpdateRelease(false); nil == releaseErr && !isVersionUpToDate(release.Version) {\n\t\t\t\tpushNewVersionNotification(release)","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/updater.go#L41-L77","documentation":"errUpdatePackageUnavailable is the internal sentinel error meaning the update installer package cannot be obtained: either the current platform has no matching install package name, or the download URLs/checksum lookup failed. checkDownloadInstallPkg and getUpdatePkg wrap it, and the auto-update path downgrades to pushing a 'new version available' notification instead of installing.","triggerScenarios":"checkDownloadInstallPkg running when the release feed has no package matching the current OS/arch (currentInstallPackageName returns \"\"), or getUpdatePkg failing to resolve/verify download URLs and checksum for the update package.","commonSituations":"Running on an unsupported platform or packaging (e.g. self-built binary, Linux distro package) where no official installer exists; CDN/network failure making package URLs unreachable; a newly released version whose package metadata is not yet published.","solutions":["Verify the platform/packaging is one with official installers; update manually from the release page if no auto package exists for your build","Check network/proxy access to the update CDN and retry; transient failures resolve on the next check","If a new version just shipped, wait for the package to be published and re-run the update check","Handle errors.Is(err, errUpdatePackageUnavailable) by falling back to pushNewVersionNotification so users still learn about the new version"],"exampleFix":"// before\npkgName := currentInstallPackageName(release.Version)\nerr = fmt.Errorf(\"package lookup failed: %v\", err)\n// after\npkgName := currentInstallPackageName(release.Version)\nif \"\" == pkgName {\n    err = fmt.Errorf(\"%w for the current platform\", errUpdatePackageUnavailable)\n    return\n}","handlingStrategy":"fallback","validationCode":"release, err := getUpdateRelease(false)\nif err == nil && currentInstallPackageName(release.Version) == \"\" {\n    // no package for this platform; skip auto-install\n}","typeGuard":null,"tryCatchPattern":"if _, err := getUpdatePkg(); errors.Is(err, errUpdatePackageUnavailable) {\n    pushNewVersionNotification(release) // degrade to notification\n    return\n}","preventionTips":["Check platform/packaging support before enabling auto-update","Handle transient CDN failures with a retry/backoff","Fall back to a 'new version available' notification when the package is missing"],"tags":["go","update","download","platform"],"backgroundTag":"resource-not-found","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}