{"record":{"id":"13e225075ea2c54b","repo":"siyuan-note/siyuan","slug":"bazaar-is-offline","errorCode":null,"errorMessage":"bazaar is offline","messagePattern":"bazaar is offline","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/bazaar/bazaar.go","lineNumber":44,"sourceCode":"\n\t\"github.com/88250/go-humanize\"\n\t\"github.com/araddon/dateparse\"\n\t\"github.com/siyuan-note/siyuan/kernel/util\"\n)\n\n// GetBazaarPackages 返回指定类型的在线集市包列表（plugins 和 themes 类型需要传递 frontend 参数）。\nfunc GetBazaarPackages(pkgType string, frontend string) (packages []*Package) {\n\tpackages, _ = getBazaarPackages(pkgType, frontend, true)\n\treturn\n}\n\nfunc getBazaarPackages(pkgType, frontend string, showError bool) (packages []*Package, err error) {\n\tresult := getStageAndBazaar(pkgType, showError)\n\tif !result.Online || nil != result.StageErr || nil == result.StageIndex {\n\t\tif nil != result.StageErr {\n\t\t\terr = result.StageErr\n\t\t} else {\n\t\t\terr = errors.New(\"bazaar is offline\")\n\t\t}\n\t\treturn make([]*Package, 0), err\n\t}\n\n\tpackages = buildBazaarPackages(result.StageIndex, result.BazaarStats, result.BazaarRatings,\n\t\tresult.RatingAvailable, pkgType, frontend)\n\treturn\n}\n\n// buildBazaarPackages 仅以 Stage 索引中的仓库构建在线集市包，统计索引只用于补充元数据。\nfunc buildBazaarPackages(stageIndex *StageIndex, bazaarStats map[string]*bazaarStats,\n\tbazaarRatings map[string]*PackageRating, ratingsAvailable bool, pkgType, frontend string) (packages []*Package) {\n\tpackages = make([]*Package, 0, len(stageIndex.Repos))\n\tfor _, repo := range stageIndex.Repos {\n\t\tpkg := buildBazaarPackageWithMetadata(repo, bazaarStats, bazaarRatings,\n\t\t\tratingsAvailable, pkgType, frontend)\n\t\tif nil == pkg {\n\t\t\tcontinue","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/bazaar/bazaar.go#L26-L62","documentation":"getBazaarPackages checks whether the marketplace (stage/bazaar) endpoints are reachable and returned a valid index via getStageAndBazaar. When the result reports Offline (or the stage index is missing and there is no more specific stage error), the package list cannot be built and this error is returned together with an empty package list. It is an availability error for the SiYuan marketplace CDN, not a bug in the caller.","triggerScenarios":"Calling GetBazaarPackages / GetBazaarPackagesMap (kernel APIs /api/bazaar/getBazaarPackage, marketplace UI load) when the network is down, a proxy/firewall blocks bazaar endpoints, the CDN is temporarily unavailable, or showError-mode probes failed.","commonSituations":"Offline or restricted network environments; corporate proxies blocking https://bazaar and stage CDN hosts; users in regions where the CDN is unreachable; transient CDN outage.","solutions":["Check network connectivity and retry after the CDN is reachable again","Configure a working system/proxy setting in SiYuan (Settings - About - Network) or environment HTTP(S)_PROXY variables","Whitelist the SiYuan marketplace hosts (bazaar, stage CDN, liuyun.io/ld246 endpoints) in your firewall","Retry later if it is a CDN-side outage; previously installed plugins/themes keep working offline"],"exampleFix":"// client-side handling: treat empty packages + offline error as non-fatal\nif (msg.includes(\"bazaar is offline\")) {\n  showOfflineBanner();\n  return []; // keep cached/installed packages\n}","handlingStrategy":"fallback","validationCode":"// probe connectivity before listing the marketplace\ntry { await fetch(\"https://bazaar.si-yuan.com\", {method: \"HEAD\"}) } catch { showOfflineMode(); }","typeGuard":null,"tryCatchPattern":"try { const pkgs = await fetchPost(\"/api/bazaar/getBazaarPackage\", params) } catch (e) { if (String(e.msg).includes(\"bazaar is offline\")) { useCachedPackages(); } }","preventionTips":["Check network/proxy settings when the marketplace fails to load","Whitelist bazaar CDN hosts in corporate firewalls","Design UI to degrade to already-installed packages on offline errors","Retry with backoff instead of hammering the endpoint"],"tags":["network","bazaar","marketplace","offline"],"backgroundTag":"network-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"}