Try to get redis get to work

Hello i have Ubuntu Server 22.04 with plesk
i have installed nextcloud i tried to install redis memecache

i follow this tutorial on the redis part

Redis Tutorial

but i get an Internal server error

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 webserver log.

below is my condig file

<?php
$CONFIG = array (
  'instanceid' => 'REMOVED',
  'passwordsalt' => 'REMOVED',
  'secret' => 'REMOVED',
  'trusted_domains' => 
  array (
    0 => 'cloud.krykomedia.eu',
  ),
  'datadirectory' => '/var/www/vhosts/krykomedia.eu/Domains/cloud.krykomedia.eu/data',
  'dbtype' => 'mysql',
  'version' => '30.0.2.2',
  'overwrite.cli.url' => 'https://cloud.krykomedia.eu',
  'dbname' => 'REMOVED',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'REMOVED',
  'dbpassword' => 'REMOVED',
  'installed' => true,
  'maintenance_window_start' => 1,
  'maintenance' => false,
  'default_phone_region' => 'NL',
  'mail_domain' => 'krykomedia.eu',
  'mail_from_address' => 'noreply',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'krykomedia.eu',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '465',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpname' => 'REMOVED',
  'mail_smtppassword' => 'REMOVED',
 'memcache.local' => '\\OC\\Memcache\\Redis',
 'memcache.locking' => '\\OC\\Memcache\\Redis',
 'filelocking.enabled' => 'true',
'redis' => 
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
);

Hope soneone can help me ! :smile:

1 Like

This is a generic error. As the message states, you’ll need to check your actual log(s). See Troubleshooting: Internal Server Errors.

yeah it should something with redis if redis out my config its all fine

i have a log below

Pastebin Nextcloud log

but i see not the problem for now ??

These are the key bits:

"Exception":"RedisException","Message":"No such file or directory"
"Exception thrown: RedisException",[...],"version":"30.0.2.2","exception":{"Exception":"RedisException","Message":"Redis server went away",

Some ideas / things to check

Is your Redis service actually running?

Does /var/run/redis/redis.sock exist?

What are the the ownership and permissions for the UNIX socket (file) /var/www/run/redis.sock?

Review the steps again, in case something minor was accidentally overlooked, in the caching section of that tutorial you are using (Note: I did not review the third-party tutorial in any way).

Do my system logs have any Redis related entries? (e.g. journalctl -ar and/or contents of /var/log/)?

Cross-reference what you have setup already with another tutorial such as this one which was recently posted on this forum.

Maybe try switching Redis to TCP (be careful: don’t bind it to a public IP address) and adjusting the Nextcloud config to use it at that IP:port combination. If that works, you can decide whether to leave it like that or try to reverse things step-by-step until you uncover the underlying problem from your original attempt.

Your config file is missing the ), to close the nested array with the Redis configuration. Try adding it on a new line before the ); as in the following example:

 'redis' =>
 array (
 'host' => '/var/run/redis/redis.sock',
 'port' => 0,
 'timeout' => 0.0,
 ),
);
2 Likes

Hmm thanks for helping guys

it was redis-server.sock

and i have checked the steps for the rest it seems fine but still getting erros

redis is located /var/run/redis/redis-server.sock

also in the config

but still not working also checked the config seems allright

in my redis condig its also

unixsocket /var/run/redis/redis-server.sock
unixsocketperm 770

so any tips or suggeestion

have this on my nextcloud conf now

  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
  'host' => '/var/run/redis/redis-server.sock',
  'port' => 0,
  'timeout' => 0.0,
  ),
 );

port is also on 0

Greetins Jonathan

Did you also add the www-data user to the redis group?

sudo usermod -a -G redis www-data

Is the php-redis module installed in the correct version? You can check with the following commands:

php -v

…and:

apt list php*-redis

Also, but this is just a side note and probably not the reason for the issue you’re experiencing, the tutorial you linked to says it wants to enable APCu and Redis. So shouldn’t the config look like this then?

'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
  'host' => '/var/run/redis/redis-server.sock',
  'port' => 0,
  'timeout' => 0.0,
  ),
 );

Afaik, Plesk does its own thing for managing PHP, and maybe other things like the web server, the database and Redis as well, so maybe the problem is related to Plesk somehow. Unfortunately, I don’t have any experience with Plesk, so I can’t really help you there.

EDIT:
I’m pretty sure that Plesk at least manages PHP and puts the modules in a different location than apt, so chances are that if you installed the php-redis package via apt as described in the tutorial you linked to, that package will not be used and you’ll have to install or enable it via Plesk instead. That’s just a wild guess, but it might be worth checking…

On some servers each user get his own port for Redis. On our server each user has its own Redis instance (Debian). They can use the database 0-15 for different applications.

This works for us:
‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘/home/ username /.redis/redis.sock’,
‘port’ => 0,
‘dbindex’ => 5,
‘timeout’ => 1.5,
),
‘filelocking.enabled’ => ‘true’,

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