siyuan-note/siyuan · error
get rhy result failed
Error message
get rhy result failed: %d
What it means
getRhyResult0 fetches version/marketplace metadata from the SiYuan rhy endpoint and fails when the HTTP response status is not 200. The formatted message includes the numeric status code so the caller can identify what the server returned.
Solutions
- Check the status code in the message: 429 means back off and retry later; 5xx means upstream outage
- Verify network/proxy connectivity to the SiYuan update endpoint
- Retry after a delay; the result is cached once a 200 is received
- If behind a firewall, allowlist the endpoint or use an environment with unrestricted access
Example fix
// before
rhy, err := util.GetRhyResult(false)
if err != nil { return err } // "get rhy result failed: 502"
// after
rhy, err := util.GetRhyResult(false)
if err != nil {
logging.LogWarnf("rhy unavailable, using cached/default: %v", err)
rhy = fallbackRhyResult // continue with degraded functionality
} Defensive patterns
Strategy: retry
Validate before calling
resp, err := http.Head(rhyURL)
if err != nil || resp.StatusCode != http.StatusOK {
return errors.New("rhy endpoint unreachable or non-200; use cached result")
} Try / catch
rhy, err := util.GetRhyResult(false)
if err != nil {
logging.LogWarnf("rhy fetch failed (%v); falling back to cached result", err)
rhy = cachedOrMinimalResult()
}
// schedule a retry with backoff for 429/5xx Prevention
- Cache the last successful rhy result for offline/degraded use
- Back off on 429 instead of hammering the endpoint
- Allowlist the SiYuan update endpoints in restricted networks
- Monitor status codes surfaced in kernel logs
When it happens
Trigger: Any call that resolves the cached rhy result (version checks, marketplace/bazaar listings) when the remote server responds with a non-200 status such as 403, 429, 502, or 5xx.
Common situations: Rate limiting by the remote endpoint; CDN/proxy or firewall blocking requests; regional network issues; temporary upstream outages; corporate proxies returning 403/407.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
- authentication probe returned HTTP " + response.status
- bazaar is offline
- boot progress request returned HTTP " + response.status
- Conf.Language(46)
- discover OIDC provider failed
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/5c0faf4c13ffae5d.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/util/rhy.go:86
}
ret := v.(map[string]any)
syncRhyBazaarHashFromResult(ret)
return ret, nil
}
func getRhyResult0(ctx context.Context) (map[string]any, error) {
rhyResultLock.Lock()
defer rhyResultLock.Unlock()
request := httpclient.NewCloudRequest30s()
resp, err := request.SetContext(ctx).SetSuccessResult(&cachedRhyResult).Get(GetCloudServer() + "/apis/siyuan/version?ver=" + Ver)
if err != nil {
logging.LogErrorf("get version info failed: %s", err)
return nil, err
}
if 200 != resp.StatusCode {
logging.LogErrorf("get rhy result failed: %d", resp.StatusCode)
return nil, fmt.Errorf("get rhy result failed: %d", resp.StatusCode)
}
rhyResultCacheTime = time.Now().Unix()
return cachedRhyResult, nil
}
func syncRhyBazaarHashFromResult(m map[string]any) {
rhyBazaarHashLock.Lock()
defer rhyBazaarHashLock.Unlock()
if nil == m {
rhyBazaarHash = ""
return
}
v, ok := m["bazaar"]
if !ok || nil == v {
rhyBazaarHash = ""
return
}
s, ok := v.(string)View on GitHub (pinned to 9f775e8a12)