{"record":{"id":"7eee18e292d86100","repo":"siyuan-note/siyuan","slug":"failed-to-install-marketplace-package-s-s","errorCode":null,"errorMessage":"Failed to install marketplace package [%s]: %s","messagePattern":"Failed to install marketplace package \\[(.+?)\\]: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar.go","lineNumber":518,"sourceCode":"\nfunc GetBazaarPackageREADME(ctx context.Context, repoURL, repoHash, pkgType string) (ret string) {\n\tret = bazaar.GetBazaarPackageREADME(ctx, repoURL, repoHash, pkgType)\n\treturn\n}\n\n// installBazaarPackage 下载并安装集市包\nfunc installBazaarPackage(pkgType, repoURL, repoHash, packageName string) (meta installMeta, err error) {\n\tinstallPath, jsonFileName, err := getPackageInstallPath(pkgType, packageName)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tinstalledPkg, parseErr := bazaar.ParsePackageJSON(filepath.Join(installPath, jsonFileName))\n\tmeta.update = parseErr == nil && installedPkg != nil && installedPkg.Name == packageName\n\n\terr = bazaar.InstallPackage(repoURL, repoHash, installPath, Conf.System.ID, pkgType, packageName, meta.update)\n\tif err != nil {\n\t\terr = fmt.Errorf(Conf.Language(46), packageName, err)\n\t}\n\treturn\n}\n\n// finishInstall 集市包安装后的处理（刷新外观、推送插件重载等）；批量更新时同类型只执行一次\n//\n//   - themeOptions：仅在新安装主题（meta.update 为 false）时写入外观；批量覆盖更新不会用到\n//   - applyNewAppearance：控制新安装图标是否自动应用；本地安装不自动应用\nfunc finishInstall(pkgType string, items []batchInstallItem, themeOptions *ThemeInstallOptions, applyNewAppearance bool) {\n\tif 1 > len(items) {\n\t\treturn\n\t}\n\n\tswitch pkgType {\n\tcase \"plugins\":\n\t\treloadPluginSet := hashset.New()\n\t\tfor _, item := range items {\n\t\t\tif !item.meta.update {","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/bazaar.go#L500-L536","documentation":"Thrown by installBazaarPackage (the online install path) when bazaar.InstallPackage fails during download/extract/place of a marketplace package. The error is wrapped using the localized template Conf.Language(46) (e.g. 'Failed to install marketplace package [<name>]: <cause>'), so the inner error carries the real reason.","triggerScenarios":"Calling InstallBazaarPackage or UpdateBazaarPackage (which delegates to it) and the underlying download or extraction fails: network error fetching the package from the bazaar OSS, corrupt archive, disk write failure at installPath, or an invalid repoURL/repoHash.","commonSituations":"No or flaky internet connection to the bazaar CDN, a removed/private upstream repo, a full/permission-denied data directory, or a corrupt downloaded archive. The wrapping hides the cause behind the localized string, so inspect errors.Unwrap.","solutions":["Unwrap the error (or read the log) to get the underlying cause from bazaar.InstallPackage.","Fix network connectivity / proxy to reach the bazaar OSS server and retry.","Confirm the data directory is writable and has space; clear any partial install at installPath.","Verify repoURL/repoHash are valid for the package (re-fetch from the bazaar listing)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := model.InstallBazaarPackage(pkgType, repoURL, repoHash, packageName, themeOptions)\nif err != nil {\n    // err wraps the localized template; unwrap to inspect the underlying cause\n    if inner := errors.Unwrap(err); inner != nil {\n        // log inner for network/IO diagnosis\n    }\n}","preventionTips":["Ensure network/proxy access to the bazaar OSS server before installing.","Confirm the data directory is writable and has free space.","Pass repoURL/repoHash exactly as returned by the bazaar listing; re-fetch if stale.","Unwrap the error to distinguish network, archive, and IO causes."],"tags":["bazaar","package-management","network","install","wrapped-error"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}