Skip to content

Redis connection failure in notify_push can abort unrelated operations and leave user deletion partially completed #755

Description

@yp05327

Summary

When notify_push is installed but Redis is unavailable or not configured, notify_push attempts to connect to 127.0.0.1:6379 during app/command initialization. The resulting RedisException: Connection refused can abort unrelated Nextcloud operations.

In my case, deleting a user from the admin UI returned an Internal Server Error. Afterward, the user no longer existed according to Nextcloud (user not found), but stale/ghost entries were still visible in the Accounts admin UI. This suggests the user deletion process was interrupted after only part of the cleanup had completed.

Removing notify_push stopped the Redis connection errors.

Environment

  • Nextcloud: 33.0.8.2
  • Deployment: Kubernetes / k3s
  • Database: PostgreSQL
  • memcache.local: \OC\Memcache\APCu
  • No redis, memcache.distributed, or memcache.locking configuration in the Nextcloud system config
  • Redis was not running on 127.0.0.1:6379

Steps to reproduce

  1. Run Nextcloud without Redis configured/running.
  2. Install/enable notify_push.
  3. Attempt to delete a user from the Nextcloud admin Accounts page.
  4. The request fails with an Internal Server Error caused by RedisException: Connection refused.
  5. The deletion may be left partially completed: occ user:info <uid> reports that the user is not found, while the Accounts UI can still show a stale entry for that UID.

The Redis error can also be reproduced by running an unrelated occ command such as:

php /var/www/html/occ config:list system

It prints Connection refused before the normal command output.

Relevant stack trace

RedisException: Connection refused

#0 /var/www/html/lib/private/RedisFactory.php(104):
   Redis->pconnect('127.0.0.1', 6379, ...)
#1 /var/www/html/lib/private/RedisFactory.php(148):
   OC\RedisFactory->create()
#2 /var/www/html/custom_apps/notify_push/lib/Queue/PushRedisFactory.php(38):
   OC\RedisFactory->getInstance()
#3 /var/www/html/custom_apps/notify_push/lib/AppInfo/Application.php(46):
   OCA\NotifyPush\Queue\PushRedisFactory->getRedis()
#4 ...
#15 /var/www/html/lib/private/Console/Application.php(209)
#16 /var/www/html/lib/private/Console/Application.php(101)
#17 /var/www/html/console.php(86)
#18 /var/www/html/occ(33)

The connection parameters shown in the original log were:

127.0.0.1:6379

Expected behavior

If Redis is unavailable or notify_push is not fully configured, notify_push should fail gracefully and report its own configuration problem without aborting unrelated Nextcloud operations.

In particular, a Redis connection failure in notify_push should not be able to interrupt a destructive core operation such as user deletion after that operation has already partially modified state.

It would also be preferable if merely loading occ commands did not establish a Redis connection that can throw an exception before the requested command runs.

Actual behavior

notify_push initializes its Redis-backed queue while Nextcloud is loading the app/commands. If Redis refuses the connection, the exception propagates into unrelated requests/commands. In the user-deletion case this appears capable of leaving the deletion only partially completed.

Additional note

After removing notify_push, the RedisException: Connection refused errors stopped.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions