siyuan-note/siyuan · warning
errUpdatePackageUnavailable
errUpdatePackageUnavailable
Error message
update package is unavailable
What it means
errUpdatePackageUnavailable is a sentinel in the model package's updater meaning no downloadable update install package could be resolved — either there is no package defined for the current platform or the release entry for the package is missing/has no URLs. checkDownloadInstallPkg and getUpdatePkg return it (often wrapped via %w) so callers can distinguish 'nothing to download' from transient network failures.
Solutions
- Verify a release asset matching your platform exists on the update server/GitHub release
- Skip auto-download for unsupported platforms (set the appropriate skip option) and update manually from the release page
- Check the updater's package-name mapping (currentInstallPackageName) covers your OS/arch
- Match with errors.Is(err, errUpdatePackageUnavailable) to show 'package not available for your platform' rather than a generic network error
Example fix
// before
if err := getUpdatePkg(); err != nil { notifyNetworkError() }
// after
if errors.Is(err, errUpdatePackageUnavailable) {
pushNewVersionNotification(release) // 提示手动下载
} else if err != nil {
notifyNetworkError()
} Defensive patterns
Strategy: fallback
Validate before calling
const supported = {win32: true, darwin: true, linux: true}; if (!supported[process.platform]) skipAutoUpdate() Type guard
func isPkgUnavailable(err error) bool { return errors.Is(err, errUpdatePackageUnavailable) } Try / catch
if err != nil {
if errors.Is(err, errUpdatePackageUnavailable) {
pushNewVersionNotification(release) // 手动下载提示
return
}
logging.LogErrorf("check update failed: %s", err)
} Prevention
- Confirm your platform/arch has a published release asset
- Disable auto package download on unofficial builds
- Always branch on the sentinel with errors.Is instead of string matching
When it happens
Trigger: Auto-update check (checkDownloadInstallPkg) or getNewVerInstallPkgPath on a platform for which the GitHub release publishes no install package, or where release.Packages has no entry/URLs for the computed package name.
Common situations: Running an unofficial build or a platform/arch the official release doesn't ship (e.g. unusual Linux distro packaging); a partially published release missing assets; CDN/GitHub asset URLs stripped or blocked.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- update package URL or checksum is empty
- verify checksum failed, download install package
- version is up to date
- : [ ] checksum is unavailable
- 346
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/f42ab9b61ef9c1b6.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/updater.go:59
return ""
}
downloadPkgURLs, checksum, err := getUpdatePkg()
if err != nil {
return ""
}
pkg := path.Base(downloadPkgURLs[0])
pkgPath := filepath.Join(util.TempDir, "install", pkg)
localChecksum, _ := sha256Hash(pkgPath)
if checksum != localChecksum {
return ""
}
return pkgPath
}
var checkDownloadInstallPkgLock = sync.Mutex{}
var errUpdatePackageUnavailable = errors.New("update package is unavailable")
func checkDownloadInstallPkg(notifyPackageUnavailable bool) {
defer logging.Recover()
if skipNewVerInstallPkg() {
return
}
if !checkDownloadInstallPkgLock.TryLock() {
return
}
defer checkDownloadInstallPkgLock.Unlock()
downloadPkgURLs, checksum, err := getUpdatePkg()
if err != nil {
if notifyPackageUnavailable && errors.Is(err, errUpdatePackageUnavailable) {
if release, releaseErr := getUpdateRelease(false); nil == releaseErr && !isVersionUpToDate(release.Version) {
pushNewVersionNotification(release)View on GitHub (pinned to 9f775e8a12)