{"record":{"id":"e9784ca2fcfc0b56","repo":"siyuan-note/siyuan","slug":"marketplace-package-update-is-not-allowed","errorCode":null,"errorMessage":"marketplace package update is not allowed","messagePattern":"marketplace package update is not allowed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar.go","lineNumber":678,"sourceCode":"\tfinishInstall(pkgType, []batchInstallItem{{name: pkg.Name, meta: installMeta{update: result.Updated}}}, nil, false)\n\treturn result, nil\n}\n\n// UpdateBazaarPackage 使用在线集市数据更新本地集市包\nfunc UpdateBazaarPackage(pkgType, packageName, frontend string) error {\n\tif _, _, err := getPackageInstallPath(pkgType, packageName); err != nil {\n\t\treturn err\n\t}\n\tupdatedPackages, err := getUpdatedPackages(pkgType, frontend)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, updated := range updatedPackages {\n\t\tif updated.Installed == nil || updated.Available == nil || updated.Installed.Name != packageName {\n\t\t\tcontinue\n\t\t}\n\t\tif updated.Available.DisallowUpdate {\n\t\t\treturn errors.New(\"marketplace package update is not allowed\")\n\t\t}\n\t\treturn InstallBazaarPackage(pkgType, updated.Available.RepoURL, updated.Available.RepoHash,\n\t\t\tupdated.Available.RepoRef, packageName, nil)\n\t}\n\treturn errors.New(\"marketplace package update not found\")\n}\n\nfunc getPackageUninstallPath(pkgType, packageName string) (installPath string, err error) {\n\tinstalledInfos, basePath, _, err := GetInstalledPackageInfos(pkgType)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfor _, info := range installedInfos {\n\t\tif info.Pkg.Name == packageName {\n\t\t\treturn filepath.Join(basePath, info.DirName), nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"installed package not found\")","sourceCodeStart":660,"sourceCodeEnd":696,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/bazaar.go#L660-L696","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Uninstall the package and install the successor/new version fresh from the marketplace","Clear stale marketplace cache so the DisallowUpdate flag state refreshes","Contact the package author or check the repo README for the recommended upgrade path"],"exampleFix":"// before: unconditional update attempt\nif err := model.UpdateBazaarPackage(\"plugins\", name, frontend); err != nil { return err }\n// after: fall back to reinstall on disallow\nif err := model.UpdateBazaarPackage(\"plugins\", name, frontend); err != nil {\n    if strings.Contains(err.Error(), \"not allowed\") { return reinstallPackage(\"plugins\", name) }\n    return err\n}","handlingStrategy":"validation","validationCode":"updates := model.GetUpdatedPackages(pkgType, frontend)\nfor _, u := range updates {\n  if u.Installed != nil && u.Installed.Name == name && u.Available != nil && u.Available.DisallowUpdate {\n    return errors.New(\"update disallowed; reinstall instead\")\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Inspect DisallowUpdate in marketplace metadata before offering update buttons","Refresh the marketplace cache so flags reflect upstream state","Prefer uninstall+install for packages flagged non-updatable"],"tags":["marketplace","update","package-management"],"backgroundTag":"operation-not-supported","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}