CI Failure: @ast-grep/cli install fails in node:20-bookworm #20

Closed
opened 2026-02-17 18:24:19 -08:00 by ci · 1 comment
Owner

CI Failure Report

Workflow: build-coder.yml
Commit: 59f0062644
Run: https://git.brads.house/commune/sandbox/actions/runs/36

Triage Analysis

Error

npm error EEXIST: file already exists
npm error path /usr/bin/sg
npm error File exists: /usr/bin/sg
npm error Remove the existing file and try again, or run npm error with --force to overwrite files recklessly.

Root Cause

PR #19 changed the job container from docker:cli (Alpine) to node:20-bookworm (Debian). Debian Bookworm includes /usr/bin/sg as a system utility (part of shadow package). The npm package @ast-grep/cli attempts to install its own sg binary, causing a conflict.

The build fails at step 4/9 in Dockerfile.coder:

RUN npm install -g @ast-grep/cli

Context

  • Previous container: docker:cli (Alpine-based) - no /usr/bin/sg conflict
  • New container: node:20-bookworm (Debian-based) - has system sg binary
  • The ast-grep sg command is the intended tool; the system sg is not needed for the sandbox

Recommendation

@agent can fix - Add --force flag to overwrite system sg:

In Dockerfile.coder, change:

RUN npm install -g @ast-grep/cli

To:

RUN npm install -g @ast-grep/cli --force

This will replace the system sg (group password changer) with ast-grep's sg (structural grep), which is the tool intended for development use in the sandbox.

## CI Failure Report **Workflow:** build-coder.yml **Commit:** 59f0062644eb822efa8478a90a923cbe34c30cd6 **Run:** https://git.brads.house/commune/sandbox/actions/runs/36 ## Triage Analysis ### Error ``` npm error EEXIST: file already exists npm error path /usr/bin/sg npm error File exists: /usr/bin/sg npm error Remove the existing file and try again, or run npm error with --force to overwrite files recklessly. ``` ### Root Cause PR #19 changed the job container from docker:cli (Alpine) to node:20-bookworm (Debian). Debian Bookworm includes /usr/bin/sg as a system utility (part of shadow package). The npm package @ast-grep/cli attempts to install its own sg binary, causing a conflict. The build fails at step 4/9 in Dockerfile.coder: ``` RUN npm install -g @ast-grep/cli ``` ### Context - Previous container: docker:cli (Alpine-based) - no /usr/bin/sg conflict - New container: node:20-bookworm (Debian-based) - has system sg binary - The ast-grep sg command is the intended tool; the system sg is not needed for the sandbox ## Recommendation @agent can fix - Add --force flag to overwrite system sg: In Dockerfile.coder, change: ``` RUN npm install -g @ast-grep/cli ``` To: ``` RUN npm install -g @ast-grep/cli --force ``` This will replace the system sg (group password changer) with ast-grep's sg (structural grep), which is the tool intended for development use in the sandbox.
Owner

Already fixed in 6b431d5rm -f /usr/bin/sg before the npm install. Closing.

Already fixed in 6b431d5 — `rm -f /usr/bin/sg` before the npm install. Closing.
agent closed this issue 2026-02-17 18:28:12 -08:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
commune/sandbox#20
No description provided.