Bug 72157 - LibreOffice does not release WebDAV file lock on document close
Summary: LibreOffice does not release WebDAV file lock on document close
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.1.3.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.4.0 target:4.2.6 target:4.3.0.2
Keywords:
: 73231 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-29 15:01 UTC by it
Modified: 2015-04-13 22:04 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
WebDAV error message (in german) (7.49 KB, image/png)
2013-11-29 15:01 UTC, it
Details
Apache Logs showing the UNLOCK when saving (3.82 KB, text/plain)
2014-08-07 09:46 UTC, it
Details

Note You need to log in before you can comment on or make changes to this bug.
Description it 2013-11-29 15:01:17 UTC
Created attachment 89999 [details]
WebDAV error message (in german)

DESCRIPTION
===========

When opening files through WebDAV, LibreOffice doesn't release the locking on the file any more and it stays locked. Until last week we still used the old LibreOffice version 3.5.6 where we never had any problems with WebDAV file locking. After switching to 4.1.3 this occured.

The application shows, when opening a file that was opened before and is closed meanwhile the attached message (in english it means: File ... is locked through an other user. At the moment no further write access can't be allowed).



STEPS TO REPRODUCE
==================

- Start LibreOffice
- Go to the file open dialog and enter a WebDAV URL (http://server/file.odt) and click "Open"
- The file is opened and can be edited
- Close LibreOffice (incl. Quickstart)
- Start LibreOffice again
- Open the same file through WebDAV again and you can't access it any more, because the server says it is locked.




WORKAROUND
==========

The only way to remove the lock is to delete the Apache WebDAV locking DB. But if a file was opened/closed again, like described above, it is locked again.




ADDITIONAL INFORMATION
======================

- Apache httpd 2.2.15-29 (shipped with RHEL6)

- httpd.conf WebDAV configuration:
  <Directory "/srv/www/htdocs/demo/">
          DAV On
          Options +Indexes -FollowSymLinks
          AllowOverride All
          Order deny,allow
          Allow from all
  </Directory>
  DAVLockDB /etc/httpd/WebDAV-DB/lock.db


If you require any further information, just let me know.
Comment 1 Julien Nabet 2013-11-29 19:59:05 UTC
I wonder if it could be a dup of fdo#72157 (put in See Also), could you take a look to this tracker?
I'll quote Maxim (that I "cced") who indicated in this tracker:
"
Could you please run LibreOffice installation, choose 'Modify' and uncheck the installation of Windows Explorer extensions? Does it solve your problem?
"
Comment 2 it 2013-11-30 19:34:24 UTC
> I wonder if it could be a dup of fdo#72157 (put in See Also), could you take 
> a look to this tracker?
>
> I'll quote Maxim (that I "cced") who indicated in this tracker:
> "
> Could you please run LibreOffice installation, choose 'Modify' and uncheck the 
> installation of Windows Explorer extensions? Does it solve your problem?
> "

The other bug sounds a bit like my problem. But it can't be workaround/fixed by disabling the shell extensions. It happens with and without installed Windows explorer extensions here.

If it 4.1.4rc1 fixes the problem, I will try on monday. I'll give feedback on that.
Comment 3 Maxim Monastirsky 2013-12-01 13:36:07 UTC
Reproducible with master build (Build ID: 4b0d5b7cb08148a53ff7f64c48f52a3291b7a0c3) under Windows 7 (32-bit). Tested from command line with 'soffice.exe http://ip_address/share/test.odt'. No Explorer extension installed (and never installed on that machine).

The file unlocks after several minutes.

Not reproducible under Fedora 19 (64-bit) with 4.1.3.2 & master build (Build ID: 0f4be588622379388650d8fc451829d17d16a7bf). Same with 4.1.3.2 under Ubuntu 13.10 (64-bit).
Comment 4 it 2013-12-02 07:20:17 UTC
I tested 4.1.4.1 (installed without windows explorer extensions on Win7 64-Bit).

If I open a file through WebDAV, save it, close LO or just the document and try to reopen it, then the file is locked. But with 4.1.4.1, the lock seems to be removed after about 5 minutes after LO or the document was closed.

This is a bit better than before in 4.1.3, but still anoying for WebDAV users, if they have forgotten something in the document and can't reopen it for a while.
Comment 5 Julien Nabet 2014-01-02 21:26:54 UTC
*** Bug 73231 has been marked as a duplicate of this bug. ***
Comment 6 it 2014-01-13 14:00:28 UTC
Feedback for the final 4.1.4(-2) version:

If a user opens a document via WebDAV, the lock is set, but not removed any more, until LibreOffice is completely closed (incl. Quickstart). It's not enough to simply close the document.

So problem still exists.
Comment 7 Con 2014-02-24 10:16:46 UTC
I confirm the problem on (K)Ubuntu 13.10, too.
If i open the Document by Libreoffice, im not able to save it: 

Fehler beim Speichern des Dokumentes test:
Die Datei https://xx.xx.xx.xx/remote.php/webdav/Documents/text.odt ist durch   Sie gesperrt. Im Moment kann kein weiterer Schreibzugriff auf diese Datei gewährt werden.

But if i open the File by Dophin, the File is localy downloaded and opened. So Libreoffice don#t lock the file at the webdav-server. Than i can save the file.
Comment 8 William Mann 2014-03-03 07:45:03 UTC
I'm also having this problem with my Windows installations. Here in the Municipality of Belluno we use exclusively LibreOffice (and OpenOffice before 2011). The software we use for administrative acts "interfaces" with LibreOffice by using a webdav directory for file editing. Unfortunately, this process only works in Windows if we use at the most version 4.0.6. From out tests, all of the versions 4.1.x and 4.2.x have the same problem. However, we haven't had this problem when using Ubuntu linux.

This is not a trivial problem for local government agencies that are adopting LibreOffice/OpenOffice more and more here in Italy.
Comment 9 a.plastini 2014-03-13 09:33:28 UTC
I have a similar problem opening multiple documents, starting with Ubuntu 11.10 and LO 4.1.3.2. 
When you open a document on the shared directory (using java EXEC) and a second document on the local file system, the block (on the first, closed just before) remains until the second file is closed.
This is a very annoying problem because it forces a user to close any other document before it will be able to edit the remote one.
Comment 10 it 2014-03-13 10:24:44 UTC
I removed the "Windows only" from the subject of this bug report, as some have reported, that they having this issue on linux too.


Has any of the developers already looked at the problem? I think many users are hitting this problem.


If there's anything more we can provide for helping to fix this, let me know.
Comment 11 François 2014-03-24 09:49:32 UTC
I have the same problem with LO 4.1.5.3 - Windows 7 64 bits.

- When I open a webdav document (in JackRabbit), LO send a LOCK order to Webdav.
We can see :
LOCK http://serv1:58323/slide/files/15347.odt HTTP/1.1
Connection: TE
TE: trailers
Host: serv1:58323
Content-Length: 182
Content-Type: application/xml
Depth: 0
Timeout: Second-180
Pragma: no-cache
User-Agent: LibreOffice

<?xml version="1.0" encoding="utf-8"?>
<lockinfo xmlns='DAV:'>
 <lockscope><exclusive/></lockscope>
<locktype><write/></locktype><owner>http://ucb.openoffice.org</owner>
</lockinfo>

- But when I close the document, LO don't send a UNLOCK. And it is a big problem for us. 

- No LOCK was send by LO 3.6.5.2 (the release, I use before).
- When I close LO, an UNLOCK is send.
UNLOCK http://serv1:58323/slide/files/15347.odt HTTP/1.1
Connection: TE
TE: trailers
Host: serv1:58323
Lock-Token: <82dd07f3-5460-48f0-942d-beb02e9233c3-9>
Pragma: no-cache
- I have the same problem with LO 4.2.2.1
Comment 12 it 2014-06-16 21:46:09 UTC
I started a sponsoring request:

https://freedomsponsors.org/core/issue/509/libreoffice-does-not-release-webdav-file-lock-on-document-close

It would be great if others would sponsor, too and hopefully we get this fixed, soon. :-)
Comment 13 Samuel Mehrbrodt (allotropia) 2014-06-20 13:19:01 UTC
I have also tested this and found out that a LOCK is sent for each document that is opened. But the UNLOCK is not sent when the document is closed, but when LibreOffice is closed.
So the problem exists only if you don't close LibreOffice.

Is that correct so far?
Comment 14 it 2014-06-20 13:42:45 UTC
(In reply to comment #13)
> I have also tested this and found out that a LOCK is sent for each document
> that is opened. But the UNLOCK is not sent when the document is closed, but
> when LibreOffice is closed.
> So the problem exists only if you don't close LibreOffice.

No. It doesn't seem to follow a rule:

I tried with 4.2.4.2 on Windows:
- Open a document via WebDAV.
- Change something and save.
- Close the document (quickstart is still running)
- Wait 1 minute
- Reopen the same document. LO says it's locked.
- Close the quickstart and make sure, that no soffice*, quickstart.exe or some other parts are running any more.
- Open the same document again (with quickstart disabled). Works.
- Close the document again (without any changes)
- Makeing sure, that no soffice*, quickstart.exe or some other parts are still running any more.
- Wait 1 minute
- Try opening the document again. LO says it's locked.


Another try with quickstart disabled:
- Open a different document via WebDAV. Works.
- Change the document and save it
- Close document (nothing from LO is running any more)
- Wait 1 minute.
- Open the same document again. LO says it's locked.
Comment 15 it 2014-06-21 09:28:22 UTC
I've changed the version number in the bug report to 4.2.4.2, as 4.1 isn't supported any more and it still exists in recent versions.
Comment 16 Julien Nabet 2014-06-21 09:39:53 UTC
Version indicates the earliest version when the bug appears, see https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Version
Comment 17 Commit Notification 2014-06-24 14:34:43 UTC
Matuš Kukan committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=956d088db5850e9a096bb9abd8b3e446e096f613

fdo#72157: webdav: Release WebDAV file lock on document close.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 Samuel Mehrbrodt (allotropia) 2014-06-24 17:49:35 UTC
Thanks for the fix Matus!
I tested it (with neon) and it works well.
The UNLOCK command is now sent when the document is closed, not only when LO is closed.
Comment 19 Samuel Mehrbrodt (allotropia) 2014-06-24 17:51:41 UTC
@Reporter: You might try a daily build to verify the fix: http://dev-builds.libreoffice.org/daily/master/

They should be available tomorrow.
Comment 20 it 2014-06-24 18:04:17 UTC
(In reply to comment #19)
> @Reporter: You might try a daily build to verify the fix:
> http://dev-builds.libreoffice.org/daily/master/
> 
> They should be available tomorrow.

Maybe a stupid question, but which of the Win* folders will contain the patched nightly build then? 


I'll let the nightly builds test in some of the departments using LO and WebDav and give feedback until end of the week. Thanks.
Comment 21 Samuel Mehrbrodt (allotropia) 2014-06-24 18:08:04 UTC
I'm not sure what exactly the difference between all of them is, but this one should contain the fix: http://dev-builds.libreoffice.org/daily/master/Win-x86@39/current/
Just make sure that the "last modified" date is after the patch was submitted.
Comment 22 Commit Notification 2014-06-24 23:05:00 UTC
Matuš Kukan committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=de5de7e1116fad18c8e3eef110eb32f2c75550ca&h=libreoffice-4-2

fdo#72157: webdav: Release WebDAV file lock on document close.


It will be available in LibreOffice 4.2.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2014-06-24 23:05:15 UTC
Matuš Kukan committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8b0b55adb3196d1833146497b01da2c0e7c45e87&h=libreoffice-4-3

fdo#72157: webdav: Release WebDAV file lock on document close.


It will be available in LibreOffice 4.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 24 it 2014-06-25 07:14:14 UTC
(In reply to comment #21)
> I'm not sure what exactly the difference between all of them is, but this
> one should contain the fix:
> http://dev-builds.libreoffice.org/daily/master/Win-x86@39/current/
> Just make sure that the "last modified" date is after the patch was
> submitted.

I tried 
http://dev-builds.libreoffice.org/daily/master/Win-x86@39/current/master~2014-06-25_00.23.12_LibreOfficeDev_4.4.0.0.alpha0_Win_x86.msi
http://dev-builds.libreoffice.org/daily/libreoffice-4-3/Win-x86@42/current/libo-43~2014-06-25_00.02.29_LibreOfficeDev_4.3.0.1.0_Win_x86.msi

Both I can't install on a fresh Win7 Pro 64-Bit (with all Updates). When I choose "typical installation" and click "next", the installer shows the error "Internal Error 2810. ReadyToInstall, EnableQuickstart, Back".

I also tried custom install with/without Quickstart. Same error.

So can't test it (yet).
Comment 25 Samuel Mehrbrodt (allotropia) 2014-06-25 19:03:08 UTC
There was an error in the installer which has been fixed now. Please try again tomorrow.
Comment 26 it 2014-06-26 07:56:13 UTC
(In reply to comment #25)
> There was an error in the installer which has been fixed now. Please try
> again tomorrow.

Today I tried
http://dev-builds.libreoffice.org/daily/libreoffice-4-2/Win-x86@42/current/libo-42~2014-06-26_00.38.42_LibreOfficeDev_4.2.6.0.0_Win_x86.msi
The installer works again.


With this version, the WebDAV issue seems to be fixed. When I open a Doc via WebDAV, save and close it (quickstart is still running) and re-open it, the Doc opens like expected. Thanks.


Can please one of the others, who had this bug, confirm, that it works in their environment, too?
Comment 27 Samuel Mehrbrodt (allotropia) 2014-06-30 15:33:16 UTC
As said in Comment 18, I have also tested this and confirm it works correctly now.
Comment 28 François 2014-08-07 09:21:16 UTC
Hi,

I test the solution with LibreOffice 4.2.6.2 on Windows plateform.

1/LibreOffice release now WebDAV file lock on document close
When I open a Doc via WebDAV => I have a GET and a LOCK send to webdav.
When I close these Doc => I have now a UNLOCK send to webdav.
-> It's ok

2/ But when I save a doc, I have a UNLOCK send to webdav.
STEPS TO REPRODUCE
------------------
When I open a Doc via WebDAV => I have a GET and a LOCK send to webdav 
When I save these doc => I have a UNLOCK and a PUT send to webdav. Now, I don't have a lock to the document
When I close these Doc => no message send

Have you noticed the same problem with you?
It will be the same with 4.3.0.2 and 4.4.0 ? (I have not tested these versions, but I think that the correction it's the same ?)
Should I reopen this bug? or create a new one?
Comment 29 it 2014-08-07 09:46:50 UTC
Created attachment 104215 [details]
Apache Logs showing the UNLOCK when saving

(In reply to comment #28)
> 2/ But when I save a doc, I have a UNLOCK send to webdav.
> STEPS TO REPRODUCE
> ------------------
> When I open a Doc via WebDAV => I have a GET and a LOCK send to webdav 
> When I save these doc => I have a UNLOCK and a PUT send to webdav. Now, I
> don't have a lock to the document
> When I close these Doc => no message send
> 
> Have you noticed the same problem with you?

I can confirm this problem.

I've attached an Apache logfile that shows whats happening when opening a document and when saving it (shows the UNLOCK).
Comment 30 Oleg Burlaca 2014-08-14 22:13:48 UTC
Hello François,
I just confirm the issue:
LO 4.3.0.4 will release the LOCK when Saving the document,
what is not ok.

It should keep the lock, and UNLOCK when document is closed.

(In reply to comment #28)
> Hi,
> 
> I test the solution with LibreOffice 4.2.6.2 on Windows plateform.
> 
> 1/LibreOffice release now WebDAV file lock on document close
> When I open a Doc via WebDAV => I have a GET and a LOCK send to webdav.
> When I close these Doc => I have now a UNLOCK send to webdav.
> -> It's ok
> 
> 2/ But when I save a doc, I have a UNLOCK send to webdav.
> STEPS TO REPRODUCE
> ------------------
> When I open a Doc via WebDAV => I have a GET and a LOCK send to webdav 
> When I save these doc => I have a UNLOCK and a PUT send to webdav. Now, I
> don't have a lock to the document
> When I close these Doc => no message send
> 
> Have you noticed the same problem with you?
> It will be the same with 4.3.0.2 and 4.4.0 ? (I have not tested these
> versions, but I think that the correction it's the same ?)
> Should I reopen this bug? or create a new one?
Comment 31 Julien Nabet 2014-08-15 12:20:54 UTC
Samuel/Matus: following last comments, should we reopen this one or it's a different problem and so a new bugtracker should be created?
Comment 32 Samuel Mehrbrodt (allotropia) 2014-08-16 08:46:34 UTC
Please create a new bug and add me and Matus in CC.
Comment 33 it 2014-08-18 06:04:11 UTC
(In reply to comment #32)
> Please create a new bug and add me and Matus in CC.

Done:

https://bugs.freedesktop.org/show_bug.cgi?id=82744