richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Collabora resets file changes at server restart

Open Roman991 opened this issue 1 year ago • 9 comments

Describe the bug

A Spreadsheet.ods loses all changes after a server restart

To Reproduce

Steps to reproduce the behavior:

  1. Create a new spreadsheet.ods
  2. Make some changes by 2 or more users'
  3. Leave users logged with the file opened
  4. Restart the instance (in my case the last AIO)
  5. Go back to the file and the changes are gome

Client details:

  • OS: lxc debian
  • Browser chrome
  • Version nextcloud 29.0.2

Server details

Operating system:

Web server:

Database:

PHP version:

Nextcloud version:

Version of the richdocuments app

Version of Collabora Online 24.04.4.1 Configuration of the richdocuments app

Insert the output of `./occ config:list richdocuments` (or equivalent adapted for your runtime environment)
Logs

Nextcloud log (data/nextcloud.log)

...some of this
[richdocuments] Error: Failed to validate WOPI access during save
	POST /index.php/apps/richdocuments/wopi/files/384133_ocd1clqcq7ei/contents?access_token=HrR1B6y00lklfNNIGf1mkPcEzC6BVAJ9&access_token_ttl=0&permission=edit
	from 127.0.0.1 by -- at 24 giu 2024, 22:38:42

Roman991 avatar Jun 26 '24 08:06 Roman991

Can you tell how you restart the server? Generally Collabora should handle restarts gracefully and save back the files if i remember correctly.

FYI @pedropintosilva Maybe you can poke someone who can tell more about that?

juliusknorr avatar Jun 26 '24 14:06 juliusknorr

The restart should be managed by this script https://github.com/nextcloud/all-in-one/blob/main/Containers/mastercontainer/daily-backup.sh

I meant the restart of docker containers, not of whole server, mb

Roman991 avatar Jun 26 '24 15:06 Roman991

I tried to reproduce this but could not see any issue. Do you have a way to reliably reproduce this by manually restarting the docker container of Collabora? Any chance you could gather the docker logs during that time to see if there are any errors reported?

juliusknorr avatar Sep 16 '24 09:09 juliusknorr

One quick idea might be that while the containers are shutdown, collabora is still trying to save the file but the Nextcloud container is already unavailable.

@szaimen Could that happen? Any chance we could adapt the backup script so that collabora is shutdown first and only once finished the Nextcloud container is stopped?

juliusknorr avatar Sep 16 '24 09:09 juliusknorr

This is difficult I fear. Currently always the apache container gets shut down first which runs the reverse proxy. So you say to fix this, we would need to change the order to shut down collabora first?

szaimen avatar Sep 18 '24 13:09 szaimen

I am seeing similar behavior. For example, I am also using the AIO mastercontainer and I also use daily backups. What I am seeing is that once everything is up and running I am then going into the "office" settings of my install and I am clearing out the default WOPI whitelist entries and then clicking the arrow to "save". At that point everything is fine and Collabora works without issue.

However, after the system goes down over the evening with the backups, once it's comes back up all the WOPI entries are then back and I have to go remove them again to regain functionality.

cybrnook avatar Nov 22 '24 16:11 cybrnook

I have now noticed that even just a simple stop all containers and then start all containers is causing my WOPI list to reset after bringing it back up. I don't think it's related to the backups, other then the fact they backups are also brining all containers down.

@szaimen

cybrnook avatar Nov 22 '24 17:11 cybrnook

@cybrnook you are doing it incorrectly. Removing the entries is an incorrect workaround. Adding 0.0.0.0/0 like mentioned here is the correct one.

szaimen avatar Nov 22 '24 17:11 szaimen

@cybrnook you are doing it incorrectly. Removing the entries is an incorrect workaround. Adding 0.0.0.0/0 like mentioned here is the correct one.

I could have sworn I tested that.

A gentlemen nonetheless, as it is now working. Thank you, have a great weekend.

cybrnook avatar Nov 22 '24 18:11 cybrnook

Hi, this is should now be fixed with AIO v11.5.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel

szaimen avatar Jul 29 '25 08:07 szaimen

Nice, let me close this one then.

juliusknorr avatar Oct 14 '25 20:10 juliusknorr