Download it now!
Bug 59424 - undefined: I/O Error while opening file from WebDAV over GVFS from Nautilus
Summary: undefined: I/O Error while opening file from WebDAV over GVFS from Nautilus
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA target:6.0.0
Keywords:
: 109520 112024 (view as bug list)
Depends on:
Blocks: Network
  Show dependency treegraph
 
Reported: 2013-01-15 15:01 UTC by Philipp Gassmann
Modified: 2020-03-02 02:03 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments
strace log (1.74 MB, application/x-gzip)
2013-01-15 15:01 UTC, Philipp Gassmann
Details
Strace log on failure (42.03 KB, text/x-log)
2017-06-09 17:38 UTC, Dave Richards
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Gassmann 2013-01-15 15:01:46 UTC
Created attachment 73097 [details]
strace log

Problem description: 
Error when opening a file from Nautilus with LibreOffice when the file is WebDAV mounted with GVFS.

The Same file can be opened from the same location from within LibreOffice, with the Open File Dialogue. Then you get asked for the Username and Password and Libreoffice seems to access the file directly over HTTP.

Steps to reproduce:
1. Mount a DAV Folder with Nautilus. 
URL in my Case: dav://admin@10.1.10.58:8080/alfresco/webdav/Sites/puzzletest/documentLibrary/Alfresco%20WebDAV%20Test/
2. Open a file with LibreOffice by doubleclick or context menu from Nautilus.
4. Error occurs.
Exact message:
(-) «General input/output error while accessing /home/pgassmann/.gvfs/WebDAV\ als\ admin\ auf\ 10.1.10.58%3A8080/Sites/puzzletest/documentLibrary/Alfresco\ WebDAV\ Test/Neu.odt.» [OK]

Working Variant:
1. = 1. above
2. Start LibreOffice
3. Open File dialogue from LibreOffice
4. Select the same file and click Open.
5. LibreOffice Dialogue: "Authentication Required", Enter user name and password for: "Alfresco DAV Server" on 10.1.10.58
6. Enter Username and password, click OK
7. File opens correctly

LibreOffice Version:
3.5.2-2ubuntu1

Involved Software: 
LibreOffice, Nautilus, GVFS, Alfresco

Current behavior:
Opening file from Nautilus causes Error,
Opening from LibreOffice Open File dialogue asks for credentials and works correctly

Expected behavior:
Opening from Nautilus works.
Opening from Open File dialog works without asking for credentials.

Attachment: strace log from following actions:
LANG=C libreoffice --strace
Open File from LibreOffice dialogue.
Trying to open file from Nautilus.
              
Operating System: Ubuntu
Version: 3.5.2 release
Comment 1 Philipp Gassmann 2013-01-16 09:13:08 UTC
Bug reported on Launchpad too: https://bugs.launchpad.net/df-libreoffice/+bug/1100190
Comment 2 Christian Krützfeldt 2013-07-22 14:39:13 UTC
I guess I can confirm this bug also for LibreOffice 4.0.4.2 and for owncloud instead of Alfresco.

I get:

General input/output error while accessing 
/home/christian/.gvfs/dav:host=cloud.balticfinance.com,ssl=true,prefix=%2Fowncloud%2Ffiles%2Fwebdav.php/Shared/somefolder/test.ods.

Using the Open File dialogue from LibreOffice gives me the same results as in the original bug report.


In addition (I'm not sure if this is the same bug), I can't create a new file on the WebDav share. I get:

Error saving the document Untitled1:
https://cloud.balticfinance.com/owncloud/files/webdav.php/Shared/somefolder/test/test2.ods does not exist.

followed by a:

Error saving the document Untitled1:
General Error.
General input/output error.

And then by a frozen LibreOffice - restarting Ubuntu or killing the soffice.bin process are the only options to get out of here.
Comment 3 phiamo 2013-08-06 20:16:32 UTC
Can confirm on Ubuntu 13.04 with LibreOffice 4.0.2.2
and owncloud 5.0.9
is there anything one could further help?a
Comment 4 Christian Krützfeldt 2013-08-07 08:58:56 UTC
The situation changed with LibreOffice 4.1.0.4.

It works now, but it is still useless for productive work.

LibreOffice now opens documents on an WebDav connection, but it asks for the connection passowrd once per session.
So if you open this document, work with it, close it open another document, close it and so on you end up constantly having to type in your password.

If you keep one document open - to not end the current session you don't need to reenter the password.

I'm not sure if this is still the same bug or a new bug, but for us it is still more or less useless as people get very frustrated with having to enter the password constantly.
Comment 5 Tobias Pichler 2014-11-06 15:22:48 UTC
I can confirm the behavior described from Christian Krützfeldt on Ubuntu 14.10 / LibreOffice 4.3.3.2

I am asked for my password everytime i open any document with LibreOffice on the WebDAV share mounted via Nautilus.

This is pretty annoying if you are using two factor authentication (generate a one-time password for your WebDAV connections) like for example Google is offering.
Comment 6 Obiwan72 2015-01-22 10:52:20 UTC
I can confirm this bug too on Ubuntu 14.04 and LibreOffice 4.2.7.2

Using owncloud webdav.

Error description:
receiving "general input/output error" when trying to load a document from a Nautilus davs folder.

Workaround:
Open the document in LibreOffice using "File/Open".

However it is not very user friendly for network users.
Comment 7 tommy27 2016-04-16 07:26:16 UTC Comment hidden (obsolete)
Comment 8 Dave Richards 2017-06-05 12:40:01 UTC
Confirmed and still broken in 5.3.4 using NextCloud over DAVS.  Work around is very clunky for end users for sure.   I had a suspicion that the issue was related to the GVFS file name mapping. But I replicated the file name on a physical part of the disk and it worked.  So this confirms the issue is actually with GVFS in some way.
Comment 9 Dave Richards 2017-06-09 17:38:45 UTC
Created attachment 133933 [details]
Strace log on failure
Comment 10 Dave Richards 2017-06-09 17:39:59 UTC
I perceive strace is showing the issue:

poll([{fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 2, 8118) = 1 ([{fd=14, revents=POLLIN}])
access("/run/user/413/gvfs/dav:host=content.largo.com,ssl=true,prefix=%2Fremote.php%2Fwebdav/Private Documents/About.odt", F_OK) = 0
access("/run/user/413/gvfs/dav:host=content.largo.com,ssl=true,prefix=%2Fremote.php%2Fwebdav/Private Documents/About.odt", F_OK) = 0
lstat("/run/user/413/gvfs/dav:host=content.largo.com,ssl=true,prefix=%2Fremote.php%2Fwebdav/Private Documents/About.odt", {st_mode=S_IFREG|0700, st_size=76746, ...}) = 0
open("/run/user/413/gvfs/dav:host=content.largo.com,ssl=true,prefix=%2Fremote.php%2Fwebdav/Private Documents/About.odt", O_RDWR|O_EXCL) = -1 EOPNOTSUPP (Operation not supported)
access("/run/user/413/gvfs/dav:host=content.largo.com,ssl=true,prefix=%2Fremote.php%2Fwebdav/Private Documents/About.odt", F_OK) = 0
lstat("/run/user/413/gvfs/dav:host=content.largo.com,ssl=true,prefix=%2Fremote.php%2Fwebdav/Private Documents/About.odt", {st_mode=S_IFREG|0700, st_size=76746, ...}) = 0


to me, it looks like it thinks this is a local disk and it's trying to get an exclusive lock?
Comment 11 Commit Notification 2017-07-05 14:56:42 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#59424 unset open flag O_EXCL if O_CREAT is not set

It will be available in 6.0.0.

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 12 Xisco Faulí 2017-08-07 08:56:48 UTC Comment hidden (obsolete)
Comment 13 Xisco Faulí 2017-11-05 21:51:10 UTC
A polite ping to Tomaž Vajngerl: is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Thanks
Comment 14 Aron Budea 2018-04-17 22:39:56 UTC
(In reply to Dave Richards from comment #10)
> open("/run/user/413/gvfs/dav:host=content.largo.com,ssl=true,
> prefix=%2Fremote.php%2Fwebdav/Private Documents/About.odt", O_RDWR|O_EXCL) =
> -1 EOPNOTSUPP (Operation not supported)

H. C. commented the following in bug 109520 comment 7:

> Libreoffice opens the file with O_RDWR.  Gvfs mounts only support opening
> files with O_TRUNC or O_APPEND.  But not O_RDWR by itself.
> 
> See...
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=748106
> https://bugzilla.gnome.org/show_bug.cgi?id=777152
> 
> You will get an "operating not permitted" error which shows up in
> libreoffice as "general input/output error".
Comment 15 Aron Budea 2018-04-17 22:43:09 UTC
*** Bug 112024 has been marked as a duplicate of this bug. ***
Comment 16 Aron Budea 2018-04-17 22:44:58 UTC
*** Bug 109520 has been marked as a duplicate of this bug. ***
Comment 17 QA Administrators 2019-04-18 03:03:04 UTC Comment hidden (obsolete)
Comment 18 Rhodri Harfoot 2020-01-24 01:20:11 UTC
Bug still exists for me using version 6.0.7.3 on Ubuntu 18.04 opening excel spreadsheet from smb mounted drive at run/user/1000/doc/gvfs/smb...
Comment 19 Tiade 2020-02-08 05:36:20 UTC
Same here trying to open ODS from SMB share, running LO 
"Version: 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.10
CPU threads: 2; OS: Linux 5.3; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group"

Since I have not been using the SMB share for several months (last time was appr. November 2019), I don't know exactly when this bug started for me. 

Certainly was OK in a earlier, also pretty recent version of LO.
Comment 20 Tiade 2020-02-09 11:22:36 UTC
It still works for me on another machine, with older OS, and hence older LO: 

Version: 5.1.6.2
Build ID: 1:5.1.6~rc2-0ubuntu1~xenial10
CPU Threads: 4; OS Version: Linux 4.15; UI Render: default;
Locale: ro-RO (ro_RO.UTF-8); Calc: group 

So, what are my options? Download the codebase, find where the change must be made (as more or less explained in an earlier comment), and build my own dedicated build? I don't hope so.