Skip to content

[stable32] fix(console): write app command loading errors to stderr - #62996

Merged
CarlSchwan merged 1 commit into
stable32from
backport/62718/stable32
Aug 8, 2026
Merged

[stable32] fix(console): write app command loading errors to stderr#62996
CarlSchwan merged 1 commit into
stable32from
backport/62718/stable32

Conversation

@backportbot

@backportbot backportbot Bot commented Aug 7, 2026

Copy link
Copy Markdown

Backport of #62718

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot Bot added bug 3. to review Waiting for reviews php Pull requests that update Php code AI assisted labels Aug 7, 2026
@backportbot backportbot Bot added this to the Nextcloud 32.0.14 milestone Aug 7, 2026
@printminion-co
printminion-co marked this pull request as ready for review August 7, 2026 04:57
@printminion-co
printminion-co requested a review from a team as a code owner August 7, 2026 04:57
@printminion-co
printminion-co requested review from come-nc, icewind1991, leftybournes and provokateurin and removed request for a team August 7, 2026 04:57
@CarlSchwan
CarlSchwan enabled auto-merge August 7, 2026 06:10
@CarlSchwan
CarlSchwan force-pushed the backport/62718/stable32 branch from bc1ea22 to c9bfb82 Compare August 7, 2026 07:53
@AndyScherzinger
AndyScherzinger force-pushed the backport/62718/stable32 branch from c9bfb82 to 5b58cf1 Compare August 7, 2026 16:44
@artonge
artonge force-pushed the backport/62718/stable32 branch from 5b58cf1 to c204230 Compare August 7, 2026 19:36
fix(console): write app command loading errors to stderr

When an app fails to load its commands from info.xml, the error was

written to stdout, while every other diagnostic in loadCommands() uses

$output->getErrorOutput(). The command itself then runs normally and

exits 0, so the message silently corrupts machine-readable output:

    $ ./occ app:list --output=json

    Connection refused

    {"enabled":{...},"disabled":{...}}

    $ echo $?

    0

Anything piping `occ <cmd> --output=json` into a JSON parser breaks, with

no non-zero exit code to detect it by.

Observed with notify_push on a setup that has the phpredis extension

loaded but no Redis configured: RedisFactory::isAvailable() only checks

whether the extension is loaded, so constructing the app's console

commands ends up calling pconnect() and throws RedisException.

--no-warnings is not a workaround for this, as it sets VERBOSITY_QUIET

and suppresses the payload too.

Route the message to the error output instead. It is still reported via

logger->error() exactly as before.

Assisted-by: ClaudeCode:claude-opus-5

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
@AndyScherzinger
AndyScherzinger force-pushed the backport/62718/stable32 branch from c204230 to 88d023c Compare August 8, 2026 10:03
@CarlSchwan
CarlSchwan merged commit da3a766 into stable32 Aug 8, 2026
226 of 233 checks passed
@CarlSchwan
CarlSchwan deleted the backport/62718/stable32 branch August 8, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted bug php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants