Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep Database after restart #2787

Open
1 task done
MarcelCoding opened this issue Jul 2, 2024 · 9 comments
Open
1 task done

Keep Database after restart #2787

MarcelCoding opened this issue Jul 2, 2024 · 9 comments
Assignees

Comments

@MarcelCoding
Copy link

This issue is unique.

  • I have used the search tool and did not find an issue describing my idea.

Your idea.

If nextcloud is down, or the changes can otherwise not be saved back to nextcloud (e.g. because of ONLYOFFICE/onlyoffice-nextcloud#931), the onlyoffice database contains all the user data and should absolutely not be dropped on startup!
~ NixOS/nixpkgs#319858 (comment)

Not to drop the database is currently not possible:

The only problem I could think of is the absence of database migrations because upstream is dropping everything on startup.
~ NixOS/nixpkgs#319858 (comment)

I've also noticed that OnlyOffice displays in the bottom corner that all changes are saved.
image

The actual error when saving changes back to OnlyOffice only occurs when using the save button in the menu.
image

It would be nice, that the user would be informed instantly if there are errors writing to the underlying storage provider. (e.g. Nextcloud)

@igwyd
Copy link
Member

igwyd commented Jul 10, 2024

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...".

@MarcelCoding
Copy link
Author

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.

@MarcelCoding
Copy link
Author

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.

@igwyd
Copy link
Member

igwyd commented Jul 10, 2024

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.

@MarcelCoding
Copy link
Author

MarcelCoding commented Jul 10, 2024

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...

@MarcelCoding
Copy link
Author

ONLYOFFICE/onlyoffice-nextcloud#931 (comment) 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.

@igwyd
Copy link
Member

igwyd commented Jul 31, 2024

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.

@igwyd
Copy link
Member

igwyd commented Jul 31, 2024

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?

@Rita-Bubnova Rita-Bubnova added the waiting feedback Issues that we waiting to be answered from author of issue label Jul 31, 2024
@MarcelCoding
Copy link
Author

MarcelCoding commented Jul 31, 2024

The cache could probably not be created, because x2t failed: ONLYOFFICE/onlyoffice-nextcloud#931 (ONLYOFFICE/onlyoffice-nextcloud#931 (comment))

(x2t is only failing for some document formats, not all)

@Rita-Bubnova Rita-Bubnova removed the waiting feedback Issues that we waiting to be answered from author of issue label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants