{"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":41,"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 = make([]*Package, 0, len(result.StageIndex.Repos))\n\tfor _, repo := range result.StageIndex.Repos {\n\t\tpkg := buildBazaarPackageWithMetadata(repo, result.BazaarStats, pkgType, frontend)\n\t\tif nil == pkg {\n\t\t\tcontinue\n\t\t}\n\t\tpackages = append(packages, pkg)\n\t}\n\treturn\n}\n\n// GetBazaarPackagesMap 返回按包名索引的在线集市包映射（plugins 和 themes 类型需要传递 frontend 参数）。\nfunc GetBazaarPackagesMap(pkgType, frontend string) (packagesMap map[string]*Package, err error) {\n\tpackages, err := getBazaarPackages(pkgType, frontend, false)","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/bazaar/bazaar.go#L23-L59","documentation":"Returned by getBazaarPackages (kernel/bazaar/bazaar.go:37-43) when getStageAndBazaar reports the bazaar as not online (result.Online == false) and there is no specific StageErr and no cached StageIndex. This is the fallback error when neither the stage index could be fetched nor a cache hit was available. The public GetBazaarPackages discards the error (returns only packages), but GetBazaarPackagesMap propagates it to callers.","triggerScenarios":"Calling GetBazaarPackagesMap (or any API that lists marketplace packages) when SiYuan cannot reach the bazaar stage/stats servers AND has no cached index from a previous successful fetch.","commonSituations":"First launch with no network; corporate firewall blocking the bazaar endpoints; DNS resolution failure for the bazaar domain; the bazaar server is temporarily down; air-gapped environment with no prior cache.","solutions":["Verify network connectivity to the bazaar server endpoints","Check proxy/DNS settings in SiYuan's network configuration","Retry after restoring connectivity — a successful fetch populates the cache for offline use","If air-gapped, pre-seed the cache or accept that the marketplace is unavailable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"packages, err := bazaar.GetBazaarPackagesMap(pkgType, frontend)\nif err != nil {\n    if strings.Contains(err.Error(), \"bazaar is offline\") {\n        // Optionally retry after a delay, or degrade to installed-packages-only mode\n        log.Printf(\"bazaar offline: %v, showing installed packages only\", err)\n        packages = map[string]*bazaar.Package{}\n    } else {\n        return err\n    }\n}","preventionTips":["Cache the bazaar index locally after a successful fetch so it is available during transient outages","Check network connectivity before invoking bazaar APIs in environments with unreliable connections","Design UI to gracefully degrade to installed-packages-only mode when the marketplace is offline"],"tags":["bazaar","marketplace","network","offline","go"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}