{"record":{"id":"8a5466ca5b860ba4","repo":"siyuan-note/siyuan","slug":"get-bazaar-package-failed-please-check-your-netwo","errorCode":null,"errorMessage":"get bazaar package failed, please check your network","messagePattern":"get bazaar package failed, please check your network","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/bazaar/install.go","lineNumber":58,"sourceCode":"var packageInstallLock sync.Mutex\n\n// downloadBazaarFile 下载集市文件\nfunc downloadBazaarFile(repoURLHash string, pushProgress bool) (data []byte, err error) {\n\trepoURLHashTrimmed := strings.TrimPrefix(repoURLHash, \"https://github.com/\")\n\tv, err, _ := downloadPackageFlight.Do(repoURLHash, func() (any, error) {\n\t\t// repoURLHash: https://github.com/88250/Comfortably-Numb@6286912c381ef3f83e455d06ba4d369c498238dc 或带路径 /README.md\n\t\trepoURL := repoURLHash[:strings.LastIndex(repoURLHash, \"@\")]\n\t\tu := util.BazaarOSSServer + \"/package/\" + repoURLHashTrimmed\n\t\tbuf := &bytes.Buffer{}\n\t\tresp, err := httpclient.NewCloudFileRequest2m().SetOutput(buf).SetDownloadCallback(func(info req.DownloadInfo) {\n\t\t\tif pushProgress {\n\t\t\t\tprogress := float32(info.DownloadedSize) / float32(info.Response.ContentLength)\n\t\t\t\tutil.PushDownloadProgress(repoURL, progress)\n\t\t\t}\n\t\t}).Get(u)\n\t\tif err != nil {\n\t\t\tlogging.LogErrorf(\"get bazaar package [%s] failed: %s\", u, err)\n\t\t\treturn nil, errors.New(\"get bazaar package failed, please check your network\")\n\t\t}\n\t\tif 200 != resp.StatusCode {\n\t\t\tlogging.LogErrorf(\"get bazaar package [%s] failed: %d\", u, resp.StatusCode)\n\t\t\treturn nil, errors.New(\"get bazaar package failed: \" + resp.Status)\n\t\t}\n\t\tdata := buf.Bytes()\n\t\treturn data, nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn v.([]byte), nil\n}\n\n// incPackageDownloads 增加集市包下载次数\nfunc incPackageDownloads(repoURL, packageName, systemID string) {\n\tif \"\" == systemID {\n\t\treturn","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/bazaar/install.go#L40-L76","documentation":"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.","triggerScenarios":"Calling any bazaar install/upgrade flow whose `Get(u)` fails at the transport layer — no HTTP response was received at all.","commonSituations":"Offline machine, firewall/proxy blocking the package host, DNS misconfiguration, expired TLS certs on the mirror, transient network drops during large package downloads.","solutions":["Verify network connectivity and that the package host (e.g. ghproxy/mirror URL) is reachable, e.g. curl the URL","Check proxy settings (HTTP_PROXY/HTTPS_PROXY) and corporate firewall rules","Retry after transient failures; the error is logged with the underlying cause in the kernel log for diagnosis","If a mirror endpoint is down, switch the marketplace endpoint/CDN configuration"],"exampleFix":"// before: installing behind a proxy that is not exported\n// after:\n//   export HTTPS_PROXY=http://proxy.local:8080\n//   (retry the marketplace install)","handlingStrategy":"retry","validationCode":"// before install: probe reachability\nresp, err := http.Head(u)\nif err != nil { return fmt.Errorf(\"package host unreachable: %w\", err) }","typeGuard":null,"tryCatchPattern":"data, err := getBazaarPackage(u)\nif err != nil && strings.Contains(err.Error(), \"please check your network\") {\n    // log underlying kernel-log cause, backoff and retry\n    return retryWithBackoff(func() error { _, err = getBazaarPackage(u); return err }, 3)\n}","preventionTips":["Configure proxy env vars (HTTPS_PROXY) in restricted networks","Pre-check connectivity to the marketplace host before batch installs","Retry transient transport failures with backoff","Consult kernel logs (LogErrorf) for the wrapped root cause"],"tags":["network","bazaar","download","http"],"backgroundTag":"http-request-failed","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}