Skip to content

fix(configure.sh): disable notify_push unless Redis password is set - #145

Merged
printminion-co merged 4 commits into
masterfrom
mk/fix/disable-notify-push-without-redis-password
Aug 3, 2026
Merged

fix(configure.sh): disable notify_push unless Redis password is set#145
printminion-co merged 4 commits into
masterfrom
mk/fix/disable-notify-push-without-redis-password

Conversation

@printminion-co

Copy link
Copy Markdown
Contributor

Problem

configure.sh enabled notify_push unconditionally. When the phpredis extension is loaded but no Redis is configured, notify_push throws RedisException: Connection refused while its console commands are constructed. OC\Console\Application::loadCommands() writes that error to stdout and the command still exits 0:

$ ./occ app:list --enabled --output json
Connection refused
{"enabled":{"cloud_federation_api":"1.17.0", ...}}
$ echo $?
0

That corrupts every occ call whose output this script captures — most fatally the occ app:list --enabled --output json | jq in disable_configured_apps, which then fails to parse and takes the whole configuration run with it.

The stdout/stderr half of this is being fixed upstream in nextcloud/server#62718, but configure.sh should not depend on that landing.

Change

notify_push is now disabled up front and only enabled when REDIS_HOST_PASSWORD is set — i.e. only in an environment where the app can actually work. The call also moved to the top of config_apps, so the app's state is settled before any other occ invocation whose output we read.

Commits

Reviewable one by one, no behaviour change in the first two:

  1. refactor(configure.sh): use log_warning instead of inline ANSI codes — the notify_push base URL warning was the last hand-rolled \033[1;33m… echo.
  2. refactor(configure.sh): use log_info for plain status output — remaining status echoes go through the helper. The indented key = value lines of the market block and the single-line progress printf in disable_configured_apps are deliberately left alone.
  3. fix(configure.sh): disable notify_push unless Redis password is set — the actual fix.
  4. fix(configure.sh): configure notify_push before the other apps — ordering.

Notes

  • disable_single_app notify_push is idempotent: occ app:disable exits 0 for an app that is not installed or already disabled (core/Command/App/Disable.php), so it only turns fatal on a genuine disable error.
  • Draft: the runtime check in a dev container is still outstanding.

The notify_push base URL warning was the last hand-rolled "\033[1;33m..."
echo in the script. Use the log_warning helper so warnings are formatted
consistently and go to stderr.
Route the remaining status echoes through the log_info helper so all
progress output carries the same "[i] " prefix. The indented key = value
lines of the market block and the single-line progress printf in
disable_configured_apps are left untouched, since a per-line prefix
would break their formatting.
notify_push without a reachable Redis throws while its console commands
are constructed, and that error lands on stdout with exit code 0 (see
nextcloud/server#62718). It then corrupts every occ call whose output the
script captures, most notably the `occ app:list --enabled --output json`
piped into jq in disable_configured_apps.

Disable notify_push up front and only enable it when REDIS_HOST_PASSWORD
is set, i.e. when the app can actually work.
Settle the notify_push state before any other occ invocation, so a broken
notify_push bootstrap cannot corrupt the captured stdout of the config
reads that follow (config:system:get in config_ui and log_market_config,
app:list in disable_configured_apps).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

configure.sh:182

  • The usage comment for this function doesn’t match the actual function name (comment says configure_notify_push_app, but the function is configure_app_notify_push). This can mislead future edits and grepping.
# Configure notify_push app
# Usage: configure_notify_push_app
configure_app_notify_push() {
	log_info "Configuring notify_push app..."

@printminion-co
printminion-co marked this pull request as ready for review August 3, 2026 09:53
@printminion-co
printminion-co merged commit 01b3f0f into master Aug 3, 2026
16 of 17 checks passed
@printminion-co
printminion-co deleted the mk/fix/disable-notify-push-without-redis-password branch August 3, 2026 10:35
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.

2 participants