fix: surface docker's error when it rejects a .deva mount - #489
Merged
Conversation
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
Contributor
|
Claude encountered an error after 1s —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Pull request overview
Fixes a silent failure in deva.sh’s persistent-container creation path by ensuring Docker errors (e.g., invalid mount options from a .deva file) are captured and printed even under set -euo pipefail.
Changes:
- Make the
docker ...command-substitution assignment non-fatal underset -eby placing it in an||list and capturing the real exit status. - Preserve and surface Docker’s stderr via the existing error handling block (instead of aborting before it runs).
- Add an in-line comment documenting why the
|| docker_exit=$?pattern is required here.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Independent of the feature stack -- branched off main, mergeable on its own.
A .deva file with a mount docker rejects made deva.sh die silently: "Creating
persistent container: " and nothing else. No container, no error.
deva.sh, persistent-container path (the default; ephemeral is opt-in):
Under set -euo pipefail a failing command-substitution assignment aborts the
script AT the assignment, so the entire author-written error block never runs.
It was unreachable on the one path it exists for. Bind sources resolve on the
HOST fs (deva talks to the host daemon), so any VOLUME= docker rejects lands
exactly here.
Keeping the assignment left of
||suspends set -e and captures the real exit;the existing handler then prints docker's own stderr.
Test plan
before: exit 125, output ends at "Creating persistent container", silent
after: exit 1, "docker: Error response from daemon: invalid mode: rx"
Closes #484