siyuan-note/siyuan · error

marketplace package update is not allowed

Error message

marketplace package update is not allowed

What it means

UpdateBazaarPackage walks the computed update list for the package type; if the matching marketplace entry sets DisallowUpdate, updates are forbidden for that package and this error is returned instead of installing. The package author flagged this version line as non-updatable (e.g. deprecated or forked).

Solutions

  1. Uninstall the package and install the successor/new version fresh from the marketplace
  2. Clear stale marketplace cache so the DisallowUpdate flag state refreshes
  3. Contact the package author or check the repo README for the recommended upgrade path

Example fix

// before: unconditional update attempt
if err := model.UpdateBazaarPackage("plugins", name, frontend); err != nil { return err }
// after: fall back to reinstall on disallow
if err := model.UpdateBazaarPackage("plugins", name, frontend); err != nil {
    if strings.Contains(err.Error(), "not allowed") { return reinstallPackage("plugins", name) }
    return err
}
Defensive patterns

Strategy: validation

Validate before calling

updates := model.GetUpdatedPackages(pkgType, frontend)
for _, u := range updates {
  if u.Installed != nil && u.Installed.Name == name && u.Available != nil && u.Available.DisallowUpdate {
    return errors.New("update disallowed; reinstall instead")
  }
}

Prevention

When it happens

Trigger: Calling the update-package API (or UI 'update' action) for a package whose cached marketplace metadata has DisallowUpdate=true; the flag was recently set upstream while a stale local copy still offers the update.

Common situations: Packages whose repo was archived or renamed so direct updates are disabled; authors redirecting users to a differently-named successor package; stale marketplace cache still listing the old entry.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/e9784ca2fcfc0b56. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/bazaar.go:678

	finishInstall(pkgType, []batchInstallItem{{name: pkg.Name, meta: installMeta{update: result.Updated}}}, nil, false)
	return result, nil
}

// UpdateBazaarPackage 使用在线集市数据更新本地集市包
func UpdateBazaarPackage(pkgType, packageName, frontend string) error {
	if _, _, err := getPackageInstallPath(pkgType, packageName); err != nil {
		return err
	}
	updatedPackages, err := getUpdatedPackages(pkgType, frontend)
	if err != nil {
		return err
	}
	for _, updated := range updatedPackages {
		if updated.Installed == nil || updated.Available == nil || updated.Installed.Name != packageName {
			continue
		}
		if updated.Available.DisallowUpdate {
			return errors.New("marketplace package update is not allowed")
		}
		return InstallBazaarPackage(pkgType, updated.Available.RepoURL, updated.Available.RepoHash,
			updated.Available.RepoRef, packageName, nil)
	}
	return errors.New("marketplace package update not found")
}

func getPackageUninstallPath(pkgType, packageName string) (installPath string, err error) {
	installedInfos, basePath, _, err := GetInstalledPackageInfos(pkgType)
	if err != nil {
		return "", err
	}
	for _, info := range installedInfos {
		if info.Pkg.Name == packageName {
			return filepath.Join(basePath, info.DirName), nil
		}
	}
	return "", errors.New("installed package not found")

View on GitHub (pinned to 9f775e8a12)