WOPI locking mechanism error?

Dear all, @ahassain in CC

We are using OnlyOffice Docs version 8.0.1.31 (Docker) in order to edit documents from an ECM suite through the WOPI protocol.

Users are facing issues when opening documents from the ECM suite in OnlyOffice, making some changes, saving those changes in OnlyOffice, then closing OnlyOffice. When users attempt to save the modified documents in the ECM suite, they often get the following message: “The file is currently locked by OnlyOffice, please try again in a few seconds. If your OnlyOffice window is still open, you should close it first. If you continue, you may lose the latest changes made to that file”.

We had a look at the OnlyOffice logs and we found the following error:

[2024-08-30T08:14:48.819] [ERROR] [localhost] [8eef0cbc-2542-4f3d-a1ad-12a4b38f297b_1725005661526] [user2] nodeJS - wopi error PutFile:Error: Error response: statusCode:409; headers:{"x-frame-options":"sameorigin","referrer-policy":"no-referrer","strict-transport-security":"max-age=63072000","x-content-type-options":"nosniff","content-security-policy":"frame-ancestors 'self' https:;","feature-policy":"fullscreen 'self';","x-xss-protection":"1; mode=block","access-control-allow-origin":"*","access-control-allow-methods":"POST, PUT, GET, DELETE, OPTIONS","access-control-max-age":"3600","access-control-allow-headers":"Content-Type,Authorization,Authorization-Assume,Accept,X-Requested-With,X-Access-Token","cache-control":"no-cache,no-store,must-revalidate","pragma":"no-cache","expires":"0","vary":"Accept-Encoding","x-wopi-lockfailurereason":"Not already locked in ECM","content-type":"text/html;charset=UTF-8","content-length":"5547","date":"Fri, 30 Aug 2024 08:14:48 GMT","connection":"close"}; body:

The error code 409 points to some conflict when accessing a resource, as per:

Any idea what could be the root cause of this WOPI error ?

Best regards,

Samuel

Hello @sviscapi

First of all, please note that there is newer version of Document Server is available. I’d recommend updating first and then checking the situation again.

In general, as per documentation:

409 Conflict - Lock mismatch/locked by another interface; the X-WOPI-Lock response header containing the value of the current lock on the file must always be included when using this response code.

I believe this might be a starting point.

Dear @Constantine , @ahassain

Thank you very much for the quick reply, really appreciated.

Just before the error in the logs we got the following debug message:

[2024-08-30T08:14:48.793] [DEBUG] [localhost] [8eef0cbc-2542-4f3d-a1ad-12a4b38f297b_1725005661526] [user2] nodeJS - wopi PutFile request uri=https://some-url/ecm/rest/wopihost/files/8eef0cbc-2542-4f3d-a1ad-12a4b38f297b_1725005661526/contents?access_token=some-token headers={"X-WOPI-Override":"PUT","X-WOPI-Lock":"ijh+guFAjeE3YdONTBqcRA==","X-WOPI-Editors":"user","X-WOPI-Proof":"EeXiuvqZGPyXXK1A/apl4/1guLozV9SKcUEqQGmc1c2LyRc3Mt/uvZSCJQURgxAAR33bGFZfRTu3PAmBFbYSkjKklzUi0q1bRAzL3jE13NjNCbkgaZHlU4uHae8J5RkfqseFslGBbDWbRXV3yA0Ve0WzxekOmGIgLdHt8bDImXQxBEonDGz3RZBC38UFaIeUrl+Wdv/sAH1xI+zEUYp3M4CVlYPUAIUTP52JHpgDeFeRBOw6Ez0OGkokZR/YhrZWjFOo5M8ylFs8dEW3g3Zyxr/bQjLWnoZSNLb7SARucEmEdgdbUwbhVRcS2+MslnNo9zNzMxytqj4ibnA6XC0b4Q==","X-WOPI-ProofOld":"EeXiuvqZGPyXXK1A/apl4/1guLozV9SKcUEqQGmc1c2LyRc3Mt/uvZSCJQURgxAAR33bGFZfRTu3PAmBFbYSkjKklzUi0q1bRAzL3jE13NjNCbkgaZHlU4uHae8J5RkfqseFslGBbDWbRXV3yA0Ve0WzxekOmGIgLdHt8bDImXQxBEonDGz3RZBC38UFaIeUrl+Wdv/sAH1xI+zEUYp3M4CVlYPUAIUTP52JHpgDeFeRBOw6Ez0OGkokZR/YhrZWjFOo5M8ylFs8dEW3g3Zyxr/bQjLWnoZSNLb7SARucEmEdgdbUwbhVRcS2+MslnNo9zNzMxytqj4ibnA6XC0b4Q==","X-WOPI-TimeStamp":"638606024887890000","X-WOPI-ClientVersion":"8.0.1.31","Authorization":"Bearer xxx","X-LOOL-WOPI-IsModifiedByUser":true,"X-LOOL-WOPI-IsAutosave":false,"X-LOOL-WOPI-IsExitSave":true}

If I understand correctly, the X-WOPI-Lock header is set and consistent throughout the logs. I’m rather new to both WOPI and OnlyOffice, please bear with me.

If need be we’ll upgrade OnlyOffice to the latest version and give it another try.

Best regards,

Samuel

Yes, please update Document Server to actual version and check the situation again. Some fixes were applied to the WOPI protocol, they may impact this issue indirectly.

Dear @Constantine ,

I fetched onlyoffice/documentserver:8.1 (updated 8 days ago) from Docker Hub this morning, I’ll send the image to @ahassain next week for further tests.

N.B: the SHA-256 digests don’t match

Docker Hub: 030dec11873f
What I got: b9e3c35eab182d3de822a53b109b0f27070f6eacea3b1388b9c50d1182f638f2

Best regards,

Samuel

Looking forward to your feedback.

The one that has less characters is a manifest digest. Please go to Docker Hub, click this digest to open information about layer and you will find image index digest in this line:

Index digest: sha256:b9e3c35eab182d3de822a53b109b0f27070f6eacea3b1388b9c50d1182f638f2

Dear @Constantine ,

I have just updated Document Server to version 8.1.

We’ll run some more tests with @ahassain and we’ll get back to you ASAP.

Best regards,

Samuel

2 Likes

Dear @Constantine , @ahassain

Users are still facing the issue with Document Server 8.1.

I’ll try to get you some logs in order to make sure the error is the same.

Best regards,

Samuel

409 is returned by integrator, I believe it has nothing to do with the editor itself. Please check out some additional documentation on this status:

If possible, please share whole usage scenario under which this status is prompted.

Dear @Constantine , @ahassain ,

I just checked the logs while some user attempted to reproduce the issue with Document Server 8.1.

The error is gone from the Document Server logs (only INFO and DEBUG entries now), but the issue persists on the ECM software side. I’ll check the logs there and will keep you posted.

I believe I already shared the whole use case in my first post, please let me know if you’d need more information.

Best regards,

Samuel

New version 8.2 is now available. I recommend updating again to see if the situation changes.

In general, sorry for being unclear, I was referring to the scenario on how do your handle locks in your integration.

Dear @Constantine , @ahassain

I updated Document Server to 8.2 this morning. The issue is still present on the ECM side, but no error messages in Document Server logs.

I’ll try to share some more information to further debug this issue.

Best regards,

Samuel

I’m not sure if I understand what it means.

Are you unlocking the file after saving it?

Dear @Constantine , @ahassain

Yes, it is my understanding that the ECM suite we’re using tries to unlock the file after it has been saved in Only Office.

Best regards,

Samuel

Do you utilize Unlock to actually unlock files?