siyuan-note/siyuan · error

Conf.Language(53)

Error message

Conf.Language(53)

What it means

During SyncDataBeforeEnableEncryptedNotebook, after the cloud directory name passes validation, the kernel runs checkSync(false, false, true) to verify sync is actually possible (network reachable, auth valid, index usable). If that preflight check fails, localized message 53 is returned and enabling the encrypted notebook is blocked, since a failed sync means the cloud state cannot be guaranteed.

Solutions

  1. Restore network connectivity / valid cloud authentication, then retry enabling the encrypted notebook.
  2. Open the sync settings or use the manual sync button to confirm sync works before enabling encryption.
  3. If checkSync reported suspended sync, resume sync (resumeSync) first.
  4. If cloud sync is unwanted, disable sync before enabling the encrypted notebook.

Example fix

// before
err := model.SyncDataBeforeEnableEncryptedNotebook()
// after
model.ResumeSync() // ensure sync is not suspended
err := model.SyncDataBeforeEnableEncryptedNotebook()
Defensive patterns

Strategy: try-catch

Validate before calling

// Go: preflight reachability and auth before enabling
if conf.Sync.Enabled && !syncAvailable() { /* fix network/auth first */ }

Try / catch

if err := model.SyncDataBeforeEnableEncryptedNotebook(); err != nil {
    // Language(53): sync preflight failed; check network/auth, then retry
    return err
}

Prevention

When it happens

Trigger: EnableEncryptedNotebookWithSync is invoked with sync enabled, a valid CloudName, but checkSync fails — e.g. no network connection, invalid cloud authentication token, cloud service unreachable, or sync suspended (auto-sync in a suspended state).

Common situations: User is offline when trying to enable encryption; cloud subscription expired or token invalidated; SiYuan cloud endpoint unreachable; sync was suspended by a previous error and not resumed.

Related errors


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/179c56db31cdc343. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/sync.go:236

	}
	return
}

func SyncData(byHand bool) {
	syncData(false, byHand)
}

// SyncDataBeforeEnableEncryptedNotebook 在启用加密笔记本前执行一次完整同步。
// 未启用数据同步时直接返回;已启用数据同步时,任何同步失败都会阻止继续创建新的密钥体系。
func SyncDataBeforeEnableEncryptedNotebook() error {
	if !Conf.Sync.Enabled {
		return nil
	}
	if !cloud.IsValidCloudDirName(Conf.Sync.CloudName) {
		return errors.New(Conf.Language(123))
	}
	if !checkSync(false, false, true) {
		return errors.New(Conf.Language(53))
	}

	// 不复用请求合并状态,确保调用返回前确实完成了一次由当前启用操作发起的完整同步。
	lockSync()
	defer unlockSync()
	if err := syncDataLocked(false, true); err != nil {
		if Conf.Sync.Stat != "" {
			return errors.New(Conf.Sync.Stat)
		}
		return err
	}
	return nil
}

func lockSync() {
	syncLock.Lock()
	isSyncing.Store(true)
}

View on GitHub (pinned to 8641553a1f)