Skip to content

fix(Dockerfile.copilot): /home/node/.copilot owned by root when using Docker bind mount, causing silent exit 1 #767

@pro5251

Description

@pro5251

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

  1. Run the openab-copilot container with a bind mount targeting /home/node/.copilot (e.g., via docker-compose or helm)
  2. Ensure the host-side directory does not pre-exist
  3. Start the container and send a message via Discord
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions