Skip to content

fix(docker): clean up exec output handling and remove app:list workaround#985

Open
joshtrichards wants to merge 2 commits intonextcloud-libraries:mainfrom
joshtrichards:jtr/fix-docker-stderr-handling
Open

fix(docker): clean up exec output handling and remove app:list workaround#985
joshtrichards wants to merge 2 commits intonextcloud-libraries:mainfrom
joshtrichards:jtr/fix-docker-stderr-handling

Conversation

@joshtrichards
Copy link
Copy Markdown

@joshtrichards joshtrichards commented Apr 25, 2026

Resolves #954

This PR refactors Docker exec output handling so stdout and stderr are split at the low-level exec layer, while keeping the higher-level runExec helper simple for existing callers.

Why

runExec previously merged stdout and stderr into a single stream. That made command output harder to reason about, and forced runOcc to work around mixed output when parsing structured responses like occ app:list --output json.

The underlying demux fix has since been accepted upstream and is available in the current dockerode version (which we've since already upgraded to), so we can now separate the streams properly.

What changed

  • add a low-level runExecRaw helper that returns { stdout, stderr }
  • keep runExec as a thin wrapper that returns stdout only
  • log stderr separately when verbose is enabled
  • remove the old app:list parsing workaround in runOcc
  • parse occ app:list --output json directly from clean stdout

Compatibility

This keeps the common runExec(...): Promise<string> calling pattern intact for existing callers, while making stderr available through runExecRaw for cases that need it.

The main behavioral change is that runExec now returns stdout only, instead of merged stdout/stderr output.

Signed-off-by: Josh <josh.t.richards@gmail.com>
…nExec

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards changed the title fix(docker): split exec stdout and stderr handling and drop workaround fix(docker): clean up exec output handling and remove app:list workaround Apr 25, 2026
@joshtrichards joshtrichards marked this pull request as ready for review April 25, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Separate stdout and stderr in runExec

1 participant