{"record":{"id":"c5ab024234d8c66e","repo":"coleam00/Archon","slug":"failed-to-list-workflow-runs-err-message","errorCode":null,"errorMessage":"Failed to list workflow runs: ${err.message}","messagePattern":"Failed to list workflow runs: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":3462,"sourceCode":"  }\n}\n\n/**\n * Show status of all running workflow runs.\n */\nexport async function workflowStatusCommand(\n  json?: boolean,\n  verbose?: boolean,\n  rawEvents?: boolean\n): Promise<void> {\n  let runs: WorkflowRun[];\n  try {\n    const result = await getWorkflowStatus();\n    runs = result.runs;\n  } catch (error) {\n    const err = error as Error;\n    getLog().error({ err }, 'cli.workflow_status_failed');\n    throw new Error(`Failed to list workflow runs: ${err.message}`);\n  }\n\n  if (json) {\n    if (!verbose) {\n      await writeJsonLine({ runs });\n      return;\n    }\n\n    const fetchedPerRun = await Promise.all(runs.map(run => fetchVerboseEvents(run.id)));\n    const runsOutput = runs.map((run, i) => {\n      const runEvents = fetchedPerRun[i]?.events ?? [];\n      return rawEvents\n        ? { ...run, events: runEvents }\n        : { ...run, nodes: buildNodeSummaries(runEvents) };\n    });\n    await writeJsonLine({ runs: runsOutput });\n    return;\n  }","sourceCodeStart":3444,"sourceCodeEnd":3480,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L3444-L3480","documentation":"`archon workflow list` (status view) fetches runs via `getWorkflowStatus()`; if that throws, the CLI logs 'cli.workflow_status_failed' and re-throws as 'Failed to list workflow runs: <message>'. The wrap marks the failure as coming from the status listing path.","triggerScenarios":"Calling `archon workflow list` when the status query fails: database unreachable/locked, storage adapter misconfigured, or an exception during run-state aggregation.","commonSituations":"Database server down or DSN misconfigured in `.archon/config.yaml`; SQLite file locked by a running workflow; permission problems on the state directory; querying before the database is initialized.","solutions":["Verify database connectivity and config (DSN / SQLite path) in `.archon/config.yaml`.","Retry — transient locks from concurrent runs often resolve.","Ensure the database is initialized (run setup) before listing.","Inspect the logged 'cli.workflow_status_failed' entry for the root cause."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// preflight: DB must be reachable before listing\nconst ping = await store.ping?.();\nif (ping === false) throw new Error('Workflow store unreachable; check database config in .archon/config.yaml');","typeGuard":null,"tryCatchPattern":"try {\n  const result = await getWorkflowStatus();\n  runs = result.runs;\n} catch (error) {\n  const err = error as Error;\n  getLog().error({ err }, 'cli.workflow_status_failed');\n  throw new Error(`Failed to list workflow runs: ${err.message}`);\n}","preventionTips":["Verify DSN / SQLite path in `.archon/config.yaml` before scripting around `workflow list`.","Initialize the database before first use.","Avoid heavy concurrent write loads while listing on SQLite.","Use `--json`-mode commands programmatically for stable failure shapes."],"tags":["cli","database","status"],"backgroundTag":"database-read-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}