Skip to content

Commit 711005f

Browse files
committed
fix: surface docker's error when it rejects a .deva mount
A .deva VOLUME docker refuses made deva.sh die silently -- "Creating persistent container: <name>" 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
1 parent 5776806 commit 711005f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

deva.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3950,8 +3950,12 @@ if [ "$EPHEMERAL_MODE" = false ]; then
39503950
else
39513951
# Container doesn't exist - try to create it
39523952
echo "Creating persistent container: $CONTAINER_NAME"
3953-
error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1)
3954-
docker_exit=$?
3953+
# `|| docker_exit=$?` is load-bearing: under `set -e` a failing
3954+
# command-substitution assignment aborts the script AT the assignment,
3955+
# so the error handling below would be dead code on the exact path it
3956+
# exists for. Keep the assignment left of `||` to suspend `set -e`.
3957+
docker_exit=0
3958+
error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1) || docker_exit=$?
39553959
if [ $docker_exit -ne 0 ]; then
39563960
# Check if specifically a name collision (concurrent run)
39573961
if echo "$error_output" | grep -qE 'already in use|Conflict'; then

0 commit comments

Comments
 (0)