siyuan-note/siyuan · error
get bazaar package failed:
Error message
get bazaar package failed:
What it means
downloadBazaarFile fetches package zips from the bazaar OSS CDN; when the response status is not 200 it returns this error with the HTTP status string appended (e.g. 'get bazaar package failed: 404 Not Found'). It signals the CDN answered but refused/failed the request.
Source
Thrown at kernel/bazaar/install.go:62
repoURLHashTrimmed := strings.TrimPrefix(repoURLHash, "https://github.com/")
v, err, _ := downloadPackageFlight.Do(repoURLHash, func() (any, error) {
// repoURLHash: https://github.com/88250/Comfortably-Numb@6286912c381ef3f83e455d06ba4d369c498238dc 或带路径 /README.md
repoURL := repoURLHash[:strings.LastIndex(repoURLHash, "@")]
u := util.BazaarOSSServer + "/package/" + repoURLHashTrimmed
buf := &bytes.Buffer{}
resp, err := httpclient.NewCloudFileRequest2m().SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {
if pushProgress {
progress := float32(info.DownloadedSize) / float32(info.Response.ContentLength)
util.PushDownloadProgress(repoURL, progress)
}
}).Get(u)
if err != nil {
logging.LogErrorf("get bazaar package [%s] failed: %s", u, err)
return nil, errors.New("get bazaar package failed, please check your network")
}
if 200 != resp.StatusCode {
logging.LogErrorf("get bazaar package [%s] failed: %d", u, resp.StatusCode)
return nil, errors.New("get bazaar package failed: " + resp.Status)
}
data := buf.Bytes()
return data, nil
})
if err != nil {
return nil, err
}
return v.([]byte), nil
}
// incPackageDownloads 增加集市包下载次数
func incPackageDownloads(repoURL, packageName, systemID string) {
if "" == systemID {
return
}
repo := strings.TrimPrefix(repoURL, "https://github.com/")
u := bazaarDownloadCloudServer() + "/apis/siyuan/bazaar/addBazaarPackageDownloadCount"
httpclient.NewCloudRequest30s().SetBody(View on GitHub (pinned to 8641553a1f)
Solutions
- Refresh the marketplace index and retry so the install uses a valid published repoHash
- Check the appended HTTP status: 404 means the package/hash is not on the CDN — verify the repo URL and hash exist in the marketplace
- Retry later on 5xx statuses (CDN-side problem)
- Check kernel logs for 'get bazaar package [...]' with the failing status code to confirm which URL failed
Defensive patterns
Strategy: try-catch
Validate before calling
// check status yourself before consuming data
resp, err := http.Get(u)
if err == nil && resp.StatusCode != 200 {
return fmt.Errorf("package not available: %s", resp.Status)
} Try / catch
if err := InstallPackage(...); err != nil {
if strings.HasPrefix(err.Error(), "get bazaar package failed: ") {
status := strings.TrimPrefix(err.Error(), "get bazaar package failed: ")
if strings.HasPrefix(status, "5") { retryLater() } else { reportBadPackage(status) }
}
return err
} Prevention
- Read the appended HTTP status to distinguish 404 (bad hash/package) from 5xx (CDN outage)
- Refresh the marketplace index before installing so hashes are current
- Retry only on 5xx; report persistent 404s as broken listings
- Avoid hand-built repoURLHash values; use index-supplied hashes
When it happens
Trigger: InstallPackage -> downloadBazaarFile with a repoURLHash whose package object is missing on the CDN (404), or CDN returning 403/5xx; the check `200 != resp.StatusCode` raises the error.
Common situations: Installing a plugin/theme pinned to a commit hash that was never published to the OSS store; CDN outage returning 5xx; repo or hash typo in a custom install call.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
- get bazaar package failed, please check your network
- get bazaar package failed: %s
- Failed to install marketplace package [%s]: %s
- Uninstall failed: %s
- download custom emoji failed: %w
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/084604fefe4de0cc.
Report an issue: GitHub.