{"record":{"id":"f5cd77ef79d2dad1","repo":"siyuan-note/siyuan","slug":"conf-language-332","errorCode":null,"errorMessage":"Conf.Language(332)","messagePattern":"Conf\\.Language\\(332\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/import_obsidian.go","lineNumber":312,"sourceCode":"\t\tobsidianTasksMu.Unlock()\n\t\treturn ret, errors.New(Conf.Language(331))\n\t}\n\tif task.Cancel != nil {\n\t\ttask.Cancel()\n\t}\n\tfinishObsidianTaskLocked(task, ObsidianTaskStateCancelled, \"Import cancelled\", \"\")\n\tret := snapshotObsidianTask(task)\n\tobsidianTasksMu.Unlock()\n\tremoveObsidianTemp(taskID)\n\treturn ret, nil\n}\n\nfunc StartObsidianVaultImport(taskID, notebookName string) (*ObsidianVaultTask, error) {\n\tobsidianTasksMu.Lock()\n\ttask := obsidianTasks[taskID]\n\tif task == nil || task.State != ObsidianTaskStateReady || task.Context == nil {\n\t\tobsidianTasksMu.Unlock()\n\t\treturn nil, errors.New(Conf.Language(332))\n\t}\n\tif time.Now().After(task.ExpiresAt) {\n\t\tfinishObsidianTaskLocked(task, ObsidianTaskStateCancelled, \"Analysis expired\", \"\")\n\t\tobsidianTasksMu.Unlock()\n\t\treturn nil, errors.New(Conf.Language(332))\n\t}\n\n\tname := strings.TrimSpace(util.RemoveInvalid(notebookName))\n\tif name == \"\" {\n\t\tname = task.Analysis.NotebookName\n\t}\n\tctx, cancel := context.WithCancel(context.Background())\n\ttask.Cancel = cancel\n\ttask.State = ObsidianTaskStateRevalidating\n\ttask.Progress = 1\n\ttask.Message = \"Revalidating source files\"\n\tret := snapshotObsidianTask(task)\n\tobsidianTasksMu.Unlock()","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/import_obsidian.go#L294-L330","documentation":"StartObsidianVaultImport rejected the request because the task is not in the READY state or lacks analysis context: the ID is unknown, the analysis never completed, or it already moved on. The kernel returns i18n message 332: 'The Obsidian Vault analysis is not ready or has expired'.","triggerScenarios":"Calling StartObsidianVaultTask(taskID, notebookName) at kernel/model/import_obsidian.go:312 when task==nil, task.State != ObsidianTaskStateReady, or task.Context==nil (analysis still running, failed, or unknown ID).","commonSituations":"User clicks 'start import' before the vault analysis finished; reusing a taskID whose import already started (state left READY); stale taskID after kernel restart; calling start twice concurrently.","solutions":["Wait until GetObsidianVaultTask reports the task state is READY before calling start","Start a new analysis if the taskID is unknown or the task is not READY anymore","Do not call start twice for the same task; the first successful call moves it out of READY","Handle the error by redirecting the user back to the analysis step in the import wizard"],"exampleFix":"// before\nstartObsidianImport(taskID, name) // may throw if not READY\n// after\ntask, _ := getObsidianVaultTask(taskID)\nif task != nil && task.State == \"ready\" {\n    startObsidianImport(taskID, name)\n}","handlingStrategy":"type-guard","validationCode":"task, err := GetObsidianVaultTask(taskID)\nready := err == nil && task.State == \"ready\" && task.Context != nil\nif !ready { /* re-analyze first */ }","typeGuard":"func readyToStart(t *ObsidianVaultTask) bool {\n    return t != nil && t.State == ObsidianTaskStateReady && t.Context != nil\n}","tryCatchPattern":"_, err := StartObsidianVaultImport(taskID, name)\nif err != nil {\n    taskID = reanalyze(vaultPath) // restart workflow\n}","preventionTips":["Gate the start action on a successful state poll showing READY","Never invoke start more than once per task","Reset the wizard to the analysis step when start fails"],"tags":["obsidian-import","task-not-found","invalid-state-transition","i18n"],"backgroundTag":"invalid-state-transition","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"}