siyuan-note/siyuan · error
get current bazaar index failed
Error message
get current bazaar index failed: %w; get legacy bazaar index failed: %v
What it means
fetchBazaarIndex tries the current CDN bucket path for the bazaar package index; if that fails it falls back to the legacy index path. Only when BOTH the current and legacy index fetches fail does it wrap both failures into this combined error. It reports two underlying causes: the current-index error (%w) and the legacy-index error (%v).
Solutions
- Read the two embedded causes: fix the specific network problem reported by the current-index error first
- Restore connectivity / configure the proxy so the CDN bucket URL is reachable
- Retry later if both endpoints are down at the CDN side
- Check kernel logs for the underlying fetch errors (DNS vs TLS vs status code) to target the fix
Example fix
// before: ignoring the wrapped causes
log.Println(err)
// after: unwrap the current-index cause
var cur error
if e := errors.Unwrap(err); e != nil { cur = e }
log.Printf("bazaar index unreachable, current cause: %v", cur) Defensive patterns
Strategy: retry
Validate before calling
// check basic reachability of the bazaar host before calling the API
const online = await fetch("https://bazaar.si-yuan.com/index.json", {method: "HEAD"}).then(r => r.ok).catch(() => false);
if (!online) console.warn("bazaar unreachable; expect combined index error"); Try / catch
try { await listBazaar() } catch (e) { if (String(e).includes("get current bazaar index failed")) { await delay(2000); retry(maxAttempts = 3); } } Prevention
- Read both embedded causes to identify which endpoint path failed
- Retry with backoff since both CDN paths can fail transiently
- Verify proxy/DNS when errors persist
- Keep the kernel updated for current CDN URL schemes
When it happens
Trigger: Any marketplace index load (plugins/themes/icons/templates/widgets listing) when both https CDN bucket path and legacy path fail: DNS failure, blocked hosts, TLS errors, non-200 responses from both endpoints, or request context cancellation.
Common situations: Fully offline machines; firewalls blocking all bazaar hosts; CDN misconfiguration or both endpoints returning 5xx; clock skew is unrelated here but an expired/changed CDN path plus a removed legacy path yields this.
Related errors
- unexpected status code
- bazaar hash not available
- bazaar is offline
- get bazaar package failed, please check your network
- get stage index failed
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/9a7744e380d677d5.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/bazaar/index.go:177
}
func snapshotBazaarIndex(now time.Time) (snapshot *bazaarIndexSnapshot, fresh, canRetry bool) {
bazaarIndexState.mu.RLock()
defer bazaarIndexState.mu.RUnlock()
snapshot = bazaarIndexState.snapshot
fresh = nil != snapshot && now.Before(bazaarIndexState.expiresAt)
canRetry = bazaarIndexState.retryAt.IsZero() || !now.Before(bazaarIndexState.retryAt)
return
}
func fetchBazaarIndex(ctx context.Context) (ret *bazaarIndexSnapshot, err error) {
ret, err = fetchBazaarIndexPath(ctx, bazaarIndexPath)
if nil == err {
return
}
legacy, legacyErr := fetchBazaarIndexPath(ctx, bazaarLegacyIndexPath)
if nil != legacyErr {
return nil, fmt.Errorf("get current bazaar index failed: %w; get legacy bazaar index failed: %v", err, legacyErr)
}
return legacy, nil
}
func fetchBazaarIndexPath(ctx context.Context, indexPath string) (ret *bazaarIndexSnapshot, err error) {
timeBucket := bazaarIndexNow().Unix() / int64(bazaarIndexCDNBucket/time.Second)
u := fmt.Sprintf("%s%s?t=%d", bazaarIndexStatServer, indexPath, timeBucket)
buf := &bytes.Buffer{}
resp, err := httpclient.NewBrowserRequest().SetRetryCount(0).SetContext(ctx).SetOutput(buf).Get(u)
if nil != err {
return nil, err
}
if 200 != resp.StatusCode {
return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode)
}
return parseBazaarIndex(buf.Bytes())
}
View on GitHub (pinned to 9f775e8a12)