Collabora - Document locked / read-only

Hi,
I’m using collabora online with the seafile server community edition 8.0.4. Everything works fine except editing files with collabora. Instead of giving me all the editing features the file opens in read-only mode most of the time and the following notification is shown by collabora:

Das Dokument konnte nicht gesperrt werden und wird im schreibgeschützten Modus geöffnet

which translates to

The document could not be locked and is opened in read-only mode

Sometimes the files just open fine.
Any ideas where to look for logs or which settings might be wrong?

Regards,
Garfield

Same problem here!
After upgrading Seafile Server CE from 7.1.5 to 8.0.4 opening files in collabora are every time READ ONLY. Pressing the button for editing in the lower right corner has no effect.

Excerpt from the docker image log:

wsd-00008-00070 2021-04-28 06:26:59.589953 [ docbroker_003 ] WRN  Un-successful WOPI::Lock with status 500 and response: <!DOCTYPE html>
<html lang="en">
<head>
<title>Page unavailable</title>
</head>
<body>
<h1>Page unavailable</h1>

<p>Sorry, but the requested page is unavailable due to a server hiccup.</p>

<p>Our engineers have been notified, so check back later.</p>
</body>
</html>
wsd-00008-00070 2021-04-28 06:26:59.590148 [ docbroker_003 ] ERR  Failed to lock!| wsd/DocumentBroker.cpp:813
wsd-00008-00044 2021-04-28 06:27:00.687016 [ websrv_poll ] ERR  Socket #29 SSL BIO error: closed unexpectedly (-1). (0: Success)| ./net/SslSocket.hpp:276
wsd-00008-00044 2021-04-28 06:27:00.687121 [ websrv_poll ] ERR  Error while handling poll for socket #29 in websrv_poll: SSL Socket closed unexpectedly.| net/Socket.cpp:314
wsd-00008-00044 2021-04-28 06:27:00.690148 [ websrv_poll ] ERR  Socket #29 SSL BIO error: closed unexpectedly (-1). (0: Success)| ./net/SslSocket.hpp:276
wsd-00008-00044 2021-04-28 06:27:00.691286 [ websrv_poll ] ERR  Error while handling poll for socket #29 in websrv_poll: SSL Socket closed unexpectedly.| net/Socket.cpp:314
...

Has anyone get working Collabora with Seafile Server 8?
Any ideas?

@daniel.pan This might be related with this issue?

1 Like

We’ve got the same issue with .docx files since upgrade to 8.0.4.
A downgrade to former version didn’t help

Is there any solution?

Hello everyone,

This problem is caused by commit https://github.com/haiwen/seahub/commit/504c53f1c2a49abce36a005b3e51dcf1742de308 in the Seahub server software, file seahub/wopi/views.py. In short, this commit adds the File Locking functionality to Seafile. Unfortunately this commit contains a bug.

File Locking is supposed to be a Professional Edition feature, not available in Community Edition (see comparison table at Seafile website). However, this is not checked in the code in that commit. As a result, the File Locking code will happily execute, and when the Seafile API is called, an error is thrown, because File Locking is only supported in the Professional Edition.

Fortunately, there has been a commit which fixes this issue: https://github.com/haiwen/seahub/commit/3e0dbe5b67db62044f74bdadb53961e4caf29a55. As you can see, this commit simply adds some if statements to check the is_pro_version status before trying to lock the file.

This commit is from May 25, consequently there is no release with this fix (the v8.0.5-server release is from May 13). This means you need to apply the patch manually if you want to fix this problem. Alternatively, if you are not technically inclined, you could wait until a new version is released.

To apply the fix, execute the following steps:

  • Go to your Seafile directory, e.g. cd /opt/seafile/seafile-server-8.0.5
  • This directory should contain a folder named seahub, enter it: cd seahub
  • Optionally: create a backup of this directory in case you mess up the patching
  • Download the patch from the Github commit: wget https://github.com/haiwen/seahub/commit/3e0dbe5b67db62044f74bdadb53961e4caf29a55.patch
  • Apply the patch to the directory: patch -p1 < 3e0dbe5b67db62044f74bdadb53961e4caf29a55.patch
  • Restart the seahub service: sudo systemctl restart seahub
  • Optionally: if you still have issues with some documents, you can try restarting the seafile service to clear the server side cache: sudo systemctl restart seafile

yet again this confirms there are no proper code quality checks in place. :-/