{"record":{"id":"542f2635c97409be","repo":"siyuan-note/siyuan","slug":"workspace-dir-s-is-in-third-party-sync-dir","errorCode":null,"errorMessage":"workspace dir [%s] is in third party sync dir","messagePattern":"workspace dir \\[(.+?)\\] is in third party sync dir","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"kernel/util/runtime.go","lineNumber":281,"sourceCode":"\n\tfor {\n\t\t<-thirdPartySyncCheckTicker.C\n\t\tcheckFileSysStatus()\n\t}\n}\n\nfunc checkFileSysStatus() {\n\tdefer logging.Recover()\n\n\tif !checkFileSysStatusLock.TryLock() {\n\t\tlogging.LogWarnf(\"check file system status is locked, skip\")\n\t\treturn\n\t}\n\tdefer checkFileSysStatusLock.Unlock()\n\n\tconst fileSysStatusCheckFile = \".siyuan/filesys_status_check\"\n\tif IsCloudDrivePath(WorkspaceDir) {\n\t\tReportFileSysFatalError(fmt.Errorf(\"workspace dir [%s] is in third party sync dir\", WorkspaceDir))\n\t\treturn\n\t}\n\n\tdir := filepath.Join(DataDir, fileSysStatusCheckFile)\n\tif err := os.RemoveAll(dir); err != nil {\n\t\tReportFileSysFatalError(err)\n\t\treturn\n\t}\n\n\tif err := os.MkdirAll(dir, 0755); err != nil {\n\t\tReportFileSysFatalError(err)\n\t\treturn\n\t}\n\n\tfor range 7 {\n\t\ttmp := filepath.Join(dir, \"check_consistency\")\n\t\tdata := make([]byte, 1024*4)\n\t\t_, err := rand.Read(data)","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/util/runtime.go#L263-L299","documentation":"Reported via ReportFileSysFatalError (kernel/util/runtime.go:281) when IsCloudDrivePath(WorkspaceDir) returns true during the periodic filesystem consistency check. ReportFileSysFatalError logs and calls os.Exit(logging.ExitCodeFileSysErr), so this error TERMINATES THE KERNEL. SiYuan refuses to run on top of third-party sync folders because they corrupt the .sy block tree via concurrent rename/write.","triggerScenarios":"The workspace directory path matches a known cloud-sync folder: OneDrive, Dropbox, Google Drive, pCloud, 坚果云 (Nutstore), 天翼云, or (on macOS) an iCloud ubiquitous location detected via system metadata. The check runs on the thirdPartySyncCheckTicker every cycle once CheckFileSysStatus starts.","commonSituations":"User picks ~/OneDrive/SiYuan or ~/Dropbox/SiYuan as the workspace; macOS user puts the workspace under ~/Library/Mobile Documents/com~apple~CloudDocs; first-run dialog ignored; workspace moved into a sync folder after initial setup.","solutions":["Move the workspace to a plain local directory outside any cloud-sync folder (e.g. ~/Documents/SiYuan).","Use SiYuan's built-in sync (S3/WebDAV/liuyun) instead of a sync-client folder.","If you must keep files in a sync folder for read-only backup, exclude the workspace from the sync client's watch list.","After moving, restart the kernel — the check only re-evaluates on each tick after boot."],"exampleFix":"// before: workspace = /Users/me/OneDrive/SiYuan\n// kernel exits with: workspace dir [...] is in third party sync dir\n\n// after: move workspace out of the sync folder and reconfigure\n// 设置 - 关于 - 工作空间 -> /Users/me/Documents/SiYuan\n// then restart SiYuan","handlingStrategy":"validation","validationCode":"// Pre-check at startup or before assigning a workspace\nif util.IsCloudDrivePath(candidateWorkspace) {\n    return fmt.Errorf(\"refusing workspace %s: it is inside a cloud-sync folder\", candidateWorkspace)\n}","typeGuard":null,"tryCatchPattern":"// This error is FATAL (os.Exit) — there is no catch. The only defense is prevention:\n// never start the kernel with a workspace inside a sync folder.","preventionTips":["Never place the workspace under OneDrive, Dropbox, Google Drive, pCloud, 坚果云, 天翼云, or iCloud.","Use SiYuan's built-in sync (S3/WebDAV/liuyun) for cross-device data.","If you must co-exist with a sync client, exclude the workspace directory from its watch list.","After moving the workspace, restart the kernel so the periodic check re-evaluates."],"tags":["filesystem","cloud-sync","fatal","workspace","go"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}