{"record":{"id":"54b9ed460700c27e","repo":"coleam00/Archon","slug":"failed-to-read-workflow-run-after-update-err-me","errorCode":null,"errorMessage":"Failed to read workflow run after update: ${err.message}","messagePattern":"Failed to read workflow run after update: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/db/workflows.ts","lineNumber":1029,"sourceCode":"    const currentStatus = probeRows[0]?.status;\n    if (currentStatus === undefined) {\n      getLog().warn({ workflowRunId: id }, 'db.workflow_run_resume_not_found');\n      throw new Error(`Workflow run not found (id: ${id})`);\n    }\n    getLog().info({ workflowRunId: id, currentStatus }, 'db.workflow_run_resume_not_resumable');\n    throw new WorkflowNotResumableError(id, currentStatus);\n  }\n\n  let selectResult: Awaited<ReturnType<typeof pool.query<WorkflowRun>>>;\n  try {\n    selectResult = await pool.query<WorkflowRun>(\n      'SELECT * FROM remote_agent_workflow_runs WHERE id = $1',\n      [id]\n    );\n  } catch (error) {\n    const err = error as Error;\n    getLog().error({ err, workflowRunId: id }, 'db.workflow_run_resume_select_failed');\n    throw new Error(`Failed to read workflow run after update: ${err.message}`);\n  }\n\n  const row = selectResult.rows[0];\n  if (!row) {\n    getLog().error({ workflowRunId: id }, 'db.workflow_run_resume_vanished');\n    throw new Error(`Workflow run vanished after update (id: ${id})`);\n  }\n  return normalizeWorkflowRun(row);\n}\n\nexport async function recoverCancelledFanOutRun(id: string): Promise<WorkflowRun> {\n  const dialect = getDialect();\n  const cancelledReason =\n    getDatabaseType() === 'postgresql'\n      ? \"metadata->>'cancelled_reason'\"\n      : \"json_extract(metadata, '$.cancelled_reason')\";\n  const metadataWithoutCancelledReason =\n    getDatabaseType() === 'postgresql'","sourceCodeStart":1011,"sourceCodeEnd":1047,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/db/workflows.ts#L1011-L1047","documentation":"Error \"Failed to read workflow run after update: ${err.message}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/core/src/db/workflows.ts:1029 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}