siyuan-note/siyuan · error
Conf.Language(30) {err.Error()}
Error message
Conf.Language(30) {err.Error()} What it means
The GetCloudSpace function queries the cloud provider for sync, backup, and asset storage usage statistics. When the underlying getCloudSpace call fails (network error, auth failure, or API error), the function wraps the error with Language(30) as a prefix and returns it. The error message combines a localized error label with the raw underlying error detail.
Source
Thrown at kernel/model/repository.go:3000
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 251596fc0d)
Solutions
- Verify network connectivity to the cloud provider endpoint
- Re-login to the SiYuan cloud account in Settings - Account if the token has expired
- Check the kernel log for the detailed err.Error() component to identify the specific cloud API failure
- If using WebDAV/S3, verify the server URL, credentials, and that the endpoint is responding
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check cloud connectivity before calling GetCloudSpace
if model.Conf.Sync.Provider == 0 {
// no provider configured, skip space query
return
} Try / catch
// Handle cloud space query failure gracefully
stat, err := model.GetCloudSpace()
if err != nil {
// show placeholder values instead of crashing the settings panel
hSize = "-"
hTotalSize = "-"
logging.LogErrorf("get cloud space failed: %s", err)
} Prevention
- Cache the last successful cloud space result and display it when the API fails
- Add a timeout to the cloud space query to prevent the settings panel from hanging
- Show placeholder dash values in the UI when the query fails rather than an error screen
- Verify authentication status before querying cloud space
When it happens
Trigger: Calling GetCloudSpace (typically from the Settings - Account & sync space usage display) when the cloud API is unreachable, returns an error, or the authentication token has expired. The function delegates to getCloudSpace which makes the actual HTTP request to the cloud provider.
Common situations: Network connectivity issues to the SiYuan cloud or third-party provider (WebDAV/S3). Expired login sessions where the auth token is no longer valid. Cloud provider maintenance or downtime. Also seen when the user has not logged in but the settings panel tries to load space statistics.
Related errors
- failed to connect cloud server
- Account authentication failed, please login again
- send article to liandi failed [sc=%d]
- discover OIDC provider failed: %w
- exchange OIDC authorization code failed: %w
AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12).
Data as JSON: /api/errors/96747359f01946e7.
Report an issue: GitHub.