{"record":{"id":"5c0faf4c13ffae5d","repo":"siyuan-note/siyuan","slug":"get-rhy-result-failed-d","errorCode":null,"errorMessage":"get rhy result failed: %d","messagePattern":"get rhy result failed: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/util/rhy.go","lineNumber":86,"sourceCode":"\t}\n\tret := v.(map[string]any)\n\tsyncRhyBazaarHashFromResult(ret)\n\treturn ret, nil\n}\n\nfunc getRhyResult0(ctx context.Context) (map[string]any, error) {\n\trhyResultLock.Lock()\n\tdefer rhyResultLock.Unlock()\n\n\trequest := httpclient.NewCloudRequest30s()\n\tresp, err := request.SetContext(ctx).SetSuccessResult(&cachedRhyResult).Get(GetCloudServer() + \"/apis/siyuan/version?ver=\" + Ver)\n\tif err != nil {\n\t\tlogging.LogErrorf(\"get version info failed: %s\", err)\n\t\treturn nil, err\n\t}\n\tif 200 != resp.StatusCode {\n\t\tlogging.LogErrorf(\"get rhy result failed: %d\", resp.StatusCode)\n\t\treturn nil, fmt.Errorf(\"get rhy result failed: %d\", resp.StatusCode)\n\t}\n\trhyResultCacheTime = time.Now().Unix()\n\treturn cachedRhyResult, nil\n}\n\nfunc syncRhyBazaarHashFromResult(m map[string]any) {\n\trhyBazaarHashLock.Lock()\n\tdefer rhyBazaarHashLock.Unlock()\n\tif nil == m {\n\t\trhyBazaarHash = \"\"\n\t\treturn\n\t}\n\tv, ok := m[\"bazaar\"]\n\tif !ok || nil == v {\n\t\trhyBazaarHash = \"\"\n\t\treturn\n\t}\n\ts, ok := v.(string)","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/util/rhy.go#L68-L104","documentation":"getRhyResult0 fetches version/bazaar metadata from SiYuan's rhy backend service and caches the result. When the HTTP response status is not 200, the function logs the status code and returns this error instead of the parsed payload. It means the remote metadata endpoint answered, but rejected the request or reported a server-side problem.","triggerScenarios":"Calling any kernel API that resolves version/bazaar info (update checks, marketplace listing) when the rhy endpoint returns a non-200 status: server outage (5xx), blocked or rate-limited request (403/429), or a proxy returning an error page.","commonSituations":"Corporate proxy or firewall intercepting the request to the rhy service; rhy backend temporarily down or under maintenance; regional network restrictions (e.g. accessing liuyun.io/ld246 endpoints from restricted networks); stale DNS pointing at a wrong server.","solutions":["Check network connectivity to the rhy endpoint and retry later if the server is down","Inspect proxy/firewall settings; ensure the kernel's HTTPS requests are not intercepted","Clear any cached network state and restart the kernel, then retry the update/marketplace operation","If behind a corporate proxy, configure HTTPS_PROXY for the kernel process"],"exampleFix":"// before: no status handling by caller\nresult, err := getRhyResult()\n// after: tolerate failure and fall back to cached/default metadata\nresult, err := getRhyResult()\nif err != nil {\n    logging.LogWarnf(\"falling back to cached rhy result: %s\", err)\n    result = lastKnownGoodRhyResult\n}","handlingStrategy":"retry","validationCode":"// before calling an API that hits rhy\nif !navigator.onLine { skipRemoteCheck() }","typeGuard":null,"tryCatchPattern":"result, err := getRhyResult()\nif err != nil {\n    logging.LogWarnf(\"rhy unavailable, using cached data: %s\", err)\n    result = cachedRhyResult // degrade gracefully\n}","preventionTips":["Design update/marketplace checks to be non-fatal and fall back to cached metadata","Retry with backoff for transient 5xx responses","Document proxy configuration for corporate users"],"tags":["network","http","remote-api"],"backgroundTag":"http-error-response","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}