siyuan-note/siyuan · error · ErrLocalBazaarPackageIncompatible
ErrLocalBazaarPackageIncompatible
ErrLocalBazaarPackageIncompatible
Error message
marketplace package is incompatible
What it means
Sentinel error ErrLocalBazaarPackageIncompatible, returned by InstallLocalBazaarPackage when the package is incompatible with the running app: either the package's MinAppVersion is above the current app version (also wrapped with the required version, see error 496), or for plugins/themes the frontend/backend compatibility check (bazaar.IsIncompatiblePlugin / IsIncompatibleTheme) fails. It is also used as a wrapping base for the version-required message.
Source
Thrown at kernel/model/bazaar.go:111
}
// ThemeInstallOptions 描述新安装主题后需要应用的外观模式
type ThemeInstallOptions struct {
Mode int
ModeOS bool
}
// LocalBazaarPackageInstallResult 描述本地集市包的识别和安装结果。
type LocalBazaarPackageInstallResult struct {
PackageType string `json:"packageType"`
PackageName string `json:"packageName"`
MinAppVersion string `json:"minAppVersion,omitempty"`
Updated bool `json:"updated"`
}
var (
ErrLocalBazaarPackageExists = errors.New("marketplace package already exists")
ErrLocalBazaarPackageIncompatible = errors.New("marketplace package is incompatible")
localBazaarInstallLock sync.Mutex
)
// updatePackages 更新一组集市包;同类型批量更新时,安装后处理只执行一次
func updatePackages(packages []*UpdatedPackage, pkgType string, successCount, failedCount *int, planned int) {
items := make([]batchInstallItem, 0, len(packages))
for _, updated := range packages {
pkg := updated.Available
meta, err := installBazaarPackage(pkgType, pkg.RepoURL, pkg.RepoHash, pkg.Name)
if err != nil {
logging.LogErrorf("update %s [%s] failed: %s", pkgType, pkg.Name, err)
util.PushErrMsg(fmt.Sprintf(Conf.language(238), pkg.Name), 5000)
*failedCount++
continue
}
items = append(items, batchInstallItem{name: pkg.Name, meta: meta})
*successCount++
util.PushEndlessProgress(fmt.Sprintf(Conf.language(236), *successCount+*failedCount, planned, pkg.Name))View on GitHub (pinned to 251596fc0d)
Solutions
- Update SiYuan to at least the package's MinAppVersion and retry the install.
- If the package targets a different frontend (mobile vs desktop), install it on the matching frontend.
- Check errors.Is(err, model.ErrLocalBazaarPackageIncompatible) and surface the required version to the user.
Defensive patterns
Strategy: validation
Validate before calling
// Pre-check version and frontend compatibility before installing.
if bazaar.IsBelowRequiredAppVersion(pkg) {
return fmt.Errorf("requires SiYuan %s or later", pkg.MinAppVersion)
}
if pkgType == "plugins" && bazaar.IsIncompatiblePlugin(pkg, frontend) {
return errors.New("incompatible plugin for this frontend")
}
if pkgType == "themes" && bazaar.IsIncompatibleTheme(pkg, frontend) {
return errors.New("incompatible theme for this frontend")
} Try / catch
_, err := model.InstallLocalBazaarPackage(archivePath, frontend, overwrite)
if err != nil {
if errors.Is(err, model.ErrLocalBazaarPackageIncompatible) {
// tell the user which version/frontend is required
}
} Prevention
- Check MinAppVersion against util.Ver before attempting install.
- Verify frontend compatibility (IsIncompatiblePlugin/IsIncompatibleTheme) for plugins and themes.
- Surface the required version in the UI when this sentinel is returned.
When it happens
Trigger: Installing a local plugin or theme whose manifest declares a MinAppVersion higher than the running SiYuan build, or whose declared backend/frontend target does not match the current frontend (e.g. a desktop-only plugin on mobile).
Common situations: User downloaded a package built for a newer SiYuan than they run, or a plugin targeting a different frontend. Common after a SiYuan downgrade or when sideloading a package from another device.
Related errors
- ErrLocalBazaarPackageExists
- marketplace package update is not allowed
- invalid package name
- invalid package type
- installed package not found
AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12).
Data as JSON: /api/errors/5e2e1a3d7d0ec9dd.
Report an issue: GitHub.