Fixed XenForo 2.3.2 Redis (edit - not a bug, user error)

BikeGremlin

Active member
Affected version
2.3.2
So, the vanilla install - no add-ons (to be more precise: one add-on, LiteSpeed cache, is installed, but disabled).

I had implemented Redis using this method:

Forgot to test Redis on staging - my bad. It happens. :)

So, upon updating the production, I got this error (and decided to revert from backups):

To confirm, I tried enabling Redis using the above-linked method on the staging (which runs XenForo 2.3.2 now).
Got the forum to crash until I edited out the stuff from the src/config.php file (to "remove" Redis).
 
This is your configuration?

PHP:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
    'host' => '/home/my_cpanel_username/redis.sock',
    'port' => 666
];

If so, you don't need to (and shouldn't) specify a port when connecting via a socket.
 
This is your configuration?

PHP:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
    'host' => '/home/my_cpanel_username/redis.sock',
    'port' => 666
];

If so, you don't need to (and shouldn't) specify a port when connecting via a socket.

AFAIK that depends on how the server is configured.
In my case, Redis needs a certain port specified.

Edit:
That worked with XF 2.2.x, and it works with WordPress.
 
Not when using a unix socket, ports are for network connections.

Fair enough.
Before googling deeper:
The config worked with the XenForo 2.2.x

For what it's worth:
I have tried to comment out socket, then the port (i.e. to leave only one of the two).
That hasn't helped.

Edit:
Not the first nor the last time I look stupid in public - LOL.

Double checked (to confirm if Redis is running properly).
It works when using the socket only.

So, not a XenForo issue. User error. :)
 
Last edited:
XF 2.2 may have been more tolerant here, and perhaps we can make 2.3 more tolerant as well. I can at least confirm that including a port will cause it to be erroneously appended to the socket path (/home/my_cpanel_username/redis.sock:666).

I'll test further, but the error message implies the socket cannot be found at the configured path.
 
Double checked (to confirm if Redis is running properly).
It works when using the socket only.

So, not a XenForo issue. User error. :)
Glad it worked :) In any case it would be ideal if a working configuration on 2.2 didn't crash 2.3, so will leave this open to see if we can't address that.
 
Glad it worked :) In any case it would be ideal if a working configuration on 2.2 didn't crash 2.3, so will leave this open to see if we can't address that.

Sure.
Thank you very much for the uber-fast response (and pointing out the problem right away).
Let me know if you need any further info (log txt copy or similar).

If the info is of any use:
WordPress LiteSpeed cache plugin uses the "host" (socket) and the port in its configuration (won't work without both configured), while XenForo seems to be using the "host" (socket) only.
Edit/update:
No. WP LiteSpeed disregards the port if you set it to zero (0).
And you must set it to zero if you are using a socket.
 
Last edited:
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.3).

Change log:
Ignore port if Redis host appears to be a file path
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom