siyuan-note/siyuan · error

Conf.Language(330)

Error message

Conf.Language(330)

What it means

`GetObsidianVaultTask` looks up an import task by ID in the in-memory `obsidianTasks` map. If the ID is unknown — or the task has been evicted after completion/expiry — it returns the localized message 'Obsidian Vault import task not found or expired' (Conf.Language(330)) instead of a snapshot.

Source

Thrown at kernel/model/import_obsidian.go:280

	task := &obsidianTask{TaskID: taskID, State: ObsidianTaskStateQueued, Message: "Waiting to analyze", Cancel: cancel}
	obsidianTasks[taskID] = task
	obsidianActive = taskID
	ret := snapshotObsidianTask(task)
	obsidianTasksMu.Unlock()

	if replacedTaskID != "" {
		removeObsidianTemp(replacedTaskID)
	}
	go analyzeObsidianVaultTask(ctx, taskID, localPath)
	return ret, nil
}

func GetObsidianVaultTask(taskID string) (*ObsidianVaultTask, error) {
	obsidianTasksMu.Lock()
	defer obsidianTasksMu.Unlock()
	task := obsidianTasks[taskID]
	if task == nil {
		return nil, errors.New(Conf.Language(330))
	}
	return snapshotObsidianTask(task), nil
}

func CancelObsidianVaultTask(taskID string) (*ObsidianVaultTask, error) {
	obsidianTasksMu.Lock()
	task := obsidianTasks[taskID]
	if task == nil {
		obsidianTasksMu.Unlock()
		return nil, errors.New(Conf.Language(330))
	}
	if !isObsidianCancellableState(task.State) {
		ret := snapshotObsidianTask(task)
		obsidianTasksMu.Unlock()
		return ret, errors.New(Conf.Language(331))
	}
	if task.Cancel != nil {
		task.Cancel()

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Use the task ID exactly as returned by the import-start call; do not fabricate or reuse IDs across sessions
  2. Treat this error as terminal: stop polling and re-read the current task list / start a fresh import
  3. After a kernel restart, obtain a new task ID — old IDs are invalid by design
  4. Guard client-side: stop polling once the task reports a terminal state instead of continuing after cleanup

Example fix

// before
task, err := GetObsidianVaultTask(oldID) // stale after restart -> Conf.Language(330)
// after
task, err := GetObsidianVaultTask(oldID)
if err != nil {
    oldID = "" // start a new import and capture its fresh task ID
}
Defensive patterns

Strategy: try-catch

Try / catch

const task = await getObsidianVaultTask(taskID).catch(e => {
  if (e.code === 330) { taskID = null; return null } // stale/expired: reset and re-create
  throw e
})

Prevention

When it happens

Trigger: Calling `GetObsidianVaultTask`/`CancelObsidianVaultTask` with a taskID that was never created, mistyped, belongs to a previous kernel process, or whose task record was removed after reaching a terminal state.

Common situations: Client caches an old task ID across a kernel restart (the registry is in-memory only); polling a finished task after cleanup; a race where two pollers use a stale ID from a failed create response.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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