Skip to content

[BUG]: Local ./shannon start -r fails when Temporal already exists, and router startup breaks on SELinux hosts #288

@dejely

Description

@dejely

Describe the bug

The immediate failure was in ensureInfra() (line 83). When Temporal was already running but the router was not, the CLI still ran a full docker compose up -d --profile router instead of up -d router. That made Compose try to create shannon-temporal again, and Docker rejected it because that fixed container name already existed.

After that was fixed, a second Linux-specific issue showed up:
The router container couldn’t read the mounted router-config.json (line 37) because of SELinux labeling, so it exited with Permission denied.

@host  ./shannon start -u <url> -r ../xxx            
Starting router...
WARN[0000] a network with name shannon-net exists but was not created for project "shannon".
Set `external: true` to use an existing network 
WARN[0000] Found orphan containers ([shannon-worker-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] up 2/3
 ✔ Volume ... Created                                                                                                                     0.0s
 ⠋ Contain... Creating                                                                                                                    0.0s
 ✘ Contain... Error response from daemon: Conflict. The container name "/shannon-temporal" is already in use by container "deaaa6722553ecdd5e8751e3c7cefb87c63c3f6f3c5e30fb0088e2c40f43252c". You have to remove (or rename) that container to be able to reuse that name. 0.0s
Error response from daemon: Conflict. The container name "/shannon-temporal" is already in use by container "deaaa6722553ecdd5e8751e3c7cefb87c63c3f6f3c5e30fb0088e2c40f43252c". You have to remove (or rename) that container to be able to reuse that name.
node:internal/errors:983
  const err = new Error(message);
              ^

Error: Command failed: docker compose -f /home/host/Documents/GitHub/shannon/docker-compose.yml --profile router up -d
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:916:11)
    at execFileSync (node:child_process:952:15)
    at ensureInfra (file:///home/host/Documents/GitHub/shannon/apps/cli/dist/index.mjs:105:2)
    at start (file:///home/host/Documents/GitHub/shannon/apps/cli/dist/index.mjs:1275:8)
    at file:///home/host/Documents/GitHub/shannon/apps/cli/dist/index.mjs:1624:9
    at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 575605,
  stdout: null,
  stderr: null
}

Node.js v22.22.0

Steps to reproduce

  1. Clone the repo on Linux.
    2.Configure router mode so the CLI will try to start the router:
    • set OPENAI_API_KEY
    • set ROUTER_DEFAULT (for example openai,gpt-5.2)
  2. Start Temporal first:
docker compose -p infra -f docker-compose.yml up -d temporal
  1. Confirm shanon-temporal is healthy
  2. Run /shannon start -u -r
  3. observe: sh: 4: cannot open /config/router-config.json: Permission denied

Expected behaviour

  • If Temporal is already healthy and only the router is missing, the CLI should start only router.
  • The router config bind mount should work on SELinux-enabled systems.
  • Local and packaged runs should reuse the same Compose project so existing infra is recognized.

Actual behaviour

  • The CLI tries to recreate shannon-temporal and fails because the fixed container name already exists.
  • On SELinux hosts, the router container exits before becoming healthy because it cannot read the mounted config file.

Pre-submission checklist (required)

  • I have searched the existing open issues and confirmed this bug has not already been reported.
  • I am running the latest released version of shannon.

If applicable

  • I have included relevant error messages, stack traces, or failure details.
  • I have checked the workspaces folder for logs and pasted the relevant errors.
  • I have inspected the failed Temporal workflow run and included the failure reason.
  • I have included clear steps to reproduce the issue.
  • I have redacted any sensitive information (tokens, URLs, repo names).

Debugging details

No response

Screenshots

No response

CLI mode

npx (@keygraph/shannon)

Provider

Router - OpenRouter

Full command with all flags used (with redactions)

./shannon start -u -r

OS (with version)

Fedora Linux 44

Node.js version ('node -v')

22.22.0

Docker version ('docker -v')

29.3.0, build 1.fc43

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions