fix(ddev): silence permission-denied warnings when ddev runs from an unreadable cwd - #52
Merged
Merged
Conversation
Design record for the browser-command URL transport (describe -j since 0.0.26): field mapping and launch-argument parity, the removed DDEV_DEBUG/FULLURL transport, the deferred alternatives (upstream launch --print-url PR ddev/ddev#8772, global host-command env), and a source map into the pinned ddev v1.25.3 checkout for re-verification on ddev updates.
…unreadable, fixes #51 `ddev poweroff` (and any registry-driven run like `ddev stop <project>`) from a directory the opencode user cannot search — the developer's $HOME, 0750 on Ubuntu 24.04, being the natural one — warned per project: Failed to load compose project for down: validating …: error in parsing "compose-spec.json": stat .: permission denied Root cause: sudo keeps the caller's cwd, and ddev's compose loader resolves its embedded schema (relative resource name) against the process cwd via os.Getwd() -> stat("."), which fails with EACCES there. The stop itself always worked — noise, not breakage (verified with real ddev 1.25.3: warning reproduced from an unreadable cwd, clean run otherwise). bin/ddev-as-opencode now probes the inherited cwd ([ -x . ]) and falls back to the opencode home with a one-line stderr note; it never aborts. Commands that need the cwd (bare ddev start) fail in such a directory either way — the note keeps that failure explainable. Unit tests (static wiring + functional stub runs incl. the owner-bit-trick unreadable cwd), e2e-ddev DD7 checks through the real transport (dev shell -> ddev() -> sudoers helper -> real ddev from the dev's 0750 home), docs section in ddev-integration.md.
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.
Closes #51
What
bin/ddev-as-opencodeprobes the inherited cwd ([ -x . ]) and falls backto the opencode home with a one-line stderr note when sudo kept an
unreadable cwd; it never aborts.
docs/concepts/ddev-integration.md.docs/design/ddev-url-transports.md: the browser-commandURL transport (describe -j since 0.0.26), the removed DDEV_DEBUG/FULLURL
transport, deferred alternatives, and a source map into the pinned ddev
v1.25.3 checkout for re-verification on ddev updates.
Why
ddev poweroff(and any registry-driven run likeddev stop <project>)from a directory the opencode user cannot search — the developer's $HOME,
0750 on Ubuntu 24.04 — warned per project:
Root cause: sudo keeps the caller's cwd, and ddev's compose loader resolves
its embedded schema against the process cwd (os.Getwd() -> stat(".")), which
fails with EACCES there. The stop itself always worked — noise, not breakage
(verified with real ddev 1.25.3: warning reproduced from an unreadable cwd,
clean run otherwise).
Commands that need the cwd (bare
ddev start) fail in such a directoryeither way — the note keeps that failure explainable.
Testing
tests/test-ddev-as-opencode.sh(static wiring + functionalstub runs incl. the owner-bit-trick unreadable cwd).
helper -> real ddev from the dev's 0750 home).