WOPI Integration, Session Expiration and configuration settings

Hi,

i successfully managed to create a WOPI endpoint and can view and edit documents. However i wonder if there is a setting to configure the session expiration. Sometimes i get an expiration message after ca. 60 seconds and sometimes immediately after opening a document.

Second. I have set the autoassembly interval and step to 0m in local.json. I found that in an article to force ONLYOFFICE to do a post to the PutFile endpoint on saving. Otherwise iam always getting a version mismatch message. Is there any known better solution than just forcing to post every change back? I saw a question on github issues with exactly that problem, but the issue was closed without leaving an answer there.

The configuration file has multiple options and for most of them i couldnt find documentation. Is there a document available which describes the various documentation options?

Iam using ONLYOFFICE 7.1 docker container as WOP Client.

Thank you in advance

Stefan

1 Like

Hello @StefanW
Sorry for the late reply.

Second. I have set the autoassembly interval and step to 0m in local.json. I found that in an article to force ONLYOFFICE to do a post to the PutFile endpoint on saving. Otherwise iam always getting a version mismatch message. Is there any known better solution than just forcing to post every change back? I saw a question on github issues with exactly that problem, but the issue was closed without leaving an answer there.

As far as I understand you are looking for ForceSave feature. Please note, that we are still working on this feature for WOPI. Recently we discussed the situation here: Running OnlyOffice with Docker-Compose - WOPI - Connection refused while connecting to upstream - #21 by Alexandre

However i wonder if there is a setting to configure the session expiration. Sometimes i get an expiration message after ca. 60 seconds and sometimes immediately after opening a document.

Please provide us with details of your desired scenario. default.json file contains sessionidle and sessionabsolute parameters which regulate editing session expiration.

“sessionidle” parameter is responsible for the disconnection user from the editor if they are inactive for some time. It can be set in /etc/onlyoffice/documentserver/default.json inside the container with the Document Server this way:

                        "expire": {
                                "sessionidle": "0",

Value can be “1h” for 1 hour, “3d” for three days, “20m” for 20 minutes and so on - any time period that meets your requirements. Please execute supervisorctl restart all after you make any changes to the default.json to apply them.

“sessionabsolute” parameter. This parameter is responsible for forcing the closing of the file after a certain amount of time.

I am also facing unexpected “The document editing session has expired. Please reload the page.” like @StefanW, mostly after minutes, especially on inactivity, e.g. if the tab is inactive.
We are using the onlyoffice/documentserver Docker image, and customized the /etc/onlyoffice/documentserver/production-linux.json with the default [1] services.CoAuthoring.expire block.
Are such timeouts to be expected, even before the specified 1h in certain scenarios? If that is the case, is the behavior documented somewhere?

[1] server/Common/config/default.json at f2bdecedf00da59ec70d265048590b1dad02f08a · ONLYOFFICE/server · GitHub

Hello @jbi

Please specify if Document Server is integrated with your solution via WOPI protocol too.
Also, please let me know version of Document Server and type of server OS on which Document Server is installed.

Hi @Constantine,
thanks a lot for getting back. Yes, it is integrated via WOPI, using this image, where the OS is Ubuntu 22.04.4 LTS running Document Server 8.1.3.4.

Please note that newer version is available. I recommend updating your instance for sure and checking the situation again. If it reproduces, please enable debug level logging, reproduce the issue and share logs of Document Server.

Extended logging can be enabled in /etc/onlyoffice/documentserver/log4gs/production.json config by changing value ´ to "DEBUG". Once changed, make sure to restart services with supervisorctl restart all command from inside the container.

To connect to the container use docker exec -it ID bash, where ID is the ID of container with Document Server that you can find by running docker ps.

1 Like

Thanks @Constantine, I will investigate and get back to you.

Looking forward to it.

1 Like

I can’t really see any errors in the log, but when the expiry happens, there is a session expiry log indeed:

documentserver-1  | [2025-01-07T07:25:13.541] [DEBUG] [localhost] [9186f1fa-ada9-477b-9301-c518f90794c0] [Unknown User2] nodeJS - sendData: type = session
documentserver-1  | [2025-01-07T07:25:13.562] [INFO] [localhost] [9186f1fa-ada9-477b-9301-c518f90794c0] [Unknown User2] nodeJS - data.type = clientLog
documentserver-1  | [2025-01-07T07:25:13.562] [DEBUG] [localhost] [9186f1fa-ada9-477b-9301-c518f90794c0] [Unknown User2] nodeJS - clientLog: disconnect code:4003;reason:absolute session expires
documentserver-1  | [2025-01-07T07:25:13.644] [INFO] [localhost] [9186f1fa-ada9-477b-9301-c518f90794c0] [Unknown User2] nodeJS - Connection closed or timed out: reason = client namespace disconnect
documentserver-1  | [2025-01-07T07:25:13.660] [INFO] [localhost] [docId] [userId] nodeJS - checkDocumentExpire start
documentserver-1  | [2025-01-07T07:25:13.660] [INFO] [localhost] [docId] [userId] nodeJS - checkDocumentExpire end: startSaveCount = 0, removedCount = 0
documentserver-1  | [2025-01-07T07:25:13.661] [INFO] [localhost] [docId] [userId] nodeJS - forceSaveTimeout start
documentserver-1  | [2025-01-07T07:25:13.661] [INFO] [localhost] [docId] [userId] nodeJS - forceSaveTimeout end

Does this indicate an issue with the configuration, even though there does not seem to be a clear pattern when it happens?

Can you share all logs of Document Server after the session expires?

Sure, here you go:
https://www.dropbox.com/scl/fi/e85efv5tf783w0kt0tfre/2025-01-09_sessionTimeout.txt?rlkey=nk0tuvtka26ibzt36q683fcyq&st=prp2mzud&dl=0
Thanks!

This is just one log. It does not show anything related to the document opening or working with it. Ideally, I am asking for an archive will all available logs after reproducing the issue. This would show the whole picture.

Do you refer to any other logs besides the log4js ones, and if so could you please specify which? Or rather those from the same source, but with the entries before the incident as well?

It seems like there is an issue with our TTL, I will investigate and keep you posted, thanks in the meantime!

Logs from /var/log/onlyoffice/documentserver directory.

Keep me posted. In any case, if none of the discovered info helps, please share all logs first.

Seems fine, thanks a lot for your support @Constantine, and very sorry for the false alarm! We tracked down the issue with the Interactive WOPI validation. We have been mislead as the behavior is different compared to Microsoft Office, where the expiry immediately occurs as expected, whereat the Document Server for some reason allows viewing/editing for some time before expiring.

2 Likes

I am glad to know. Thank you for also sharing the insight on the solution.