siyuan-note/siyuan · warning

Conf.Language(332)

Error message

Conf.Language(332)

What it means

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'.

Source

Thrown at kernel/model/import_obsidian.go:312

		obsidianTasksMu.Unlock()
		return ret, errors.New(Conf.Language(331))
	}
	if task.Cancel != nil {
		task.Cancel()
	}
	finishObsidianTaskLocked(task, ObsidianTaskStateCancelled, "Import cancelled", "")
	ret := snapshotObsidianTask(task)
	obsidianTasksMu.Unlock()
	removeObsidianTemp(taskID)
	return ret, nil
}

func StartObsidianVaultImport(taskID, notebookName string) (*ObsidianVaultTask, error) {
	obsidianTasksMu.Lock()
	task := obsidianTasks[taskID]
	if task == nil || task.State != ObsidianTaskStateReady || task.Context == nil {
		obsidianTasksMu.Unlock()
		return nil, errors.New(Conf.Language(332))
	}
	if time.Now().After(task.ExpiresAt) {
		finishObsidianTaskLocked(task, ObsidianTaskStateCancelled, "Analysis expired", "")
		obsidianTasksMu.Unlock()
		return nil, errors.New(Conf.Language(332))
	}

	name := strings.TrimSpace(util.RemoveInvalid(notebookName))
	if name == "" {
		name = task.Analysis.NotebookName
	}
	ctx, cancel := context.WithCancel(context.Background())
	task.Cancel = cancel
	task.State = ObsidianTaskStateRevalidating
	task.Progress = 1
	task.Message = "Revalidating source files"
	ret := snapshotObsidianTask(task)
	obsidianTasksMu.Unlock()

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Wait until GetObsidianVaultTask reports the task state is READY before calling start
  2. Start a new analysis if the taskID is unknown or the task is not READY anymore
  3. Do not call start twice for the same task; the first successful call moves it out of READY
  4. Handle the error by redirecting the user back to the analysis step in the import wizard

Example fix

// before
startObsidianImport(taskID, name) // may throw if not READY
// after
task, _ := getObsidianVaultTask(taskID)
if task != nil && task.State == "ready" {
    startObsidianImport(taskID, name)
}
Defensive patterns

Strategy: type-guard

Validate before calling

task, err := GetObsidianVaultTask(taskID)
ready := err == nil && task.State == "ready" && task.Context != nil
if !ready { /* re-analyze first */ }

Type guard

func readyToStart(t *ObsidianVaultTask) bool {
    return t != nil && t.State == ObsidianTaskStateReady && t.Context != nil
}

Try / catch

_, err := StartObsidianVaultImport(taskID, name)
if err != nil {
    taskID = reanalyze(vaultPath) // restart workflow
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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