{"record":{"id":"b31fcab70dd1d09c","repo":"siyuan-note/siyuan","slug":"conf-language-34","errorCode":null,"errorMessage":"Conf.Language(34)","messagePattern":"Conf\\.Language\\(34\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/onboarding.go","lineNumber":109,"sourceCode":"\tonboarding := Conf.Onboarding\n\tif !onboarding.NewUser || onboarding.Dismissed {\n\t\treturn cloneOnboarding(onboarding), false, nil\n\t}\n\n\tboxes, listErr := ListNotebooks()\n\tif listErr != nil {\n\t\treturn cloneOnboarding(onboarding), false, listErr\n\t}\n\tdocumentExists := onboarding.NotebookID != \"\" && onboarding.DocumentID != \"\" && filelock.IsExist(filepath.Join(\n\t\tutil.DataDir, onboarding.NotebookID, onboarding.DocumentID+\".sy\"))\n\tif reconcileOnboarding(onboarding, boxes, documentExists) {\n\t\tConf.Save()\n\t}\n\tif !onboarding.NewUser || onboarding.State == conf.OnboardingCompleted {\n\t\treturn cloneOnboarding(onboarding), false, nil\n\t}\n\tif util.ReadOnly || Conf.Publish.Enable {\n\t\treturn cloneOnboarding(onboarding), false, errors.New(Conf.Language(34))\n\t}\n\n\tif onboarding.NotebookID == \"\" {\n\t\tif len(boxes) > 0 {\n\t\t\tif len(boxes) == 1 && boxes[0].Name == Conf.Language(342) {\n\t\t\t\tonboarding.NotebookID = boxes[0].ID\n\t\t\t\tonboarding.State = conf.OnboardingNotebookCreated\n\t\t\t\tConf.Save()\n\t\t\t} else {\n\t\t\t\tonboarding.State = conf.OnboardingCompleted\n\t\t\t\tonboarding.NewUser = false\n\t\t\t\tConf.Save()\n\t\t\t\treturn cloneOnboarding(onboarding), false, nil\n\t\t\t}\n\t\t}\n\n\t\tif onboarding.NotebookID == \"\" {\n\t\t\tonboarding.NotebookID, err = CreateBox(Conf.Language(342))","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/onboarding.go#L91-L127","documentation":"EnsureOnboarding refuses to run the first-run onboarding flow when the workspace is in read-only mode or publish mode is enabled, returning a localized error (Conf.Language(34), 'This operation is not supported in read-only mode'). Onboarding needs to create a notebook and document, which read-only/publish mode forbids.","triggerScenarios":"Calling EnsureOnboarding (via ensureOnboarding at startup) when util.ReadOnly is true or Conf.Publish.Enable is true while the onboarding state says a new-user walkthrough is still pending (onboarding.NewUser and State != OnboardingCompleted).","commonSituations":"Starting SiYuan with the workspace opened read-only (e.g. on read-only media or with the read-only flag) as a brand-new user; serving the workspace in publish mode where writes are disabled; automated/headless first launch under a read-only constraint.","solutions":["Open the workspace in normal (writable) mode to complete onboarding, then switch back to read-only/publish if needed","Disable publish mode (Settings - Publish) or start the kernel without the read-only constraint","If the workspace should never onboard (shared/replica workspace), mark the user as non-new or set onboarding state to completed so the guard is never reached","Verify the data directory is writable; read-only mode may have been auto-activated because the disk or files are not writable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if util.ReadOnly || conf.Conf.Publish.Enable {\n    // skip or defer onboarding instead of calling EnsureOnboarding\n    return\n}\nonboarding, created, err := EnsureOnboarding()","typeGuard":null,"tryCatchPattern":"onboarding, created, err := EnsureOnboarding()\nif err != nil {\n    // localized read-only notice; not fatal - continue without onboarding UI\n    log.Printf(\"onboarding skipped: %s\", err.Error())\n    return\n}","preventionTips":["Check util.ReadOnly and Conf.Publish.Enable before triggering first-run onboarding","Complete onboarding in a writable session before switching the workspace to read-only/publish mode","For cloned or replica workspaces, pre-mark onboarding state as completed to avoid the guard entirely"],"tags":["onboarding","read-only","publish","configuration"],"backgroundTag":"read-only-mode-rejected","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}