coleam00/Archon · error · Error

Failed to list workflow runs: ${err.message}

Error message

Failed to list workflow runs: ${err.message}

What it means

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

Source

Thrown at packages/cli/src/commands/workflow.ts:3462

  }
}

/**
 * Show status of all running workflow runs.
 */
export async function workflowStatusCommand(
  json?: boolean,
  verbose?: boolean,
  rawEvents?: boolean
): Promise<void> {
  let runs: WorkflowRun[];
  try {
    const result = await getWorkflowStatus();
    runs = result.runs;
  } catch (error) {
    const err = error as Error;
    getLog().error({ err }, 'cli.workflow_status_failed');
    throw new Error(`Failed to list workflow runs: ${err.message}`);
  }

  if (json) {
    if (!verbose) {
      await writeJsonLine({ runs });
      return;
    }

    const fetchedPerRun = await Promise.all(runs.map(run => fetchVerboseEvents(run.id)));
    const runsOutput = runs.map((run, i) => {
      const runEvents = fetchedPerRun[i]?.events ?? [];
      return rawEvents
        ? { ...run, events: runEvents }
        : { ...run, nodes: buildNodeSummaries(runEvents) };
    });
    await writeJsonLine({ runs: runsOutput });
    return;
  }

View on GitHub (pinned to 0773b97458)

Solutions

  1. Verify database connectivity and config (DSN / SQLite path) in `.archon/config.yaml`.
  2. Retry — transient locks from concurrent runs often resolve.
  3. Ensure the database is initialized (run setup) before listing.
  4. Inspect the logged 'cli.workflow_status_failed' entry for the root cause.
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: DB must be reachable before listing
const ping = await store.ping?.();
if (ping === false) throw new Error('Workflow store unreachable; check database config in .archon/config.yaml');

Try / catch

try {
  const result = await getWorkflowStatus();
  runs = result.runs;
} catch (error) {
  const err = error as Error;
  getLog().error({ err }, 'cli.workflow_status_failed');
  throw new Error(`Failed to list workflow runs: ${err.message}`);
}

Prevention

When it happens

Trigger: Calling `archon workflow list` when the status query fails: database unreachable/locked, storage adapter misconfigured, or an exception during run-state aggregation.

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

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/c5ab024234d8c66e. Report an issue: GitHub.