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