{"record":{"id":"e1c397cf1dcdd0aa","repo":"coleam00/Archon","slug":"failed-to-reset-workflow-node-sessions-err-mess","errorCode":null,"errorMessage":"Failed to reset workflow node sessions: ${err.message}","messagePattern":"Failed to reset workflow node sessions: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/operations/workflow-operations.ts","lineNumber":1021,"sourceCode":" * other scope), node_id narrows to one node within that scope. Omitting both\n * scope_key and node_id deletes every row for the workflow across all scopes.\n *\n * Returns the row count deleted.\n */\nexport async function resetWorkflowNodeSessions(filter: {\n  workflow_name: string;\n  scope_key?: string;\n  node_id?: string;\n}): Promise<{ deleted: number }> {\n  try {\n    return await workflowNodeSessionDb.deleteWorkflowNodeSessions(filter);\n  } catch (error) {\n    const err = error as Error;\n    getLog().error(\n      { err, errorType: err.constructor.name, ...filter },\n      'operations.workflow_reset_node_sessions_failed'\n    );\n    throw new Error(`Failed to reset workflow node sessions: ${err.message}`);\n  }\n}\n","sourceCodeStart":1003,"sourceCodeEnd":1024,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/operations/workflow-operations.ts#L1003-L1024","documentation":"resetWorkflowNodeSessions wraps any failure from the underlying session-reset database/service call and rethrows it with this prefixed message. It indicates the node session reset filter matched data that could not be deleted/reset, with the original cause logged under 'operations.workflow_reset_node_sessions_failed'.","triggerScenarios":"Calling resetWorkflowNodeSessions when the underlying DB delete/session-reset call throws — e.g. database locked, connection failure, constraint violation, or an invalid filter that produces a failing query.","commonSituations":"SQLite database file locked by another process; Postgres connection dropped mid-operation; disk full; a stale workflow id/node filter referencing data that triggers a constraint error.","solutions":["Check logs for the 'operations.workflow_reset_node_sessions_failed' event; the original error (err) is attached there with its type.","Verify the database is reachable and not locked; retry after the blocking process exits.","Validate the filter arguments (run/workflow/node ids) refer to existing records.","Retry the reset once transient I/O issues are resolved."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"if (!runId && !nodeId && !workflowId) throw new Error('resetWorkflowNodeSessions needs a non-empty filter');","typeGuard":null,"tryCatchPattern":"try {\n  await resetWorkflowNodeSessions(filter);\n} catch (e) {\n  // original cause is logged under 'operations.workflow_reset_node_sessions_failed'\n  console.error('Node session reset failed; check DB connectivity and filters', e.message);\n  if (isTransient(e)) await sleep(1000), retryReset(filter);\n}","preventionTips":["Ensure the database is reachable and not locked before bulk resets.","Validate filter ids against existing records first.","Monitor logs for the workflow_reset_node_sessions_failed event to get the root cause."],"tags":["database","workflow","sessions","wrapping"],"backgroundTag":"operation-failed-wrapped","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}