{"record":{"id":"f6b4bf00a738da1b","repo":"siyuan-note/siyuan","slug":"marketplace-package-update-not-found","errorCode":null,"errorMessage":"marketplace package update not found","messagePattern":"marketplace package update not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar.go","lineNumber":683,"sourceCode":"func 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\")\n}\n\nfunc UninstallPackage(pkgType, packageName string) error {\n\tinstallPath, err := getPackageUninstallPath(pkgType, packageName)\n\tif err != nil {","sourceCodeStart":665,"sourceCodeEnd":701,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/bazaar.go#L665-L701","documentation":"UpdateBazaarPackage computes the list of outdated packages and searches it for one whose installed name matches packageName; if none matches, it returns this error. The package is either up to date, not installed, or the marketplace data lists no newer version for it.","triggerScenarios":"Calling the update API for a package that is already at the latest marketplace version; updating a package that is not installed at all; getUpdatedPackages returned an empty set because the marketplace index is stale or unreachable and fell back to cached data.","commonSituations":"Frontend shows an 'outdated' badge from stale cache while the index already has the new version (or vice versa); typo in package name; concurrent update already applied the new version.","solutions":["Confirm the package name and that it is installed (GetInstalledPackages)","Refresh the marketplace index (bazaars URL/cache) and retry","Check GetUpdatedPackages output first; if empty, the package is current — skip the update"],"exampleFix":"// before\nif err := model.UpdateBazaarPackage(\"plugins\", name, frontend); err != nil { return err }\n// after: treat not-found as already up to date\nif err := model.UpdateBazaarPackage(\"plugins\", name, frontend); err != nil {\n    if strings.Contains(err.Error(), \"not found\") { return nil // already latest }\n    return err\n}","handlingStrategy":"validation","validationCode":"updates := model.GetUpdatedPackages(pkgType, frontend)\nfound := false\nfor _, u := range updates {\n  if u.Installed != nil && u.Installed.Name == name { found = true }\n}\nif !found { return nil } // nothing to update; skip","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only call update for packages listed as outdated","Refresh the marketplace index before batch updates","Compare names case-exactly as returned by the index"],"tags":["marketplace","update","not-found"],"backgroundTag":"record-not-found","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"}