Skip to content

Commit 90c3fc4

Browse files
GoGoComputerclaude
andcommitted
fix(sandbox): group_add must include 0 (root) for macOS Docker Desktop
After v0.2.17 fixed the missing docker.sock mount, the error mutated: "... permission denied while trying to connect to the docker API ...". Inside the running gateway container: ls -la /var/run/docker.sock srw-rw---- 1 root root /var/run/docker.sock id uid=1000(node) gid=1000(node) groups=1000(node),1(daemon) On the host the socket is root:daemon (GID=1), but inside the container (macOS Docker Desktop) it appears as root:root (GID=0). install.sh step_sandbox read the host GID with `stat -f '%g'`, which returns 1, and emitted only `group_add: ["1"]`. The `node` user is in group 1 (daemon) but not in group 0 (root), so opening the socket from inside the container failed. Fix - install.sh step_sandbox: when generating docker-compose.sandbox.yml, always emit "0" first (root, required for macOS Docker Desktop), then the host-detected GID if different. The container's `node` user ends up in groups=1000(node),0(root),1(daemon) and can talk to the socket regardless of platform. - The user's existing ~/DEV/openclaw/docker-compose.sandbox.yml was patched in place to the same ["0","1"] shape. Verified after ./openclaw stop && start: docker exec openclaw-openclaw-gateway-1 \ docker info --format '{{.ServerVersion}}' -> 29.4.0 Plugins line returns to `ready (7 plugins: ... discord ...)`. Docs - GUIDE-DAILY-USE 트러블슈팅 row for the `permission denied` variant with manual patch one-liner. - GUIDE-DISCORD-BOT troubleshooting: 'Something went wrong' entry now distinguishes case A (no such file, v0.2.17) vs case B (permission denied, v0.2.19) with the patch + verify commands. - CHANGELOG v0.2.19. VERSION 0.2.18 -> 0.2.19. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent e1b5855 commit 90c3fc4

5 files changed

Lines changed: 77 additions & 8 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 📖 목차 / Contents
44

5+
- [v0.2.19 — 2026-05-14](#v0219--2026-05-14)
56
- [v0.2.18 — 2026-05-14](#v0218--2026-05-14)
67
- [v0.2.17 — 2026-05-14](#v0217--2026-05-14)
78
- [v0.2.16 — 2026-05-14](#v0216--2026-05-14)
@@ -27,6 +28,39 @@
2728

2829
---
2930

31+
## v0.2.19 — 2026-05-14
32+
33+
### Bug fix — Discord bot still "Something went wrong" after v0.2.17 (`permission denied` on docker.sock)
34+
35+
v0.2.17 fixed the docker.sock mount **missing**. After applying it, the error mutated:
36+
37+
```
38+
v0.2.16-: Failed to inspect sandbox image: ... no such file or directory
39+
v0.2.17-: Failed to inspect sandbox image: ... permission denied while
40+
trying to connect to the docker API at unix:///var/run/docker.sock
41+
```
42+
43+
Diagnosis inside the running container:
44+
45+
```
46+
$ docker exec openclaw-openclaw-gateway-1 sh -c 'ls -la /var/run/docker.sock; id'
47+
srw-rw---- 1 root root 0 May 13 13:55 /var/run/docker.sock
48+
uid=1000(node) gid=1000(node) groups=1000(node),1(daemon)
49+
```
50+
51+
On the **host** the socket is `root:daemon` (GID=1), but **inside the container** (macOS Docker Desktop) it appears as `root:root` (GID=0). `install.sh step_sandbox` was reading the host GID with `stat -f '%g'`, which returns `1`, and emitting only `group_add: ["1"]`. The `node` user is a member of group `1(daemon)` but **not** group `0(root)`, so opening the socket from inside the container failed with permission denied.
52+
53+
- **`install.sh step_sandbox` (cmd/install.sh)**: when writing `docker-compose.sandbox.yml`, always emit `group_add: ["0"]` first (root, required for macOS Docker Desktop), then the detected host GID if different. Now the container's `node` user ends up in `groups=1000(node),0(root),1(daemon)` and can talk to the socket regardless of platform.
54+
- **User's existing `~/DEV/openclaw/docker-compose.sandbox.yml`** was patched in place to the same `["0","1"]` shape. Verified post-restart: `docker exec ... docker info --format '{{.ServerVersion}}'` returns `29.4.0` from inside the gateway. Plugins list back to `7` with `discord`.
55+
56+
### Documentation
57+
- **GUIDE-DAILY-USE.md** 트러블슈팅 표: new row for the `permission denied` variant with the manual patch one-liner.
58+
- **GUIDE-DISCORD-BOT.md** troubleshooting: the "Something went wrong" entry now distinguishes case A (`no such file`, v0.2.17 fix) vs case B (`permission denied`, v0.2.19 fix) and shows the immediate patch + verification command.
59+
60+
VERSION 0.2.18 → 0.2.19.
61+
62+
---
63+
3064
## v0.2.18 — 2026-05-14
3165

3266
### GUIDE-OLLAMA.md — consolidated 🔌 켜기·끄기·재시작·자동시작 section

‎docs/GUIDE-DAILY-USE.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ rm ~/.openclaw-mgr/state
398398
| 웹UI "Safari Can't Connect" | [isolated 모드 → online 으로](../README.md#-외부-네트워크-잠깐-켜기) |
399399
| TUI 답이 안 옴: **`fetch failed`** / **`LLM request failed: network connection error`** | 컨테이너→Ollama 네트워크 자체는 OK 인데 **모델 이름이 실제 설치된 이름과 다름** (예: `gemma4` vs `gemma4:26b`). 아래 [현재 어떤 모델을 쓰는지 확인](#-현재-어떤-모델을-쓰는지--openclawjson-점검) 참조 |
400400
| Discord 봇 응답: **`Something went wrong while processing your request. Please try again, or use /new to start a fresh session.`** (게이트웨이 로그에서 `Failed to inspect sandbox image: dial unix /var/run/docker.sock: no such file or directory`) | `./openclaw stop && start` 또는 `network` 토글 후 **gateway 컨테이너에 `/var/run/docker.sock` 마운트가 빠진 상태**. 봇이 도구 실행할 때 sandbox 컨테이너 못 띄움. v0.2.17+ 에서 `start.sh` / `step_lockdown` 이 자동으로 `docker-compose.sandbox.yml` 오버레이를 포함하도록 패치됨 — `git pull && ./openclaw stop && ./openclaw start` 한 번이면 해결. 확인: `docker inspect openclaw-openclaw-gateway-1 --format '{{range .Mounts}}{{.Source}} {{end}}' \| grep docker.sock` |
401+
| Discord 봇 응답: 위와 같은 메시지인데 로그는 **`Failed to inspect sandbox image: permission denied while trying to connect to the docker API`** | docker.sock 마운트는 있는데 **컨테이너 안 node 사용자가 그 sock 에 접근 권한이 없음**. macOS Docker Desktop 에선 마운트된 sock 가 `root:root` 로 보이는데 (호스트 GID `daemon`(1) 과 다름), `group_add` 가 `1` 만 추가하던 게 회귀. v0.2.19+ `step_sandbox` 가 `0`(root) 도 함께 추가. 즉시 fix: `python3 -c 'open("/Users/mo/DEV/openclaw/docker-compose.sandbox.yml","w").write("services:\n openclaw-gateway:\n volumes:\n - /var/run/docker.sock:/var/run/docker.sock\n group_add:\n - \"0\"\n - \"1\"\n")'` 후 `./openclaw stop && start`. 검증: 컨테이너 안에서 `docker exec openclaw-openclaw-gateway-1 docker info --format '{{.ServerVersion}}'` 가 버전 번호를 반환. |
401402
| TUI 에서 답이 안 옴 / 느림 (메시지는 가긴 감) | 모델이 너무 크다 — `./openclaw chat` 의 picker 로 가벼운 모델 선택 |
402403
| install 이 [skip] 만 띄움 | [state 파일 vs 실제 산출물 어긋남 FAQ](../README.md) |
403404
| chat 에서 "Ollama not reachable" | Ollama 앱 안 켜진 상태 — `open -a Ollama` |

‎docs/GUIDE-DISCORD-BOT.md‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,11 +833,32 @@ json.dump(cfg, open("/Users/mo/.openclaw/openclaw.json", "w"), indent=2)
833833

834834
### "봇이 응답으로 `Something went wrong while processing your request. Please try again, or use /new to start a fresh session.`"
835835

836-
게이트웨이 로그에 다음이 보이면 `docker.sock` 마운트 누락:
836+
게이트웨이 로그를 보면 둘 중 하나입니다 — **마운트 누락**(v0.2.17 이전 회귀) 또는 **권한 거부**(v0.2.18 이전 회귀):
837+
837838
```bash
838839
./openclaw logs | grep -i "Failed to inspect sandbox image"
839-
# → Error: Failed to inspect sandbox image: failed to connect to the docker
840-
# API at unix:///var/run/docker.sock; ... no such file or directory
840+
# 케이스 A — 마운트 누락 (v0.2.17 에서 fix):
841+
# Error: ... no such file or directory
842+
# 케이스 B — 권한 거부 (v0.2.19 에서 fix):
843+
# Error: ... permission denied while trying to connect to the docker API
844+
```
845+
846+
**케이스 B (macOS Docker Desktop 흔함)**: docker.sock 은 호스트에서는 `root:daemon`(GID=1) 인데 컨테이너 안에선 `root:root`(GID=0) 로 보임. 마운트는 있어도 node 사용자가 GID=0 그룹에 없으면 거부. v0.2.19+ 의 `step_sandbox` 는 `group_add` 에 `0` 과 호스트 GID 둘 다 추가.
847+
848+
즉시 fix:
849+
```bash
850+
# sandbox compose 파일에 group_add: ["0", "1"] 박기
851+
python3 -c '
852+
open("/Users/mo/DEV/openclaw/docker-compose.sandbox.yml","w").write(
853+
"services:\n openclaw-gateway:\n volumes:\n - /var/run/docker.sock:/var/run/docker.sock\n group_add:\n - \"0\"\n - \"1\"\n"
854+
)'
855+
856+
cd ~/DEV/openclawAgent/openclaw-workspace/openclaw-mgr
857+
./openclaw stop && ./openclaw start
858+
859+
# 검증 (서버 버전이 나오면 OK)
860+
docker exec openclaw-openclaw-gateway-1 docker info --format '{{.ServerVersion}}'
861+
# → 29.x.x 같은 출력
841862
```
842863

843864
원인: `./openclaw stop && start` 또는 `network online/isolated --restart` 사이클 후 gateway 컨테이너 안에 `/var/run/docker.sock` 마운트가 빠진 상태. 봇이 메시지를 받으면 도구 실행을 위해 **sandbox 서브컨테이너**를 띄우려는데 socket 이 없어 실패.

‎openclaw-mgr/cmd/install.sh‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,26 @@ step_sandbox() {
503503
SANDBOX_DEFERRED=1
504504
return 0
505505
fi
506+
# 호스트에서 본 docker.sock 의 GID. macOS Docker Desktop 에선 컨테이너 안
507+
# 마운트가 root:root 로 보여서 호스트 GID 만으론 부족 → 항상 "0" 도 같이
508+
# 넣어 양쪽 호환. (자세한 이유: GUIDE-DAILY-USE 트러블슈팅 §
509+
# "permission denied" 참조.)
506510
local gid
507511
gid=$(stat -f '%g' "$sock" 2>/dev/null || stat -c '%g' "$sock" 2>/dev/null || echo "")
508512
local sandbox_compose="$OPENCLAW_DIR/docker-compose.sandbox.yml"
509-
printf 'services:\n openclaw-gateway:\n volumes:\n - %s:/var/run/docker.sock\n' "$sock" > "$sandbox_compose"
510-
if [ -n "$gid" ]; then
511-
printf ' group_add:\n - "%s"\n' "$gid" >> "$sandbox_compose"
512-
fi
513+
{
514+
printf 'services:\n'
515+
printf ' openclaw-gateway:\n'
516+
printf ' volumes:\n'
517+
printf ' - %s:/var/run/docker.sock\n' "$sock"
518+
printf ' group_add:\n'
519+
# 0 = root: macOS Docker Desktop 컨테이너 안 sock 가 root:root 로 보임 (필수)
520+
printf ' - "0"\n'
521+
# 호스트 GID (Linux 환경에선 docker/daemon 그룹) — 0 과 중복이면 무해
522+
if [ -n "$gid" ] && [ "$gid" != "0" ]; then
523+
printf ' - "%s"\n' "$gid"
524+
fi
525+
} > "$sandbox_compose"
513526

514527
# 10-D. 샌드박스 포함 gateway 재기동
515528
local files="-f docker-compose.yml -f $sandbox_compose"

‎openclaw-mgr/openclaw‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -euo pipefail
1313
OPENCLAW_MGR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
1414
export OPENCLAW_MGR_DIR
1515

16-
VERSION="0.2.18"
16+
VERSION="0.2.19"
1717

1818
# .env 자동 초기화: .env 없으면 .env.example 에서 자동 생성 (cp 불필요, 첫 실행부터 동작)
1919
# Auto-init: create .env from .env.example on first run — zero-config for beginners

0 commit comments

Comments
 (0)