Author Topic: RoundCube not using Redis.  (Read 2879 times)

Offline Amplificator

  • Newbie
  • *
  • Posts: 3
RoundCube not using Redis.
« on: March 02, 2022, 02:00:03 AM »
Hey.

I'm having an issue getting RoundCube to use Redis. Redis is supported by the server and I have a test script that simply logs the number of times that I have visited the site and it works just fine using the same connection info I have given RoundCube.

For RoundCube I have added the following to my config file:
Code: [Select]
$config['redis_hosts'] = 'localhost:7035:0:PASSWORD';
$config['redis_max_allowed_packet'] = '8M';

Host, port, database id and password is correct, and as I said it works in my php test script which is on the same domain as RoundCube - have I missed something?
RoundCube shows nothing in its errors.log file.

Doing "redis-cli monitor" on the same host, port and password as I've given both RoundCube and the test script shows nothing when RoundCube is in use. I can see changes from the test script just fine.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: RoundCube not using Redis.
« Reply #1 on: March 02, 2022, 04:32:52 AM »
It does not use Redis by default, you have to enable session/caches for use with Redis.

Offline Amplificator

  • Newbie
  • *
  • Posts: 3
Re: RoundCube not using Redis.
« Reply #2 on: March 02, 2022, 04:46:16 AM »
I assume you mean I need to add this as well:

Code: [Select]
$config['session_storage'] = 'redis';
When doing so RoundCube won't load and in RoundCubes own error.log file I get these errors:

Code: [Select]
[02-Mar-2022 10:42:37 +0100]: REDIS Error: Redis host not configured in /var/www/html/roundcubemail-1.5.2/program/lib/Roundcube/cache/redis.php on line 85 (POST /roundcube/?_task=mail&_action=refresh)
[02-Mar-2022 10:42:37 +0100]: REDIS Error: Redis host not configured in /var/www/html/roundcubemail-1.5.2/program/lib/Roundcube/cache/redis.php on line 85 (GET /webmail/)
[02-Mar-2022 10:42:40 +0100]: REDIS Error: Redis host not configured in /var/www/html/roundcubemail-1.5.2/program/lib/Roundcube/cache/redis.php on line 85 (GET /webmail/)
[02-Mar-2022 10:42:47 +0100]: REDIS Error: Redis host not configured in /var/www/html/roundcubemail-1.5.2/program/lib/Roundcube/cache/redis.php on line 85 (POST /roundcube/?_task=mail&_action=refresh)

I am absolutely certain that Redis is running and working with the host, port, database id and password I put in the config file. I can monitor the database using redis-cli and see the test script use it as well.

Did I miss another thing?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Re: RoundCube not using Redis.
« Reply #3 on: March 02, 2022, 06:15:21 AM »
$config['redis_hosts'] = 'localhost:7035:0:PASSWORD';

should be

$config['redis_hosts'] = ['localhost:7035:0:PASSWORD'];

i think, according to the examples in comments of the config file.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline Amplificator

  • Newbie
  • *
  • Posts: 3
Re: RoundCube not using Redis.
« Reply #4 on: March 02, 2022, 06:37:59 AM »
Hey, that worked - thanks :)

It does state in the comment above that "Currently only one host is supported" so I somehow disregared the brackets and just had it as a single string. I guess that was my own fault :P

I do see the Redis database being used now.

Offline wenkt

  • Newbie
  • *
  • Posts: 1
Re: RoundCube not using Redis.
« Reply #5 on: September 24, 2022, 09:42:24 AM »
Thank you, @JohnDoh