### Steps to reproduce SMB external storage needed in a Nextcloud configuration, with Collabora Online on the same server. 1. User A opens the document test.odt directly on the windows server or from a network drive or from a UNC path, with LibreOffice. a `.~lock.test.odt#` file is created in the same folder. 2. User B opens the same document with Collabora Online from a SMB external storage in Nextcloud, whatever the type of authentication used 3. User B modifies the document and save it (the document is still open by user A with LibreOffice) ### Expected behaviour User B should receive a error message because the document is locked on the server and B can't save it ### Actual behaviour B can save the document and exit Collabora Online without any warning, but all the modifications made by B will be lost. The admin_audit app logs "File updated" and then "File written", which is false. Not sure if it's a Collabora Online or Nextcloud bug, but as Nextcloud manages the storage, I think that Nextcloud should do the job. ### Steps to reproduce SMB external storage needed 1. User A opens the document test.odt directly on the windows server or from a network drive or from a UNC path, with LibreOffice. a `.~lock.test.odt#` file is created in the same folder. 2. User B opens the same document with Collabora Online from a SMB external storage in Nextcloud, whatever the type of authentication used 3. User B modifies the document and save it (the document is still open by user A with LibreOffice) ### Expected behaviour User B should receive a error message because the document is locked on the server and B can't save it ### Actual behaviour B can save the document and exit Collabora Online without any warning, but all the modifications made by B will be lost. The admin_audit app logs "File updated" and then "File written", which is false. Not sure if it's a Collabora Online or Nextcloud bug, but as Nextcloud manages the storage, I think that Nextcloud should do the job. So the bug is also created here : https://github.com/nextcloud/server/issues/6804 And I create this one to follow up. ### General server configuration **Operating system:** Linux 3.10.0-514.6.2.el7.x86_64 #1 SMP Thu Feb 23 03:04:39 UTC 2017 x86_64 **Web server:** Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/7.1.5 (fpm-fcgi) **Database:** mysql 5.5.52 **PHP version:** 7.1.5 **Nextcloud version:** 12.0.2 - 12.0.2.0 **LibreOffice Online version:** Collabora Online 2.1.3 **Windows server:** Windows server 2012 R2 **Are you using external storage, if yes which one:** [0] => \OC\Files\Storage\Local [10] => \OCA\Files_External\Lib\Storage\SMB **Are you using an external user-backend, if yes which one:** OpenLdap + Active Directory
@Michael - I rarely add you to a cc on a bug without first asking but this one seems like one you'd find interesting (possibly) and have knowledge about. It's quite old, trying to deal with these old unconfirmed bugs. Thoughts?
First - Joel ! wonderful to see you again - hope all's well; would love to catch up. Second - distributed locking is a living hell. Even if making this rather complex use-case possible was something we could do easily (and that's far from clear - it's a mixed Nextcloud, Online issue) - we would then get a slew of other bugs and use-cases around leaked lock-files; whether Nextcloud should try to create lock files when it believes a document is open in Online (but only when that is un-modified? rather than waiting for an hour to be expired?) etc. - the area opens a enterprise-sized can of worms =) Some of the reasons why I've resisted getting involved in distributed locking at least ;-) and that's before we get into leaked locks, inconsistent locks (where there is an OS/SMB lock on the file, but no lock-file or vv.) and so on ... anyhow. It is possible we can improve this with some concerted effort; in theory WOPI has locking extensions that can be implemented, but ... its a massive job to get right, horribly hard to validate, and will inevitably be deeply disappointing. I'd prefer FWIW to work on more robust ways of visualizing and/or merging changes ;-) now that is something generally useful & interesting. Nevertheless - we should prolly keep this open, in the long run we may have to do something here. Philippe - how are you feeling about this ? and/or do you feel motiviated to come up with a big matrix / description of the cases we need to handle (including all the asynchronous races between each of those - it will be many tens of different stats) - and what we need to do in those cases.