nextcloud / nextcloud/helm

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

Open
#448 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

caching needs info
Dominant language
Go Template
Stars
534
Forks
314
Avg merge
42m
Merged PRs (30d)
1

Description

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

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 the chart's redis.config.php and the values.yaml configuration shown in the report; inspect how the Redis hostname, port, and password are rendered and used. Reproduce the connection failure with the Helm chart on k3s, then verify that the default configuration connects without hardcoding the fully qualified hostname.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes, php, redis
Domain
databases, devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.