Open MarcelCoding opened 1 month ago
Hello @MarcelCoding, I think you need an forcesave option, in Nextcloud it's named "Keep intermediate version when editing (forcesave)". This changes the behavior of the "save" button: if Nextcloud is down and you will press "save" then you will get message "An error occured while saving the file...".
Cool, that would be a solution. But I think the database should not be dropped anyways. A user and an admin is not the same person and maybe to resolve the problem (why files cannot be saved) a restart is necessary. Therefore the data should be kept only when restarting onlyoffice.
Maybe the default should be changed in nextcloud or at least the wording with the explicit explanation that this can happen if you don't enable the option.
Maybe the default should be changed in nextcloud or at least the wording with the explicit explanation that this can happen if you don't enable the option.
We have it in the connector documentation.
Cool, that would be a solution. But I think the database should not be dropped anyways. A user and an admin is not the same person and maybe to resolve the problem (why files cannot be saved) a restart is necessary. Therefore the data should be kept only when restarting onlyoffice.
Changes are deleted from the database after they are sent to the document server cache, for example, this will happen if the editor receives the status of a closed document and this is regardless of the availability of the storage. And then this cache will wait until the storage is turned on and the first user who called the document will receive changes from the cache.
Changes are deleted from the database after they are sent to the document server cache, for example, this will happen if the editor receives the status of a closed document and this is regardless of the availability of the storage. And then this cache will wait until the storage is turned on and the first user who called the document will receive changes from the cache
That's interesting because the time I encountered data loss I've looked into all directories and there weren't an files. Because there was a restart in between the data was deleted from the database and I was able to recover the data from database backups. Now the question is, why wasn't the data written to the files? I should have not been able to recover the data from the database days after is was written to the database ? https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/0d5588d03a7672b8274e93d9151f9449f3dd499c/run-document-server.sh#L490 And because of that the cache is cleared all the time onlyoffice restarts, even if the data is not already written to the storage...
https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/931#issuecomment-2061870498 is probably the reason files count not be moved from the database to the cache. But the data should not be automatically cleared from the database if the creation of the cache failed.
That's interesting because the time I encountered data loss I've looked into all directories and there weren't an files. Because there was a restart in between the data was deleted from the database and I was able to recover the data from database backups. Now the question is, why wasn't the data written to the files? I should have not been able to recover the data from the database days after is was written to the database ? https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/0d5588d03a7672b8274e93d9151f9449f3dd499c/run-document-server.sh#L490 And because of that the cache is cleared all the time onlyoffice restarts, even if the data is not already written to the storage...
When the container is restarted, it starts documentserver-prepare4shutdown.sh, that forcibly disconnects all users from documents and sends all changes from the database to the cache and then to the storage (nextcloud in your case). This is done to avoid data loss when stopping or restarting the container.
The entire cache /var/lib/onlyoffice/documentserver/App_Data/cache/files/
will be deleted when the container is restarted, you need to mount it like here to avoid this.
But the data should not be automatically cleared from the database if the creation of the cache failed.
Agree, could you please describe the case of data loss in more detail so that I can repeat it?
The cache could probably not be created, because x2t failed: https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/931 (https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/931#issuecomment-2096548861)
(x2t is only failing for some document formats, not all)
This issue is unique.
Your idea.
Not to drop the database is currently not possible:
I've also noticed that OnlyOffice displays in the bottom corner that all changes are saved.![image](https://github.com/ONLYOFFICE/DocumentServer/assets/34819524/fd9c820d-2643-4e19-a228-7889d1ed38ba)
The actual error when saving changes back to OnlyOffice only occurs when using the save button in the menu.![image](https://github.com/ONLYOFFICE/DocumentServer/assets/34819524/0322e69e-42b3-4907-80c4-3026cc5b3d11)
It would be nice, that the user would be informed instantly if there are errors writing to the underlying storage provider. (e.g. Nextcloud)