Nextcloud via Cloudflare Tunnel Redis not working

The Basics

  • Nextcloud Server version _:
    • 30.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04 (LXD on Qnap NAS)
  • Web server and version (e.g, Apache 2.4.25):
    • 2.4.58
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Cloudflare Tunnel
  • PHP version (e.g, 8.3):
    • 8.3.13
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • after installing/configuring Redis
  • Installation method (e.g. AIO, NCP, Bare Metal/Archive, etc.)
    • LAMP-Stack
  • Are you using Cloudflare, mod_security, or similar? (Yes / No)
    • Yes, Cloudflare

Summary of the issue you are facing:

Hi,
I have installed the latest version of Nextcloud on my server as described above. I would like to configure the memcache locking after the installation and have adapted the config.php for this. Afterwards the note/error message disappeared, but unfortunately I can’t open any document since then. Only when I remove the Redis part from the config-php it works again.
Can anyone help me how I can run Redis in memcache locking under Cloudflare-tunnel?
Thank you!

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

  1. nano /etc/redis/redis.conf
  2. changed port 6379 to port 0
  3. changed unixsocket to /var/run/redis/redis.sock
  4. changed unixsocketperm 700 to unixsocketperm 770
  5. redis.conf successfully saved and nano-editor closed
  6. redis user added to www-data group (usermod -a -G redis www-data)
  7. redis server started, following error code ocurred: Job for redis-server.service failed because the control process exited with error code.
    See “systemctl status redis-server.service” and “journalctl -xeu redis-server.service” for details.
  8. config.php adjusted (see attached file)

Log entries

Nextcloud

[text] Fehler: Redis server went away
PROPFIND /remote.php/dav/files/nc-admin/
von 192.168.178.43 von nc-admin um 15.11.2024, 20:07:44
[webdav] Fehler: No such file or directory
GET /remote.php/dav/files/nc-admin/Nextcloud.png
von 192.168.178.43 von nc-admin um 15.11.2024, 20:07:37

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!):

PASTE HERE
<?php
$CONFIG = array (
  'instanceid' => 'ocnm1cuxhl5s',
  'passwordsalt' => '*****',
  'secret' => '*****',
  'trusted_domains' =>
  array (
    0 => '192.168.178.124',
    1 => 'subdomain.mydomain.org',
  ),
  'auth.bruteforce.protection.enabled' => false,
  'datadirectory' => '/home/data',
  'dbtype' => 'mysql',
  'version' => '30.0.2.2',
  'overwrite.cli.url' => 'http://192.168.178.43',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouduser',
  'dbpassword' => '*******',
  'installed' => true,
  'default_language' => 'de',
  'default_locale' => 'de',
  'default_phone_region' => 'DE',
  'skeletondirectory' => '',
  'loglevel' => 3,
  'filelocking.enabled' => 'true',
  'maintenance_window_start' => '1',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
     'host' => '/var/run/redis/redis.sock',
     'port' => 0,
     'timeout' => 0.0,
      ),
);