From 711005f6189f706bc845c75921ad490f3c619f3d Mon Sep 17 00:00:00 2001 From: Eric Wang Date: Mon, 27 Jul 2026 01:58:44 -0700 Subject: [PATCH] fix: surface docker's error when it rejects a .deva mount A .deva VOLUME docker refuses made deva.sh die silently -- "Creating persistent container: " and nothing else. Under set -euo pipefail a failing command-substitution assignment aborts AT the assignment, so docker_exit=$? and the entire error block below it were dead code on the one path they exist for. Keep the assignment left of `||` to suspend set -e and capture the real exit; the existing handler then prints docker's own stderr. Repro: .deva with VOLUME=/tmp:/mnt/bad:rx before: exit 125, no message after: exit 1, "docker: Error response from daemon: invalid mode: rx" The ephemeral path was already safe (if ! docker ...). Closes #484 --- deva.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deva.sh b/deva.sh index f23f062..ac508ef 100755 --- a/deva.sh +++ b/deva.sh @@ -3950,8 +3950,12 @@ if [ "$EPHEMERAL_MODE" = false ]; then else # Container doesn't exist - try to create it echo "Creating persistent container: $CONTAINER_NAME" - error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1) - docker_exit=$? + # `|| docker_exit=$?` is load-bearing: under `set -e` a failing + # command-substitution assignment aborts the script AT the assignment, + # so the error handling below would be dead code on the exact path it + # exists for. Keep the assignment left of `||` to suspend `set -e`. + docker_exit=0 + error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1) || docker_exit=$? if [ $docker_exit -ne 0 ]; then # Check if specifically a name collision (concurrent run) if echo "$error_output" | grep -qE 'already in use|Conflict'; then