{"record":{"id":"426a4d92f073caac","repo":"siyuan-note/siyuan","slug":"official-marketplace-package-not-found","errorCode":null,"errorMessage":"official marketplace package not found","messagePattern":"official marketplace package not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar_rating.go","lineNumber":246,"sourceCode":"\t\treturn \"\", err\n\t}\n\tinstalled := false\n\tfor _, info := range installedInfos {\n\t\tif \"\" == info.Pkg.InvalidReason && packageName == info.Pkg.Name {\n\t\t\tinstalled = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !installed {\n\t\treturn \"\", errors.New(\"marketplace package is not installed\")\n\t}\n\n\texists, err := bazaar.HasBazaarPackage(ctx, pkgType, packageName)\n\tif nil != err {\n\t\treturn \"\", err\n\t}\n\tif !exists {\n\t\treturn \"\", errors.New(\"official marketplace package not found\")\n\t}\n\treturn token, nil\n}\n\nfunc getBazaarRatingUserToken() (string, error) {\n\tuser := Conf.GetUser()\n\tif nil == user || \"\" == user.UserToken {\n\t\treturn \"\", errors.New(Conf.Language(31))\n\t}\n\treturn user.UserToken, nil\n}\n\nfunc getInstalledOfficialBazaarPackageNames(ctx context.Context, pkgType string,\n\tpackageNames []string) ([]string, error) {\n\tif !isValidBazaarPackageType(pkgType) {\n\t\treturn nil, errors.New(\"invalid package type\")\n\t}\n\tinstalledInfos, _, _, err := bazaarRatingInstalledPackageInfos(pkgType)","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/bazaar_rating.go#L228-L264","documentation":"Even when the package is installed locally, validateBazaarPackageRatingRequest0 confirms it still exists as an official marketplace package via bazaar.HasBazaarPackage (cloud/index lookup). If the lookup succeeds but reports false, this error is returned: the package cannot be rated because it is no longer (or never was) an official marketplace offering.","triggerScenarios":"Calling GetBazaarPackageRating or SetBazaarPackageRating for an installed package that has been removed from the official marketplace index, or a locally sideloaded package with a name matching no marketplace entry.","commonSituations":"A marketplace package was pulled/renamed upstream while still installed locally; the package was installed manually (imported .sy.zip) rather than from the marketplace; marketplace index/cache is stale or the repo data hasn't synced; typo in the package name that coincidentally matches an installed local package.","solutions":["Confirm the package still exists in the official marketplace (bazaar index) under this name","If removed upstream, stop offering rating actions for it in the UI","Refresh the bazaar index/cache and retry in case of staleness","If the package is sideloaded, it cannot be rated — install the official version instead"],"exampleFix":"// before: assuming installed implies rateable\nmodel.SetBazaarPackageRating(ctx, \"plugins\", pkgName, 5)\n// after\nexists, err := bazaar.HasBazaarPackage(ctx, \"plugins\", pkgName)\nif err != nil || !exists {\n    return errors.New(\"this package is not an official marketplace package and cannot be rated\")\n}\nmodel.SetBazaarPackageRating(ctx, \"plugins\", pkgName, 5)","handlingStrategy":"fallback","validationCode":"exists, err := bazaar.HasBazaarPackage(ctx, pkgType, packageName)\nif err != nil || !exists { /* hide rating UI or show 'not an official package' */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check marketplace existence before showing rating controls","Refresh the bazaar index when packages disappear from the marketplace","Treat sideloaded/local packages as non-rateable"],"tags":["marketplace","rating","not-found","official-package"],"backgroundTag":"resource-not-found","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}