• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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
 
Back
Top