ReadOnlyError saving images through ZRS

Hi folks,
using this config ZRS in Python 3 and 5.2
We have a problem adding images. Adding them through Plone an error shows up:

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 162, in transaction_pubevents
  Module transaction._manager, line 252, in commit
  Module transaction._manager, line 131, in commit
  Module transaction._transaction, line 311, in commit
  Module transaction._compat, line 50, in reraise
  Module transaction._transaction, line 302, in commit
  Module transaction._transaction, line 447, in _commitResources
  Module transaction._compat, line 50, in reraise
  Module transaction._transaction, line 419, in _commitResources
  Module ZODB.Connection, line 480, in tpc_begin
  Module ZODB.mvccadapter, line 161, in tpc_begin
  Module ZEO.ClientStorage, line 801, in tpc_begin
ZODB.POSException.ReadOnlyError

Someone else with the same problem?
I've tried to add read-only = false to buildout, 755 on shared folder via NFS, and NFS says the folder is mounted as RW. No idea what is happening.

Thanks in advance,
Roberto

Which zeo client are you using and to which zeo server are you connecting to? In the buildout config you mentioned there is a primary and secondary (there named as "slave" :face_with_symbols_over_mouth: :fist:t6: :fist:t5: :fist:t4:). The first instance connects to the primary (which can be used for read and write), the second instance ("instance-slave") connects to the read-only secondary zeo server. Changing the read-only to False will still not let you write in the ZODB.

2 Likes

Good point and thank you for the reminder. Not sure if we did this already but we might want to go through the Plone docs and stuff to make sure we do not use master/slave anywhere. Als gh master branch is an issue that would be worth discussing. Maybe create a gh issue for it to keep track and also ask the board for opinions?

We will go through our stuff and replace master/slave with primary/secondary everywhere.

Thanks! The problem was that I forget to point to the correct zeo client...
Varnish was pointing to app2 (RO) not app1(RW). I have to do the balancing config depending on validated user or not, from app1 (RW) to app2 (RO)
Now I can save an image without errors. Thanks!!!

PD: We are renaming master&slave to primary&secondary in our configs :slight_smile:

1 Like