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

  1. Verify network connectivity to the cloud provider endpoint
  2. Re-login to the SiYuan cloud account in Settings - Account if the token has expired
  3. Check the kernel log for the detailed err.Error() component to identify the specific cloud API failure
  4. 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

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


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/96747359f01946e7. Report an issue: GitHub.