{"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":673,"sourceCode":"// 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, 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":655,"sourceCodeEnd":691,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/bazaar.go#L655-L691","documentation":"Thrown by UpdateBazaarPackage when no entry in the fetched updatedPackages list matches the requested packageName (where updated.Installed != nil && updated.Available != nil && updated.Installed.Name == packageName). The package is either not installed or has no available update entry, so there is nothing to update.","triggerScenarios":"Calling UpdateBazaarPackage for a package name that is not installed, or whose installed entry lacks a matching available update (e.g. the bazaar listing did not return it, or the installed name differs from the available name). Reached after getPackageInstallPath and getUpdatedPackages succeed but the loop finds no match.","commonSituations":"Update requested for a package that was already uninstalled, for a name with a directory/manifest mismatch, or while offline such that the available list is empty/stale. Also if the package was installed locally and never published to the online bazaar.","solutions":["Confirm the package is currently installed (list installed packages) and that its name matches the online listing.","Refresh the bazaar update list (re-fetch available packages) before retrying.","If the package is local-only (not in the online bazaar), update it via local install instead of UpdateBazaarPackage."],"exampleFix":"// before\nerr := model.UpdateBazaarPackage(pkgType, name, frontend) // name not in updates\n// after\nupdated, _ := model.GetUpdatedPackages(pkgType, frontend)\nfound := false\nfor _, u := range updated { if u.Installed != nil && u.Installed.Name == name { found = true; break } }\nif !found { /* nothing to update; handle gracefully */ }","handlingStrategy":"validation","validationCode":"// Ensure an update actually exists for this package before calling UpdateBazaarPackage.\nupdated, err := model.GetUpdatedPackages(pkgType, frontend)\nif err != nil {\n    return err\n}\nfound := false\nfor _, u := range updated {\n    if u.Installed != nil && u.Available != nil && u.Installed.Name == packageName {\n        found = true\n        break\n    }\n}\nif !found {\n    return // no update available; do not call UpdateBazaarPackage\n}","typeGuard":null,"tryCatchPattern":"err := model.UpdateBazaarPackage(pkgType, packageName, frontend)\nif err != nil {\n    if err.Error() == \"marketplace package update not found\" {\n        // package not installed or not in available list; refresh and re-check\n    }\n}","preventionTips":["Refresh the installed and available/update lists before offering an update action.","Use local install for packages not present in the online bazaar.","Ensure the package name matches between installed and available entries (directory vs manifest name)."],"tags":["bazaar","package-management","not-found","update","state-check"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}