Description
When running openab-copilot with a Docker bind mount, if the /home/node/.copilot directory does not exist on the host, Docker automatically creates it owned by root. The node user inside the container then cannot write to session-store.db, causing the Copilot CLI to silently exit with code 1 and the JSON-RPC connection to close immediately.
Steps to Reproduce
- Run the
openab-copilot container with a bind mount targeting /home/node/.copilot (e.g., via docker-compose or helm)
- Ensure the host-side directory does not pre-exist
- Start the container and send a message via Discord
- Observe the container exits silently or logs
JSON-RPC error -1: connection closed
Expected Behavior
The Copilot CLI should start successfully and be able to write to /home/node/.copilot/session-store.db. The directory should be pre-created and owned by the node user in the image so that bind mounts do not overwrite ownership.
Environment
- Image:
openab-copilot (Dockerfile.copilot)
- Base image:
node:22-bookworm-slim
- Runtime user:
node
- Deployment: Docker bind mount / docker-compose / Helm with PVC
Screenshots / Logs
2026-05-07T04:20:23.462437Z ERROR openab::adapter: pool error: JSON-RPC error -1: connection closed
2026-05-07T04:20:23.462464Z ERROR openab::discord: handle_message error: JSON-RPC error -1: connection closed
Fix: Add the following before USER node in Dockerfile.copilot:
RUN mkdir -p /home/node/.copilot && chown node:node /home/node/.copilot
Description
When running
openab-copilotwith a Docker bind mount, if the/home/node/.copilotdirectory does not exist on the host, Docker automatically creates it owned byroot. Thenodeuser inside the container then cannot write tosession-store.db, causing the Copilot CLI to silently exit with code 1 and the JSON-RPC connection to close immediately.Steps to Reproduce
openab-copilotcontainer with a bind mount targeting/home/node/.copilot(e.g., viadocker-composeorhelm)JSON-RPC error -1: connection closedExpected Behavior
The Copilot CLI should start successfully and be able to write to
/home/node/.copilot/session-store.db. The directory should be pre-created and owned by thenodeuser in the image so that bind mounts do not overwrite ownership.Environment
openab-copilot(Dockerfile.copilot)node:22-bookworm-slimnodeScreenshots / Logs
Fix: Add the following before
USER nodeinDockerfile.copilot:RUN mkdir -p /home/node/.copilot && chown node:node /home/node/.copilot