nextcloud / nextcloud/notify_push

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

Open
#755 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
344
Forks
64
Avg merge
2d 10h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with custom_apps/notify_push/lib/Queue/PushRedisFactory.php and lib/AppInfo/Application.php, then trace the RedisFactory calls in lib/private/RedisFactory.php and Console/Application.php. Reproduce the failure with Redis unavailable by running occ config:list system and attempting user deletion. Done means notify_push reports or handles its configuration problem without aborting unrelated commands or leaving deletion partially completed.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, redis
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.