{"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":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/bazaar/install.go","lineNumber":55,"sourceCode":"var downloadPackageFlight singleflight.Group\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, systemID string) {\n\tif \"\" == systemID {\n\t\treturn","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/bazaar/install.go#L37-L73","documentation":"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.","triggerScenarios":"Calling InstallPackage (or any API that downloads a marketplace package zip) when the network request to util.BazaarOSSServer + \"/package/...\" fails at the connection level.","commonSituations":"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.","solutions":["Check network connectivity and retry — downloadBazaarFile uses singleflight so concurrent retries are coalesced","Verify the bazaar OSS server domain is reachable from your network","Increase available bandwidth or use a smaller package if hitting the 2-minute timeout","Check proxy settings if behind a corporate network"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := bazaar.InstallPackage(repoURL, repoHash, installPath, systemID, pkgType, packageName, update)\nif err != nil {\n    if strings.Contains(err.Error(), \"please check your network\") {\n        // Retry with backoff — downloadBazaarFile uses singleflight so concurrent retries are safe\n        time.Sleep(3 * time.Second)\n        err = bazaar.InstallPackage(repoURL, repoHash, installPath, systemID, pkgType, packageName, update)\n    }\n}","preventionTips":["Implement retry-with-backoff for bazaar download operations since network failures are transient","Verify connectivity to the bazaar OSS server domain before initiating bulk package operations","Consider network proxy configuration if behind a corporate firewall"],"tags":["bazaar","marketplace","network","download","go"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}