siyuan-note/siyuan · error
Failed to install marketplace package
Error message
Failed to install marketplace package [%s]: %s
What it means
Wrapped error produced in model.installBazaarPackage (kernel/model/bazaar.go:519): when bazaar.InstallPackage fails, the cause is wrapped with the localized template Conf.Language(46), i.e. "Failed to install marketplace package [<name>]: <cause>". The underlying cause comes from the whole download-and-install pipeline in kernel/bazaar/install.go: network download of repo@hash (downloadBazaarFile), unzip, the anti-takeover guards (non-empty target dir, missing/invalid manifest, name mismatch), and the final file copy to the install path.
Solutions
- Read the text after the colon: it is the true cause (network error, 'marketplace package install path already exists', 'manifest not found or invalid', 'name mismatch', unzip/copy failure)
- For the install-path-exists cause, uninstall the leftover package or update it instead of installing fresh
- For network causes, check connectivity to the bazaar/cloud server and retry the install
- For name mismatch or invalid manifest, verify the package on the marketplace and install a fixed version
Defensive patterns
Strategy: try-catch
Try / catch
err := model.InstallBazaarPackage(pkgType, repoURL, repoHash, name, nil)
if err != nil {
msg := err.Error()
switch {
case strings.Contains(msg, "install path already exists"):
// uninstall or update instead
case strings.Contains(msg, "manifest not found"), strings.Contains(msg, "name mismatch"):
// package broken on marketplace; report
default:
// network/disk cause: surface message, allow manual retry
}
} Prevention
- Log the full wrapped message; the cause after ': ' selects the remedy
- Before installing, check the target is not a half-installed directory (uninstall leftovers)
- Keep retry buttons manual — network causes may be transient but retry storms waste quota
When it happens
Trigger: Calling model.InstallBazaarPackage / /api/bazaar/installBazaarPackage when: the GitHub-hosted package zip cannot be downloaded (offline, proxy, 404 for a deleted release); the target directory data/<type>/<name> already has content and the local manifest is absent/mismatched so update=false ("marketplace package install path already exists"); the archive's manifest name differs from packageName; the zip is corrupt.
Common situations: Corporate proxies blocking the bazaar download domain; installing a package whose previous install left files behind after a crashed update; marketplace metadata pointing at a repo hash that no longer exists; disk full or permission errors under the workspace data directory.
Related errors
- get bazaar package failed
- bazaar is offline
- Conf.Language(46)
- Conf.Language(47)
- get bazaar package failed:
AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18).
Data as JSON: /api/errors/7eee18e292d86100.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/bazaar.go:519
func GetBazaarPackageREADME(ctx context.Context, repoURL, repoHash, pkgType string) (ret string) {
ret = bazaar.GetBazaarPackageREADME(ctx, repoURL, repoHash, pkgType)
return
}
// installBazaarPackage 下载并安装集市包
func installBazaarPackage(pkgType, repoURL, repoHash, packageName string) (meta installMeta, err error) {
installPath, jsonFileName, err := getPackageInstallPath(pkgType, packageName)
if err != nil {
return
}
installedPkg, parseErr := bazaar.ParsePackageJSON(filepath.Join(installPath, jsonFileName))
meta.update = parseErr == nil && installedPkg != nil && installedPkg.Name == packageName
err = bazaar.InstallPackage(repoURL, repoHash, installPath, Conf.System.ID, pkgType, packageName, meta.update)
if err != nil {
err = fmt.Errorf(Conf.Language(46), packageName, err)
}
return
}
// finishInstall 集市包安装后的处理(刷新外观、推送插件重载等);批量更新时同类型只执行一次
//
// - themeOptions:仅在新安装主题(meta.update 为 false)时写入外观;批量覆盖更新不会用到
// - applyNewAppearance:控制新安装图标是否自动应用;本地安装不自动应用
func finishInstall(pkgType string, items []batchInstallItem, themeOptions *ThemeInstallOptions, applyNewAppearance bool) {
if 1 > len(items) {
return
}
switch pkgType {
case "plugins":
reloadPluginSet := hashset.New()
for _, item := range items {
if !item.meta.update {View on GitHub (pinned to afa823b6b4)