siyuan-note/siyuan · error
Conf.Language(30) + " " + err.Error()
Error message
Conf.Language(30) + " " + err.Error()
What it means
GetCloudSpace wraps getCloudSpace and prefixes any underlying failure with the localized string for i18n key 30 ("Failed to obtain cloud info"). The final error message is "<localized prefix> <underlying error>". The real cause is always in the appended err.Error() — typically network failure, auth expiry, or a cloud API error.
Solutions
- Read the full error message after the prefix to identify the underlying cause.
- Check network connectivity and proxy/firewall settings for the cloud endpoint.
- Log out and back in at Settings - Account & Sync - Account to refresh the token.
- Retry later if the cloud service is temporarily unavailable.
Example fix
// before
const resp = await fetchPost('/api/repo/getCloudSpace', {});
// after
const resp = await fetchPost('/api/repo/getCloudSpace', {});
if (resp.code !== 0 && resp.msg.includes('Failed to obtain cloud info')) {
// inspect resp.msg tail for the underlying cause; check network, re-login
await fetchPost('/api/account/logout', {});
// prompt user to log in again
} Defensive patterns
Strategy: try-catch
Validate before calling
if (!navigator.onLine) {
throw new Error('Cannot get cloud space while offline');
} Try / catch
try {
const resp = await fetchPost('/api/repo/getCloudSpace', {});
} catch (e) {
// message = localized prefix + underlying cause; parse tail after 'Failed to obtain cloud info'
const cause = e.message.replace(/^.*?Failed to obtain cloud info\s*/, '');
if (/network|timeout|dial/i.test(cause)) showNetworkHelp();
else if (/auth|token|login/i.test(cause)) promptRelogin();
} Prevention
- Check connectivity before querying cloud space in scripts.
- Re-authenticate after long idle periods to avoid expired-token failures.
- Always inspect the appended underlying error, not just the localized prefix.
- Handle cloud maintenance windows with retry/backoff.
When it happens
Trigger: POST /api/repo/getCloudSpace (opening the cloud storage dialog or checking cloud usage) when the request to the cloud service fails: network outage, expired/invalid session token, subscription issues, or cloud-side 5xx.
Common situations: Offline or behind a proxy/firewall blocking the cloud endpoint; session token expired after long idle; cloud service maintenance; DNS failures on restricted networks.
Related errors
- Backup failed
- Failed to obtain cloud info
- : (Conf.Language(376) wrapping underlying error)
- Backup failed: The cloud can only support backup up to 12…
- bazaar package information has not synced yet
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/6a99ad920b199790.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/repository.go:3261
type Backup struct {
Size int64 `json:"size"`
HSize string `json:"hSize"`
Updated string `json:"updated"`
SaveDir string `json:"saveDir"` // 本地备份数据存放目录路径
}
type Sync struct {
Size int64 `json:"size"`
HSize string `json:"hSize"`
Updated string `json:"updated"`
CloudName string `json:"cloudName"` // 云端同步数据存放目录名
SaveDir string `json:"saveDir"` // 本地同步数据存放目录路径
}
func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchangeSize, hTrafficUploadSize, hTrafficDownloadSize, hTrafficAPIGet, hTrafficAPIPut string, err error) {
stat, err := getCloudSpace()
if err != nil {
err = errors.New(Conf.Language(30) + " " + err.Error())
return
}
syncSize := stat.Sync.Size
syncUpdated := stat.Sync.Updated
s = &Sync{
Size: syncSize,
HSize: "-",
Updated: syncUpdated,
}
backupSize := stat.Backup.Size
backupUpdated := stat.Backup.Updated
b = &Backup{
Size: backupSize,
HSize: "-",
Updated: backupUpdated,
}View on GitHub (pinned to 8641553a1f)