Issues seeing other user edits Nextcloud 15.0.2 High Availability

I am running a setup currently with Two nextcloud servers behind HaProxy, two MySQL DBs Master/Slave, Redis memcache and a Windows server for NFS.

Currently I am having some issues when two users are editing a file at the same time. When using the loadbalancer if one user is sent to Server 1 and another user is sent to Server 2, and they both open the same file, they are able to edit it, but their sessions are not merged and cannot collaborate together. Their file saves cause weird overwrites and asks them to Discard changes or Overwrite.

I checked in loleaflet Admin console and I see two different PIDs for the same file but different users. If i manually swap my cookie that is giving me sticky sessions to point to the same Nextcloud backend server as the other user, then we are able to see eachother editing - and in the Admin console i see two views/users on the same PID.

How can I make it so that Collabora/Nextcloud merges sessions properly in this kind of configuration? I feel like it shouldnt determine sessions based off of originating server for instances like this.

So I believe i know the issue but i am unsure how to resolve it gracefully…

Since both of my Nextcloud servers are separate, they each have their own nextcloud/apps/richdocuments directories with their own app files. Judging from the logs I have seen , Nextcloud Instance 1 generates a file_id for WOPI and Nextcloud Instance 2 generates a file_id for WOPI, however they do not match.

If both servers were sharing the same service, or if these could keep the richdocuments WOPI src URL in the connected MySQL Database, then they would both be aware of any existing file edits that are going on. Both servers are sharing the same data storage so perhaps something could be done there?

Any thoughts on this or if there are any plausible workarounds?

I checked my loolwsd debug logging and saw that the docKey being generated was the same, but just had ....../richdocuments/wopi/files/<fileid>_<instanceid>

and there were two logs that had that.

Well i got it to work. I took my Nextcloud Server 1 instanceid and copied it over to my Nextcloud Server 2’s instance ID. Now to test and see if having duplicate instanceid’s breaks anything…

1 Like