HELP! I can't access to Nextcloud server. It tells me "Redis read error"

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.5.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • nginx/1.22.1
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx/1.22.1
  • PHP version (e.g, 8.3):
    • 8.2
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After upgrade to Nextcloud 31 from 30
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare Metal
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Redis read error, while I can show all keys on the Nextcloud server using redis-cli.

Steps to replicate it (hint: details matter!):

  1. Access to https://cloud.home.arpa/login on web browser
  2. Wait forever never see the login page loads up

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"mbX4aHkDlnCohXDypEJT","level":4,"time":"2025-06-03T02:05:19+00:00","remoteAddr":"192.168.100.16","user":"--","app":"no app in context","method":"GET","url":"/login","message":"Could not boot webhook_listeners: read error on connection to 192.168.100.10:6379","userAgent":"Mozilla/5.0 (Windows NT 10.0; rv:128.0) Gecko/20100101 Firefox/128.0","version":"31.0.5.1","exception":{"Exception":"RedisException","Message":"read error on connection to 192.168.100.10:6379","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/Memcache/Redis.php","line":59,"function":"get","class":"Redis","type":"->"},{"file":"/var/www/html/nextcloud/apps/webhook_listeners/lib/Db/WebhookListenerMapper.php","line":210,"function":"get","class":"OC\\Memcache\\Redis","type":"->"},{"file":"/var/www/html/nextcloud/apps/webhook_listeners/lib/AppInfo/Application.php","line":47,"function":"getAllConfiguredEvents","class":"OCA\\WebhookListeners\\Db\\WebhookListenerMapper","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":28,"function":"registerRuleListeners","class":"OCA\\WebhookListeners\\AppInfo\\Application","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/BootContext.php","line":32,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/var/www/html/nextcloud/apps/webhook_listeners/lib/AppInfo/Application.php","line":34,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":157,"function":"boot","class":"OCA\\WebhookListeners\\AppInfo\\Application","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/App/AppManager.php","line":479,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/App/AppManager.php","line":248,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/legacy/OC_App.php","line":82,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/html/nextcloud/lib/base.php","line":1023,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/html/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/nextcloud/lib/private/Memcache/Redis.php","Line":59,"message":"Could not boot webhook_listeners: read error on connection to 192.168.100.10:6379","exception":{},"CustomMessage":"Could not boot webhook_listeners: read error on connection to 192.168.100.10:6379"}}
{"reqId":"UWMk1b19GduEDWMsxd4H","level":4,"time":"2025-06-03T02:05:27+00:00","remoteAddr":"192.168.100.17","user":"--","app":"app_api","method":"GET","url":"/status.php","message":"Error during app service registration: read error on connection to 192.168.100.10:6379","userAgent":"Mozilla/5.0 (Linux) mirall/3.7.3git (Nextcloud, debian-6.1.0-35-amd64 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"31.0.5.1","exception":{"Exception":"RedisException","Message":"read error on connection to 192.168.100.10:6379","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/RedisFactory.php","line":117,"function":"select","class":"Redis","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/RedisFactory.php","line":148,"function":"create","class":"OC\\RedisFactory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/Memcache/Redis.php","line":53,"function":"getInstance","class":"OC\\RedisFactory","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Memcache/Redis.php","line":59,"function":"getCache","class":"OC\\Memcache\\Redis","type":"->"},{"file":"/var/www/html/nextcloud/apps/app_api/lib/Service/ProvidersAI/SpeechToTextService.php","line":92,"function":"get","class":"OC\\Memcache\\Redis","type":"->"},{"file":"/var/www/html/nextcloud/apps/app_api/lib/Service/ProvidersAI/SpeechToTextService.php","line":137,"function":"getRegisteredSpeechToTextProviders","class":"OCA\\AppAPI\\Service\\ProvidersAI\\SpeechToTextService","type":"->"},{"file":"/var/www/html/nextcloud/apps/app_api/lib/AppInfo/Application.php","line":86,"function":"registerExAppSpeechToTextProviders","class":"OCA\\AppAPI\\Service\\ProvidersAI\\SpeechToTextService","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":99,"function":"register","class":"OCA\\AppAPI\\AppInfo\\Application","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":48,"function":"registerApps","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/html/nextcloud/lib/base.php","line":675,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/html/nextcloud/lib/base.php","line":1171,"function":"init","class":"OC","type":"::"},{"file":"/var/www/html/nextcloud/status.php","line":13,"args":["/var/www/html/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/lib/private/RedisFactory.php","Line":117,"message":"Error during app service registration: read error on connection to 192.168.100.10:6379","exception":{},"CustomMessage":"Error during app service registration: read error on connection to 192.168.100.10:6379"}}

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

Firefox ESR 128

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocs0radni8dg',
  'passwordsalt' => 'J3zkxA7XimqZ4gFVlpr8020k5xEBVG',
  'secret' => 'N011eOap9KlxQ5XKXI3U/UyM9okJUL5c5WE/X/gG6m3ulD8L',
  'loglevel' => 1,
  'trusted_domains' =>
  array (
    0 => 'cloud.home.arpa',
    1 => 'nextcloud1.home.arpa',
    2 => 'nextcloud2.home.arpa',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'default_timezone' => 'America/Toronto',
  'dbtype' => 'mysql',
  'version' => '31.0.5.1',
  'overwrite.cli.url' => 'https://cloud.home.arpa',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb.home.arpa',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'L3b2QoxJYuq9bu95vtFkLwN7F',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'auth.bruteforce.protection.enabled' => false,
  'redis' =>
  array (
    'host' => '192.168.100.10',
    'port' => 6379,
    'dbindex' => 1,
  ),
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'connectivity_check_domains' =>
  array (
    0 => 'https://www.nextcloud.com',
  ),
  'files.chunked_upload.max_size' => 0,
);

Apps

The output of occ app:list (if possible).

# sudo -u www-data php occ app:list
Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - app_api: 5.0.2
  - bookmarks: 15.1.0
  - bruteforcesettings: 4.0.0
  - calendar: 5.3.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contacts: 7.1.1
  - contactsinteraction: 1.12.0
  - cookbook: 0.11.3
  - dashboard: 7.11.0
  - dav: 1.33.0
  - epubviewer: 1.7.3
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - mail: 5.1.1
  - news: 26.0.0
  - nextcloud_announcements: 3.0.0
  - notes: 4.12.1
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - repod: 3.5.8
  - richdocuments: 8.6.5
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - tables: 0.9.3
  - tasks: 0.16.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_ldap: 1.22.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - whiteboard: 1.0.5
  - workflowengine: 2.13.0
Disabled:
  - encryption: 2.19.0
  - files_external: 1.23.0
  - files_mindmap: 0.0.33 (installed 0.0.33)
  - maps: 1.5.0 (installed 1.5.0)
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0

I’m missing DETAILED information how your network setup looks like, if Redis e.g. is running on the same server, how you’ve tested Redis access, etc., etc. Due to the fact that these kind of setup errors occur on a regular base it might be worth to search the forum for related postings, e.g.

All nodes and virtual ip are on 192.168.100.0/24 network and can ping each other.

Keepalived 1 config:

vrrp_instance cluster {
    state MASTER
    interface eno1
    virtual_router_id 50
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1234
    }
    virtual_ipaddress {
        192.168.100.10
    }
}

virtual_server 192.168.100.10 6379 {
    delay_loop 2
    lb_algo sh
    lb_kind DR
    persistence_timeout 0
    protocol TCP

    real_server 192.168.100.16 6379 {
        weight 1
        TCP_CHECK {
            connect_timeout 5
            retry 1
            delay_before_retry 3
            connect_port 6379
        }
    }

    real_server 192.168.100.17 6379 {
        weight 1
        TCP_CHECK {
            connect_timeout 5
            retry 1
            delay_before_retry 3
            connect_port 6379
        }
    }
}

Keepalived2 config:

vrrp_instance cluster {
    state BACKUP
    interface eno1
    virtual_router_id 50
    priority 90
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1234
    }
    virtual_ipaddress {
        192.168.100.10
    }
}

virtual_server 192.168.100.10 6379 {
    delay_loop 2
    lb_algo sh
    lb_kind DR
    persistence_timeout 0
    protocol TCP

    real_server 192.168.100.16 6379 {
        weight 1
        TCP_CHECK {
            connect_timeout 5
            retry 1  
            delay_before_retry 3
            connect_port 6379
        }
    }

    real_server 192.168.100.17 6379 {
        weight 1
        TCP_CHECK {
            connect_timeout 5
            retry 1
            delay_before_retry 3
            connect_port 6379
        }
    }
}

HAproxy1 config:

global
	log /dev/log	local0
	log /dev/log	local1 notice
	chroot /var/lib/haproxy
	stats socket /run/haproxy/admin.sock mode 660 level admin
	stats timeout 30s
	user haproxy
	group haproxy
	daemon
	maxconn 256

defaults
	#log	global
	mode	tcp
	#option	dontlognull
        timeout connect 5000
        timeout client  50000
        timeout server  50000

frontend http
	bind 192.168.100.16:1080
	default_backend stats


backend stats
	mode http
	stats enable

	stats enable
	stats uri /
	stats refresh 1s
	stats show-legends
	stats admin if TRUE

frontend redis
        bind            0.0.0.0:6379
        mode            tcp
        log             global
        timeout client  30000
        default_backend redis

backend redis
        mode            tcp
        timeout connect 30000
        timeout server  30000
        retries         3
        balance         first
        option          tcp-check
        tcp-check       connect
        tcp-check       send PING\r\n
        tcp-check       expect string +PONG
        tcp-check       send info\ replication\r\n
        tcp-check       expect string role:master
        tcp-check       send QUIT\r\n
        tcp-check       expect string +OK
        server          redis1 192.168.100.2:6379 check inter 1000 maxconn 1024
        server          redis2 192.168.100.3:6379 check inter 1000 maxconn 1024

HAproxy2:

global
	log /dev/log	local0
	log /dev/log	local1 notice
	chroot /var/lib/haproxy
	stats socket /run/haproxy/admin.sock mode 660 level admin
	stats timeout 30s
	user haproxy
	group haproxy
	daemon
	maxconn 256

defaults
	#log	global
	mode	tcp
	#option	dontlognull
        timeout connect 5000
        timeout client  50000
        timeout server  50000

frontend http
	bind 192.168.100.17:1080
	default_backend stats


backend stats
	mode http
	stats enable

	stats enable
	stats uri /
	stats refresh 1s
	stats show-legends
	stats admin if TRUE

frontend redis
        bind            0.0.0.0:6379
        mode            tcp
        log             global
        timeout client  30000
        default_backend redis

backend redis
        mode            tcp
        timeout connect 30000
        timeout server  30000
        retries         3
        balance         first
        option          tcp-check
        tcp-check       connect
        tcp-check       send PING\r\n
        tcp-check       expect string +PONG
        tcp-check       send info\ replication\r\n
        tcp-check       expect string role:master
        tcp-check       send QUIT\r\n
        tcp-check       expect string +OK
        server          redis1 192.168.100.2:6379 check inter 1000 maxconn 1024
        server          redis2 192.168.100.3:6379 check inter 1000 maxconn 1024

At first I didn’t understand how you’re using Sentinel in this way, but I guess you’re not relying on Sentinel to do the frontend failover in this case.

Also, running Redis Sentinel with two nodes is dicey (and Redis explicitly recommends against it). It has a permanent split brain problem due to a inability to elect a new master.

I’d suggest:

  • I assume the redis-cli run was from the NC app node? You may want to run it with --latency and/or --latency-history (and related) to gather some latency stats
  • adjusting / checking timeouts (Nextcloud Redis timeouts + other layers is your end to end path)
  • streamlining things for testing (i.e. maybe shutdown down one node)

Sentinel is not a load balacer, it switch replica to master when master is down.
Unfortunately Nextcloud don’t provide a detailed step-by-step guide on how to setup Sentinel and how to connect to it. Maybe it is because of Nextcloud is not Redis so Nextcloud don’t have the duty to do the job but I am pretty sure the business support line does provide a detailed tutorial.
This is the result I get from --latency-history

@jtr

Sometimes when Redis is not starting properly on my system I can easily test by commenting out redis lines in config.php. Like this:

*/ 'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',`Vooraf opgemaakte tekst` /*

But this does not fix Redis, just disables the use of redis.

Yes. It seems like a Redis problem. I found one Nextcloud node randomly can’t connect to Redis’ HA VIP. I didn’t do anything and it fixed itself automatically. Weird.

Also @jtr @j-ed

Sometimes just restarting the redis service will help.

I tried but it didn’t help my case