{"record":{"id":"7f2939b7aaedfc7a","repo":"siyuan-note/siyuan","slug":"conf-language-46","errorCode":null,"errorMessage":"Conf.Language(46)","messagePattern":"Conf\\.Language\\(46\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar.go","lineNumber":527,"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, repoRef, 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, repoRef, 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":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/bazaar.go#L509-L545","documentation":"installBazaarPackage downloads and installs a marketplace package from its repo URL via bazaar.InstallPackage. On failure the raw error is wrapped with Conf.Language(46) — a localized template (roughly 'failed to install package [%s]: %s') — using fmt.Errorf, so the user-visible message embeds the package name and underlying cause. This error is a wrapper; inspect the embedded cause for the real failure (network, git clone, extraction, or checksum).","triggerScenarios":"installBazaarPackage/InstallBazaarPackage/updatePackages flow where bazaar.InstallPackage returns any error: network failure reaching the marketplace/GitHub, repo or hash not found, download/extraction failure, or disk write failure in data/<pkgType>/<name>.","commonSituations":"Corporate proxy or firewall blocking GitHub; marketplace repo renamed or deleted upstream; offline mode; pinned repo hash no longer exists after upstream force-push; full disk or permission issues under the workspace data directory.","solutions":["Read the wrapped inner error to identify the root cause (network vs repo vs disk)","Check network/proxy connectivity to the marketplace repo host and retry","Verify the package still exists upstream and that the pinned hash/ref is valid","Check disk space and write permissions in the SiYuan workspace data directory","Retry the update/install; transient network failures during batch updates are common"],"exampleFix":"// caller: unwrap to log the real cause\nif err := model.InstallBazaarPackage(repoURL, repoHash, \"plugins\", name); err != nil {\n\tlog.Printf(\"install %s failed: %v\", name, err) // err contains localized msg + inner cause\n}","handlingStrategy":"retry","validationCode":"// probe connectivity before batch install\nconst online = await fetch(\"https://github.com\", {method: \"HEAD\"}).then(r => r.ok).catch(() => false);\nif (!online) alert(\"marketplace unreachable: check network/proxy before installing\");","typeGuard":null,"tryCatchPattern":"try {\n  await model.InstallBazaarPackage(repoURL, repoHash, pkgType, name);\n} catch (err) {\n  // err is the localized Conf.Language(46) wrapper; log it fully, then inspect the inner cause\n  console.error(err);\n  if (isNetworkError(err)) await retryWithBackoff(() => install(name));\n}","preventionTips":["Check network/proxy access to the repo host before batch installs","Don't retry forever on the same pinned hash if the repo was force-pushed — refresh the marketplace index","Ensure enough free disk space in the workspace before installing large themes/templates","Log the full wrapped error so the inner cause is visible in diagnostics"],"tags":["marketplace","install-failure","network","error-wrapping"],"backgroundTag":"api-request-failed","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"}