From ac49463a12ecc579bce4df01d05ac1813ff64c9a Mon Sep 17 00:00:00 2001 From: Bharath Vemula Date: Thu, 29 Oct 2026 05:35:24 +0000 Subject: [PATCH 1/5] fix(dev): pre-create _data/logs before compose creates it as root On a first `make dev` on Linux, docker compose bind-mounts create ./_data as root. The later `mkdir -p _data/logs` in all_run then fails with Permission denied and, under set -e, aborts the launch while leaving the tmux session running. Create _data/logs inside services_up() before compose runs, so the directory stays user-owned; the later mkdir remains as an idempotent safety net. Covers both make dev (all_run) and make dev-setup (setup), which both start from services_up(). Signed-off-by: Bharath Vemula --- scripts/development/dev-local.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/development/dev-local.sh b/scripts/development/dev-local.sh index d193b815322..de7616a4694 100755 --- a/scripts/development/dev-local.sh +++ b/scripts/development/dev-local.sh @@ -104,6 +104,12 @@ require_uv() { } services_up() { + # Create _data/logs before Docker runs: on first launch, compose + # bind-mounts create ./_data as root, after which this user can no + # longer mkdir _data/logs and `make dev` fails (see #13082). + # Creating it first keeps it user-owned; the later mkdir in all_run + # stays as an idempotent safety net. + mkdir -p "$REPO_ROOT/_data/logs" log "Starting postgres + valkey + neo4j via Docker (waits for healthchecks)..." "${COMPOSE[@]}" -f "$COMPOSE_FILE" up -d --wait postgres valkey neo4j ok "Services ready: pg:${POSTGRES_PORT} / valkey:${VALKEY_PORT} / neo4j:${NEO4J_PORT} / neo4j-http:${NEO4J_HTTP_PORT}" From a0570cf6507998e726915ffc17d86a2c5afc5a7c Mon Sep 17 00:00:00 2001 From: Bharath Vemula Date: Sat, 31 Oct 2026 04:41:23 +0000 Subject: [PATCH 2/5] fix(dev): hint non-recursive chown when root-owned _data blocks logs mkdir Anyone who already ran the broken version has a root-owned _data, so the pre-create mkdir in services_up() fails with a bare Permission denied. Warn with the recovery hint and exit non-zero instead, so the user is not left searching. The chown is deliberately non-recursive: _data/postgres and _data/neo4j keep their container owners. Signed-off-by: Bharath Vemula --- scripts/development/dev-local.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/development/dev-local.sh b/scripts/development/dev-local.sh index de7616a4694..15f7a953d2b 100755 --- a/scripts/development/dev-local.sh +++ b/scripts/development/dev-local.sh @@ -109,7 +109,14 @@ services_up() { # longer mkdir _data/logs and `make dev` fails (see #13082). # Creating it first keeps it user-owned; the later mkdir in all_run # stays as an idempotent safety net. - mkdir -p "$REPO_ROOT/_data/logs" + # Anyone who already ran the broken version has a root-owned _data, + # so this mkdir fails: say how to fix it instead of leaving the bare + # "Permission denied". The chown is deliberately non-recursive, since + # _data/postgres and _data/neo4j need to keep their container owners. + if ! mkdir -p "$REPO_ROOT/_data/logs" 2>/dev/null; then + warn "_data is owned by root (created by Docker). Run: sudo chown \"${USER:-$(id -un)}\" _data" + exit 1 + fi log "Starting postgres + valkey + neo4j via Docker (waits for healthchecks)..." "${COMPOSE[@]}" -f "$COMPOSE_FILE" up -d --wait postgres valkey neo4j ok "Services ready: pg:${POSTGRES_PORT} / valkey:${VALKEY_PORT} / neo4j:${NEO4J_PORT} / neo4j-http:${NEO4J_HTTP_PORT}" From d249b4bfa6255cefa62311ecf76bb4c482905761 Mon Sep 17 00:00:00 2001 From: Bharath Vemula Date: Thu, 5 Nov 2026 22:00:18 -0800 Subject: [PATCH 3/5] fix(dev): show mkdir error and only hint chown when _data is not user-owned The guard swallowed every mkdir error and always blamed root ownership. A full or read-only filesystem (or any other mkdir failure) got the same message, and the suggested chown would not fix it. Keep mkdir's error visible and print the chown hint only when _data exists and is not owned by the current user. Signed-off-by: Bharath Vemula --- scripts/development/dev-local.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/development/dev-local.sh b/scripts/development/dev-local.sh index 15f7a953d2b..ecefd774df7 100755 --- a/scripts/development/dev-local.sh +++ b/scripts/development/dev-local.sh @@ -113,8 +113,13 @@ services_up() { # so this mkdir fails: say how to fix it instead of leaving the bare # "Permission denied". The chown is deliberately non-recursive, since # _data/postgres and _data/neo4j need to keep their container owners. - if ! mkdir -p "$REPO_ROOT/_data/logs" 2>/dev/null; then - warn "_data is owned by root (created by Docker). Run: sudo chown \"${USER:-$(id -un)}\" _data" + # Keep mkdir's own error visible: a full or read-only filesystem fails + # here too, and the chown hint would not fix that. Only suggest the + # chown when _data exists and is not owned by the current user. + if ! mkdir -p "$REPO_ROOT/_data/logs"; then + if [ -e "$REPO_ROOT/_data" ] && [ ! -O "$REPO_ROOT/_data" ]; then + warn "_data is owned by root (created by Docker). Run: sudo chown \"${USER:-$(id -un)}\" _data" + fi exit 1 fi log "Starting postgres + valkey + neo4j via Docker (waits for healthchecks)..." From 22e3637f3aaa9b8dccca6780f365702d344a8820 Mon Sep 17 00:00:00 2001 From: Bharath Vemula Date: Fri, 6 Nov 2026 10:44:55 +0000 Subject: [PATCH 4/5] fix(dev): scope _data chown hint to the repository root The recovery command suggested a bare relative '_data', which resolves against the caller's working directory when 'make -C' is invoked outside the repository and could target an unrelated directory. Point it at "$REPO_ROOT/_data" with shell-safe quoting. Signed-off-by: Bharath Vemula --- scripts/development/dev-local.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/development/dev-local.sh b/scripts/development/dev-local.sh index ecefd774df7..625af088868 100755 --- a/scripts/development/dev-local.sh +++ b/scripts/development/dev-local.sh @@ -118,7 +118,7 @@ services_up() { # chown when _data exists and is not owned by the current user. if ! mkdir -p "$REPO_ROOT/_data/logs"; then if [ -e "$REPO_ROOT/_data" ] && [ ! -O "$REPO_ROOT/_data" ]; then - warn "_data is owned by root (created by Docker). Run: sudo chown \"${USER:-$(id -un)}\" _data" + warn "_data is owned by root (created by Docker). Run: sudo chown \"${USER:-$(id -un)}\" \"$REPO_ROOT/_data\"" fi exit 1 fi From 75ce73de09772eabbef42b3255e3110de66e80ea Mon Sep 17 00:00:00 2001 From: Bharath Vemula Date: Fri, 6 Nov 2026 11:00:19 +0000 Subject: [PATCH 5/5] fix(dev): shell-escape the _data path in the chown hint Show the absolute _data path escaped with printf '%q' so the recovery command stays safe to copy-paste when the repo path holds spaces or shell metacharacters. Signed-off-by: Bharath Vemula --- scripts/development/dev-local.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/development/dev-local.sh b/scripts/development/dev-local.sh index 625af088868..dfea80ca0a1 100755 --- a/scripts/development/dev-local.sh +++ b/scripts/development/dev-local.sh @@ -118,7 +118,10 @@ services_up() { # chown when _data exists and is not owned by the current user. if ! mkdir -p "$REPO_ROOT/_data/logs"; then if [ -e "$REPO_ROOT/_data" ] && [ ! -O "$REPO_ROOT/_data" ]; then - warn "_data is owned by root (created by Docker). Run: sudo chown \"${USER:-$(id -un)}\" \"$REPO_ROOT/_data\"" + # Show the absolute path shell-escaped so the command stays safe + # to copy-paste even when the repo path holds spaces or shell + # metacharacters. + warn "_data is owned by root (created by Docker). Run: sudo chown \"${USER:-$(id -un)}\" $(printf '%q' "$REPO_ROOT/_data")" fi exit 1 fi