Nextcloud 30.0.2 migrated to K8s, Having error session_start(): Redis connection not available

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian based docker image
  • Web server and version (e.g, Apache 2.4.25):
    • apache
  • PHP version (e.g, 8.3):
    • 8.1.30
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • just after the start almost every 5mins
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • kubernetes deployment using docker image
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

my users are getting 401 error and sync issues, in nextcloud logs I get this errors while I don’t see any errors on redis pod errors logs or monitor redis

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

kubernetes setup with kubedb redis
using image 30.0.2 and kubedb MySQL 8.0

Log entries

Nextcloud

PHP
session_start(): Redis connection not available at /var/www/html/lib/private/Session/Internal.php#198

Fehler	PHP	
session_start(): Failed to read session data: redis (path: tcp://redis.nextcloud.xxx.xxx.xxx:6379) at /var/www/html/lib/private/Session/Internal.php#198

Configuration

‘memcache.local’ => ‘\OC\Memcache\Redis’
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
// ‘session_save_path’ => ‘tcp://redis.nextcloud.xxx.xxxx:6379’,

‘redis’ =>
array (
‘host’ => ‘redis.nextcloud.xxx.xxx.xxx’,
‘password’ => ‘xxxxxxxxxxxxxxxxxxxxxx’,
‘port’ => 6379,

Tips for increasing the likelihood of a response

redis have no pressure on it and resources are not used excessively, I tried to remove appendonly but it didn’t give me the solution.

How are you specifying the Redis config info to the image?

It looks like maybe you aren’t using REDIS_HOST_PASSWORD? If you don’t, it will not get passed to the PHP config for session.save_path via the image’s entrypoint.

See Nextcloud Docker: Redis

Hello, For now I dont have a redis password.
and I configured the host name and other details in config.php for NC.

[

php -i | grep session.save_path
@nextcloud-85xxx:/var/www/html# php -i | grep session.save_path
session.save_path => tcp://redis.nextcloud.svc.cluster.local:6379 => tcp://redis.nextcloud.svc.cluster.local:6379
root@nextcloud-85c8dcb89b-pk77d:/var/www/html#

Issue resolved, I had made a separte service for kubedb redis, it was my mistake
Thankyou

1 Like