{"record":{"id":"0420692cabaaa4e8","repo":"coleam00/Archon","slug":"warning-could-not-open-a-log-file-child-output","errorCode":null,"errorMessage":"Warning: could not open a log file — child output will not be captured.","messagePattern":"Warning: could not open a log file — child output will not be captured\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":2226,"sourceCode":"        detached: true,\n        // The handle the launch promised (#2872). Its row already exists, so a caller\n        // can query or wait on it without polling for the run to appear.\n        runId: detachedRunId,\n        workflow: workflow.name,\n        branch: pinnedBranch ?? options.branchName ?? null,\n        conversationId: childConversationId,\n        logPath,\n      });\n    } else {\n      console.log(`Started '${workflow.name}' in the background.`);\n      console.log(`Run id: ${detachedRunId}`);\n      console.log(`Track it with: archon workflow get ${detachedRunId}`);\n      if (logPath) {\n        console.log(`Child output: ${logPath}`);\n      } else {\n        // Log file couldn't be opened — the child runs with its output discarded, so a\n        // failure after the startup window leaves no trail beyond the run row itself.\n        console.warn('Warning: could not open a log file — child output will not be captured.');\n      }\n    }\n    return;\n  }\n\n  console.log(`Running workflow: ${workflowName}`);\n  console.log(`Working directory: ${cwd}`);\n  console.log('');\n\n  // Create CLI adapter\n  const adapter = new CLIAdapter();\n\n  // Generate conversation ID\n  const conversationId = options.conversationId ?? generateConversationId();\n\n  // Get or create conversation in database\n  let conversation;\n  try {","sourceCodeStart":2208,"sourceCodeEnd":2244,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L2208-L2244","documentation":"Warning from the detached path of `archon workflow run` (packages/cli/src/commands/workflow.ts:2226). In `--detach` mode the CLI spawns a child process and tries to open a log file to capture its output; if the log file could not be opened, the child still runs but its stdout/stderr are discarded, so a failure after the startup window leaves no evidence beyond the run row in the database.","triggerScenarios":"Running `archon workflow run <wf> --detach` when the log file cannot be created/opened — e.g. unwritable log directory, full disk, permission denied, or invalid log path configuration.","commonSituations":"Running under a user without write access to the Archon workspace/logs directory; read-only container filesystem; ARCHON workspace path misconfigured; disk quota exhausted.","solutions":["Check permissions on the Archon workspace/log directory and fix ownership or ACLs.","Free disk space or raise the quota if the filesystem is full.","Verify the configured log/workspace path exists and is writable, then re-run with --detach.","Alternatively run without --detach so output streams to your terminal."],"exampleFix":"// before: logs dir not writable\narchon workflow run fix --detach\n// after\nmkdir -p ~/.archon/logs && chmod u+w ~/.archon/logs\narchon workflow run fix --detach","handlingStrategy":"validation","validationCode":"// Verify the log directory is writable before detaching\nimport { accessSync, constants } from 'node:fs';\naccessSync(logDir, constants.W_OK); // throws early with a clearer error","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the Archon workspace/log directory exists and is writable by the invoking user.","Monitor disk space on the volume hosting ~/.archon.","Prefer non-detached runs when you need guaranteed output capture."],"tags":["cli","logging","detach","filesystem"],"backgroundTag":"log-file-unwritable","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}