{"record":{"id":"7bff72806ebf204b","repo":"siyuan-note/siyuan","slug":"bazaar-hash-not-available","errorCode":null,"errorMessage":"bazaar hash not available","messagePattern":"bazaar hash not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/bazaar/stage.go","lineNumber":224,"sourceCode":"// getStageIndexFromCache 仅从缓存获取 stage 索引，无缓存时返回 nil（读前根据 util 已同步的 bazaar hash 视情况清理缓存）\nfunc getStageIndexFromCache(ctx context.Context, pkgType string) *StageIndex {\n\tapplyBazaarCacheHash(ctx)\n\tbazaarMemMu.RLock()\n\tdefer bazaarMemMu.RUnlock()\n\treturn stageIndexCache[pkgType]\n}\n\n// getStageIndex 获取 stage 索引\nfunc getStageIndex(ctx context.Context, pkgType string) (ret *StageIndex, err error) {\n\tif cached := getStageIndexFromCache(ctx, pkgType); nil != cached {\n\t\tret = cached\n\t\treturn\n\t}\n\n\tbazaarHash := util.GetRhyBazaarHash(ctx)\n\tif \"\" == bazaarHash {\n\t\tlogging.LogErrorf(\"bazaar hash unavailable (rhy missing or invalid bazaar field)\")\n\t\terr = errors.New(\"bazaar hash not available\")\n\t\treturn\n\t}\n\tret = &StageIndex{}\n\trequest := httpclient.NewBrowserRequest()\n\tu := util.BazaarOSSServer + \"/bazaar@\" + bazaarHash + \"/stage/\" + pkgType + \".json\" // pkgType 单词为复数形式\n\tresp, reqErr := request.SetContext(ctx).SetSuccessResult(ret).Get(u)\n\tif nil != reqErr {\n\t\tlogging.LogErrorf(\"get community stage index [%s] failed: %s\", u, reqErr)\n\t\terr = reqErr\n\t\treturn\n\t}\n\tif 200 != resp.StatusCode {\n\t\tlogging.LogErrorf(\"get community stage index [%s] failed: %d\", u, resp.StatusCode)\n\t\terr = errors.New(\"get stage index failed\")\n\t\treturn\n\t}\n\n\tfor _, repo := range ret.Repos {","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/bazaar/stage.go#L206-L242","documentation":"getStageIndex fetches the community stage index from BazaarOSSServer using a hash obtained from util.GetRhyBazaarHash. If the rhy service response is missing or its bazaar field yields an empty hash, the library cannot build the index URL and throws 'bazaar hash not available'. This is a guard against proceeding with an unusable upstream address.","triggerScenarios":"getStageRepoByURL or GetExistingBazaarPackageNames calls getStageIndex while util.GetRhyBazaarHash(ctx) returns \"\" — the rhy endpoint was unreachable, returned invalid JSON, or omitted the bazaar field.","commonSituations":"Network outage or firewall blocking the rhy server; rhy service temporarily returning malformed data; offline development environment; DNS/proxy misconfiguration.","solutions":["Check network connectivity to the rhy/bazaar servers and any proxy settings.","Retry later — the rhy service may be temporarily down or returning bad data.","Verify util.BazaarOSSServer / rhy endpoint configuration is correct and not pointed at a stale mirror."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"names, err := GetExistingBazaarPackageNames(ctx, \"plugins\", pkgs)\nif err != nil {\n    log.Printf(\"stage index unavailable: %v\", err)\n    // backoff and retry\n}","preventionTips":["Check network/proxy reachability to rhy and bazaar OSS before marketplace operations.","Retry with exponential backoff — rhy outages are usually transient.","Surface a clear 'marketplace unavailable (offline?)' message in tooling."],"tags":["bazaar","network","rhy"],"backgroundTag":"empty-response-body","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"}