• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question redisException: READONLY You can't write against a read only replica

USY

Basic Pleskian
Hi,

I just move to a new server. I get the bellow Apache error. I am running Ubuntu 20.04 with a Plesk deployment (last version).
I don't understand fro the log, what the actual problem is. Would be happy if someone can help me to solve the issue.

My XenForo Redis Config:
Bash:
#redis cache
$config['cache']['sessions'] = true;
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = [
'server' => '127.0.0.1',
'port' => 6379,
];

Here are the Redis settings on Plesk Docker container.
1.png

XenForo Error Log.
2.png


Bash:
2023-05-24 16:22:48    Error    XXX.XXX.XXX.XXX        AH01071: Got error 'PHP message: PHP Fatal error: Uncaught RedisException: READONLY You can't write against a read only replica. in /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php:1280\nStack trace:\n#0 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php(1280): Redis->set('xf_data_codeEve...', 'gz:\\x1F\\x8Bx\\x01\\xBD[\\xDDr\\x9B\\xC8\\x12~...', 3600)\n#1 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(598): Credis_Client->__call('set', Array)\n#2 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(49): SV\\RedisCache\\Redis->SV\\RedisCache\\{closure}()\n#3 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(606): SV\\RedisCache\\Redis->redisQueryForStat('sets', Object(Closure))\n#4 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/CacheProvider.php(92): SV\\RedisCache\\Redis->doSave('xf_data_codeEve...', Array, 3600)\n#5 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/XF/DataRegistry.php(18...', referer: https://www.google.com/                Apache error
2023-05-24 16:22:48    Error    XXX.XXX.XXX.XXX        AH01071: Got error 'PHP message: PHP Fatal error: Uncaught RedisException: READONLY You can't write against a read only replica. in /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php:1280\nStack trace:\n#0 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php(1280): Redis->set('xf_data_codeEve...', 'gz:\\x1F\\x8Bx\\x01\\xBD[\\xDDr\\x9B\\xC8\\x12~...', 3600)\n#1 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(598): Credis_Client->__call('set', Array)\n#2 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(49): SV\\RedisCache\\Redis->SV\\RedisCache\\{closure}()\n#3 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(606): SV\\RedisCache\\Redis->redisQueryForStat('sets', Object(Closure))\n#4 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/CacheProvider.php(92): SV\\RedisCache\\Redis->doSave('xf_data_codeEve...', Array, 3600)\n#5 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/XF/DataRegistry.php(18...', referer: https://www.MYDOMAIN.com/                Apache error
2023-05-24 16:22:48    Error    XXX.XXX.XXX.XXX        AH01071: Got error 'PHP message: PHP Fatal error: Uncaught RedisException: READONLY You can't write against a read only replica. in /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php:1280\nStack trace:\n#0 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php(1280): Redis->set('xf_data_codeEve...', 'gz:\\x1F\\x8Bx\\x01\\xBD[\\xDDr\\x9B\\xC8\\x12~...', 3600)\n#1 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(598): Credis_Client->__call('set', Array)\n#2 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(49): SV\\RedisCache\\Redis->SV\\RedisCache\\{closure}()\n#3 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(606): SV\\RedisCache\\Redis->redisQueryForStat('sets', Object(Closure))\n#4 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/CacheProvider.php(92): SV\\RedisCache\\Redis->doSave('xf_data_codeEve...', Array, 3600)\n#5 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/XF/DataRegistry.php(18...', referer: https://www.MYDOMAIN.com/whats-new/posts/833809/                Apache error
2023-05-24 16:22:48    Error    XXX.XXX.XXX.XXX        AH01071: Got error 'PHP message: PHP Fatal error: Uncaught RedisException: READONLY You can't write against a read only replica. in /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php:1280\nStack trace:\n#0 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Credis/Client.php(1280): Redis->set('xf_data_codeEve...', 'gz:\\x1F\\x8Bx\\x01\\xBD[\\xDDr\\x9B\\xC8\\x12~...', 3600)\n#1 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(598): Credis_Client->__call('set', Array)\n#2 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(49): SV\\RedisCache\\Redis->SV\\RedisCache\\{closure}()\n#3 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/Redis.php(606): SV\\RedisCache\\Redis->redisQueryForStat('sets', Object(Closure))\n#4 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/addons/SV/RedisCache/CacheProvider.php(92): SV\\RedisCache\\Redis->doSave('xf_data_codeEve...', Array, 3600)\n#5 /var/www/vhosts/MYDOMAIN.com/httpdocs/src/XF/DataRegistry.php(18...'
 
Hello!
Looks like the issue is more or less related to the Redis configuration in Docker than to Plesk itself.
But anyway let's try to figure out what is going on here. Could you paste the env variables here so I could try to reproduce the issue?
 
Hello!
Looks like the issue is more or less related to the Redis configuration in Docker than to Plesk itself.
But anyway let's try to figure out what is going on here. Could you paste the env variables here so I could try to reproduce the issue?

1-png.23421
 
I don't know how to get the env variables as plain text. Can you let me it know?


1685014958917.png


Here is my App config:
Bash:
#redis cache
$config['cache']['sessions'] = true;
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']['username'] = 'rdsadm';
$config['cache']['config']['password'] = 'mypass';
$config['cache']['config'] = [
'server' => '127.0.0.1',
'port' => 6379,
];
 
I don't know how to get the env variables as plain text. Can you let me it know?
The path for example: In your first screenshot it is something totally different compared to your latest screenshot. There is is also incomplete, because the line expands over the end of the visible input field. Please copy the data from that field to get the full line. This is also how to get text from the screen to paste it into your post here.
 
The path for example: In your first screenshot it is something totally different compared to your latest screenshot. There is is also incomplete, because the line expands over the end of the visible input field. Please copy the data from that field to get the full line. This is also how to get text from the screen to paste it into your post here.

Yeah it’s different because switch to the bitnami/redis repository.

Environment variables

for Image: bitnami/redis:latest
PATH
: /opt/bitnami/common/bin:/opt/bitnami/redis/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

for Image: bitnami/redis:6.2.10
PATH

/opt/bitnami/common/bin:/opt/bitnami/redis/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 
Did you get this solved? We're having the same problem, randomly.

Redis encountered a fatal error: READONLY You can't write against a read only replica. (code: 0)

LiteSpeed server, LS Cache. same as above running Redis in Docker
 
Back
Top