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

The bazaar package downloader performs an HTTP GET of the package URL via an HTTP client with a progress callback. If the transport itself fails (DNS failure, connection refused/reset, TLS error, timeout), it logs the underlying cause and returns this generic network-failure error.

Solutions

  1. Verify network connectivity and that the package host (e.g. ghproxy/mirror URL) is reachable, e.g. curl the URL
  2. Check proxy settings (HTTP_PROXY/HTTPS_PROXY) and corporate firewall rules
  3. Retry after transient failures; the error is logged with the underlying cause in the kernel log for diagnosis
  4. If a mirror endpoint is down, switch the marketplace endpoint/CDN configuration

Example fix

// before: installing behind a proxy that is not exported
// after:
//   export HTTPS_PROXY=http://proxy.local:8080
//   (retry the marketplace install)
Defensive patterns

Strategy: retry

Validate before calling

// before install: probe reachability
resp, err := http.Head(u)
if err != nil { return fmt.Errorf("package host unreachable: %w", err) }

Try / catch

data, err := getBazaarPackage(u)
if err != nil && strings.Contains(err.Error(), "please check your network") {
    // log underlying kernel-log cause, backoff and retry
    return retryWithBackoff(func() error { _, err = getBazaarPackage(u); return err }, 3)
}

Prevention

When it happens

Trigger: Calling any bazaar install/upgrade flow whose `Get(u)` fails at the transport layer — no HTTP response was received at all.

Common situations: Offline machine, firewall/proxy blocking the package host, DNS misconfiguration, expired TLS certs on the mirror, transient network drops during large package downloads.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/8a5466ca5b860ba4. Report an issue: GitHub.

Appendix: source

Thrown at kernel/bazaar/install.go:58

var packageInstallLock sync.Mutex

// 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, packageName, systemID string) {
	if "" == systemID {
		return

View on GitHub (pinned to 9f775e8a12)