Skip to content

Nextcloud seems to not be able to connect to redis with default settings #448

@jvalskis

Description

@jvalskis

Describe your Issue

I have an issue with Nextcloud failing to connect to redis when it's enabled. Here's an excerpt from the logs:

{
  "reqId":"b8E9pguPPMd2bgHNOOj0",
  "level":3,
  "time":"2023-09-26T06:14:19+00:00",
  "remoteAddr":"10.42.5.1",
  "user":"--",
  "app":"PHP",
  "method":"GET",
  "url":"/status.php",
  "message":"session_start(): Failed to read session data: redis (path: tcp://nextcloud-redis-master:6379?auth=\<redacted\>) at /var/www/html/lib/private/Session/Internal.php#222",
  "userAgent":"kube-probe/1.27",
  "version":"27.1.1.0",
  "data":{"app":"PHP"}
}

Which is weird, because when I do nslookup, it seems to resolve fine:

$ nslookup nextcloud-redis-master
Server:         10.43.0.10
Address:        10.43.0.10#53

Name:   nextcloud-redis-master.cloud.svc.cluster.local
Address: 10.43.32.88

What I did as a workaround, was to hardcode the "host" part in redis.config.php as such: 'host' => "nextcloud-redis-master.cloud.svc.cluster.local",. Any ideas what might be wrong here?

Logs and Errors

Describe your Environment

  • Kubernetes distribution: k3s

  • Helm Version (or App that manages helm): 3.11.0

  • Helm Chart Version: 3.5.22

  • values.yaml:

nextcloud:
  defaultConfigs:
    redis.config.php: false
  configs:
    redis.config.php: |-
      <?php
      $CONFIG = array (
        'memcache.distributed' => '\OC\Memcache\Redis',
        'memcache.locking' => '\OC\Memcache\Redis',
        'redis' => array(
          'host' => "nextcloud-redis-master.cloud.svc.cluster.local",
          'port' => getenv('REDIS_HOST_PORT') ?: 6379,
          'password' => getenv('REDIS_HOST_PASSWORD'),
        ),
      );
redis:
    enabled: true
    usePassword: true
    auth:
      existingSecret: nextcloud-auth-config
      existingSecretPasswordKey: redis-password
    master:
      persistence:
        storageClass: longhorn-fast-retain
    replica:
      persistence:
        storageClass: longhorn-fast-retain

Metadata

Metadata

Assignees

No one assigned

    Labels

    cachinganything to do with redis or opcacheneeds infoNot enough information provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions