{"record":{"id":"db2c4243d671414b","repo":"siyuan-note/siyuan","slug":"backup-failed-the-cloud-can-only-support-backup-u","errorCode":null,"errorMessage":"Backup failed: The cloud can only support backup up to 12 snapshots","messagePattern":"Backup failed: The cloud can only support backup up to 12 snapshots","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/repository.go","lineNumber":1482,"sourceCode":"\tswitch Conf.Sync.Provider {\n\tcase conf.ProviderSiYuan:\n\t\tif !IsSubscriber() {\n\t\t\tutil.PushErrMsg(Conf.Language(29), 5000)\n\t\t\treturn\n\t\t}\n\tcase conf.ProviderWebDAV, conf.ProviderS3, conf.ProviderLocal:\n\t\tif !IsPaidUser() {\n\t\t\tutil.PushErrMsg(Conf.Language(214), 5000)\n\t\t\treturn\n\t\t}\n\t}\n\n\tutil.PushEndlessProgress(Conf.Language(116))\n\tdefer util.PushClearProgress()\n\tuploadFileCount, uploadChunkCount, uploadBytes, err := repo.UploadTagIndex(tag, id, map[string]any{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})\n\tif err != nil {\n\t\tif errors.Is(err, dejavu.ErrCloudBackupCountExceeded) {\n\t\t\terr = fmt.Errorf(Conf.Language(84), Conf.Language(154))\n\t\t\treturn\n\t\t}\n\t\terr = fmt.Errorf(Conf.Language(84), formatRepoErrorMsg(err))\n\t\treturn\n\t}\n\tmsg := fmt.Sprintf(Conf.Language(152), uploadFileCount, uploadChunkCount, humanize.BytesCustomCeil(uint64(uploadBytes), 2))\n\tutil.PushMsg(msg, 5000)\n\tutil.PushStatusBar(msg)\n\treturn\n}\n\nfunc RemoveCloudRepoTag(tag string) (err error) {\n\tif 1 > len(Conf.Repo.Key) {\n\t\terr = errors.New(Conf.Language(26))\n\t\treturn\n\t}\n\n\trepo, err := newRepository()","sourceCodeStart":1464,"sourceCodeEnd":1500,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/repository.go#L1464-L1500","documentation":"The cloud snapshot upload was rejected because the cloud provider enforces a hard limit of 12 stored backup snapshots. When dejavu's UploadTagIndex detects that uploading a new snapshot would exceed this ceiling, it returns ErrCloudBackupCountExceeded, which the UploadCloudSnapshot function wraps into a user-facing 'Backup failed: The cloud can only support backup up to 12 snapshots' message (Language 84 template + Language 154 text). This is a deliberate quota enforced server-side by the cloud storage backend.","triggerScenarios":"Calling the UploadCloudSnapshot API (or the frontend cloud-backup action behind it) when the cloud repo already holds 12 snapshots. The dejavu repository engine compares the current cloud snapshot count against the constant 12 and returns ErrCloudBackupCountExceeded before the upload begins.","commonSituations":"A user who has been creating cloud backups regularly without cleaning up old ones eventually hits the 12-snapshot ceiling. This is common for paid subscribers on SiYuan cloud or WebDAV/S3 who rely on frequent automatic backups and never manually prune cloud snapshots.","solutions":["Delete one or more existing cloud snapshots via RemoveCloudRepoTag before uploading a new one, freeing a slot under the 12-snapshot limit","Use GetCloudRepoTagSnapshots to list current cloud snapshots and remove the oldest or least important ones","Switch to a sync-based workflow (syncRepo) instead of discrete cloud backups if you need more version history, since sync snapshots are managed differently from backup snapshots"],"exampleFix":"// before\nerr = model.UploadCloudSnapshot(tag, id)\n\n// after\nlogs, _ := model.GetCloudRepoTagSnapshots()\nif len(logs) >= 12 {\n    // remove oldest cloud tag to make room\n    model.RemoveCloudRepoTag(logs[len(logs)-1].ID)\n}\nerr = model.UploadCloudSnapshot(tag, id)","handlingStrategy":"validation","validationCode":"// Before calling UploadCloudSnapshot, check cloud snapshot count\nlogs, listErr := model.GetCloudRepoTagSnapshots()\nif listErr == nil && len(logs) >= 12 {\n    // remove oldest snapshot to free a slot\n    model.RemoveCloudRepoTag(logs[len(logs)-1].ID)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor cloud snapshot count periodically and prune old snapshots before hitting the 12-snapshot ceiling","Implement a rotation policy: when creating a new cloud backup, automatically remove the oldest one","Document the 12-snapshot limit for users who configure automatic cloud backup workflows"],"tags":["cloud","backup","quota","dejavu"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}