siyuan-note/siyuan · error

get bazaar package failed, please check your network

Error message

get bazaar package failed, please check your network

What it means

Returned by downloadBazaarFile (kernel/bazaar/install.go:53-55) when the HTTP GET to the bazaar OSS package URL fails at the transport level (the req client returns a non-nil err). This means the request never completed — DNS failure, connection refused, TLS handshake error, or a 2-minute timeout (NewCloudFileRequest2m). The underlying error is logged via LogErrorf but only the generic message is returned to the caller.

Source

Thrown at kernel/bazaar/install.go:55

var downloadPackageFlight singleflight.Group

// downloadBazaarFile 下载集市文件
func downloadBazaarFile(repoURLHash string, pushProgress bool) (data []byte, err error) {
	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, systemID string) {
	if "" == systemID {
		return

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Check network connectivity and retry — downloadBazaarFile uses singleflight so concurrent retries are coalesced
  2. Verify the bazaar OSS server domain is reachable from your network
  3. Increase available bandwidth or use a smaller package if hitting the 2-minute timeout
  4. Check proxy settings if behind a corporate network
Defensive patterns

Strategy: retry

Try / catch

err := bazaar.InstallPackage(repoURL, repoHash, installPath, systemID, pkgType, packageName, update)
if err != nil {
    if strings.Contains(err.Error(), "please check your network") {
        // Retry with backoff — downloadBazaarFile uses singleflight so concurrent retries are safe
        time.Sleep(3 * time.Second)
        err = bazaar.InstallPackage(repoURL, repoHash, installPath, systemID, pkgType, packageName, update)
    }
}

Prevention

When it happens

Trigger: Calling InstallPackage (or any API that downloads a marketplace package zip) when the network request to util.BazaarOSSServer + "/package/..." fails at the connection level.

Common situations: Intermittent network outage during a package download; restrictive firewall blocking the OSS CDN; DNS misconfiguration; the 2-minute request timeout is exceeded for a large package on a slow link; proxy authentication failure.

Related errors


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/8a5466ca5b860ba4. Report an issue: GitHub.