Help troubleshooting redis issue

Nextcloud version: 18.0.14.1
Operating system and version: Ubuntu 20.04.6 LTS
Apache or nginx version: Apache/2.4.41
PHP version: 7.4

Hi, I just upgraded this physical (old) server from Ubuntu 18.04 to Ubuntu 20.04, and now I cannot access my NC web interfaces.
The error I get is:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

The error I get is:


{"reqId":"vfHNuaidikqHOlp2Sb4V","level":3,"time":"2024-08-09T10:40:09+00:00","remoteAddr":"1.2.3.4","user":"--","app":"remote","method":"GET","url":"/status.php","message":{"Exception":"OC\\HintException","Message":"Memcache \\OC\\Memcache\\Redis not available for local cache","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Server.php","line":630,"function":"__construct","class":"OC\\Memcache\\Factory","type":"->","args":["a06829f7a8f806146e8cd6abad4216c1",{"__class__":"OC\\Log"},"\\OC\\Memcache\\Redis","\\OC\\Memcache\\Redis","\\OC\\Memcache\\Redis"]},{"file":"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":125,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OC\\Memcache\\Factory"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":162,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\Memcache\\Factory"]},{"file":"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":114,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":125,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["MemCacheFactory"]},{"file":"/var/www/nextcloud/lib/private/Server.php","line":1657,"function":"query","class":"OC\\ServerContainer","type":"->","args":["MemCacheFactory"]},{"file":"/var/www/nextcloud/lib/private/Server.php","line":810,"function":"getMemCacheFactory","class":"OC\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":125,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OC\\App\\AppManager"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":162,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\App\\AppManager"]},{"file":"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":114,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":125,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["AppManager"]},{"file":"/var/www/nextcloud/lib/private/Server.php","line":1847,"function":"query","class":"OC\\ServerContainer","type":"->","args":["AppManager"]},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":347,"function":"getAppManager","class":"OC\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":114,"function":"getEnabledApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/nextcloud/lib/base.php","line":645,"function":"loadApps","class":"OC_App","type":"::","args":[["session"]]},{"file":"/var/www/nextcloud/lib/base.php","line":1092,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/nextcloud/status.php","line":38,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Memcache/Factory.php","Line":98,"Hint":"Is the matching PHP module installed and enabled?","CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/2.3.2 (build 1) (Nextcloud)","version":"18.0.14.1"}

I do confirm tha redis is running:

# ps aux |grep redis
redis       5690  0.1  0.1  55348  5880 ?        Ssl  12:33   0:00 /usr/bin/redis-server 127.0.0.1:6379
root        5856  0.0  0.0   8900   720 pts/0    R+   12:41   0:00 grep --color=auto redis

This is my config.php relevant part:

  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  )

Any suggestion?
Thank you!

If Redis resides on the local machine it might be better to use a socket connection than using a network connection:

BTW, it is very likely that other users have experienced the same issue before, therefore using the search functions of this forum should always be done first :wink:

Hi J-ed, you’re right, I was simply a little reluctant to change a configuration that I felt should work!
I confirm that, by configuring redis to listen on sock, and after changed config.php in that way:

//'memcache.local' => '\\OC\\Memcache\\Redis',
  //'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    //'host' => 'localhost',
    //'port' => 6379,
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
  ),

is it working fine :slight_smile:
Thank you!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.