After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 551339 - copying a folder from a webdav server to disk results in a html file
copying a folder from a webdav server to disk results in a html file
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: webdav backend
0.99.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 546216 583952 605619 611570 615255 634038 664458 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-09-08 10:09 UTC by Sebastien Bacher
Modified: 2012-06-13 11:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Log of a single COPY transaction (34.98 KB, text/plain)
2009-03-29 01:32 UTC, Volker Puttrich
  Details
Requested log data (848.37 KB, application/x-zip-compressed)
2010-08-19 19:46 UTC, Boyd Edmondson
  Details
Stat (do a propfind) before opening the file to check if it is a directory (4.57 KB, patch)
2011-05-03 17:45 UTC, Christian Kellner
none Details | Review

Description Sebastien Bacher 2008-09-08 10:09:43 UTC
the bug has been opened on https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/267642

"Intention: To copy a folder (empty or containing files) from a Secure Webdav server to any location (local, or on the dav server)

Result: A fully formatted html file with the same filename as the folder I was trying to copy. It contains hierarchical links to the files contained within the original folder (if any). This is repeatable every time. An example of one such html file for the empty folder "Folder" is attached.

I am running a fully updated Intrepid .

kernel: 2.6.27-2-generic
gvfs 0.99.6-0ubuntu3
nautilus 1:2.23.91-0ubuntu1

I'm not sure what other information to provide. I'll help in any way I can.

http://launchpadlibrarian.net/17369352/Folder
    *   Folder  (748 bytes, text/html)"
Comment 1 Sebastien Bacher 2008-09-16 12:31:17 UTC
the issue is a gvfs one
Comment 2 Christian Kellner 2008-09-16 12:34:22 UTC
Sigh, yep, indeed. The way that gio's copy logic work, we need to return EISDIR for any open()s we get if the traget is a webdav collection. This means we neeed to stat (), i.e. do a PROPFIND, before doing the GET. Before every GET in webdav, yes. Teh Suck, indeed.
Also this is a gvfs bug.
Comment 3 Christian Kellner 2008-09-16 12:35:09 UTC
Nah, not fixed, damn bugzilla.
Comment 4 Christian Kellner 2008-09-16 12:35:32 UTC
My fault, I'll fix it.
Comment 5 tobias 2008-09-19 10:32:48 UTC
It seems, gvfs performs incorrect requests on copy. Instead of sending a COPY request to the server, it tries to GET the source and PUT it to the destination. This might be a working tactic for non-collection resources, but not for collections. However, in both cases the COPY request should be used, to reduce network traffic.

I scanned the requests via Wireshark against Lighttpd mod_webdav and my own WebDAV implementation (http://ezcomponents.org/s/Webdav) with my current Gentoo Nautilus (gvfs/0.2.5). The resulting requests by Nautilus were the same.
Comment 6 Volker Puttrich 2009-03-29 01:27:54 UTC
Any news about this issue?

MOVE is also affected, by the way. It creates a file with the name of the source collection, but then it gives me an error saying "Folder is not empty". This error doesn't show on COPY.

And now a question: Why does it do so many duplicate PROPFINDs before issuing GET/PUT (which must be COPY/MOVE anyway)?

Thank you.

Best regards, Volker
Comment 7 Volker Puttrich 2009-03-29 01:32:38 UTC
Created attachment 131611 [details]
Log of a single COPY transaction
Comment 8 Christian Kellner 2009-09-30 08:47:26 UTC
-> webdav backend
Comment 9 Pepijn de Jong 2009-11-12 10:00:12 UTC
I am affected by the exactly the same bug. A workaround seems to be using gnome-commander and then the Remote Server option in the connections menu, although the connection seems to be somewhat unreliable sometimes. 

Would really like to have this fixed in Nautilus though, any news?

Kind regards,

Pepijn
Comment 10 Michael Gauthier 2009-11-30 20:54:41 UTC
I'm implementing a DAV server and have encountered the same problem. The connection is regular HTTP using digest authentication.

Downloading single files works properly, downloading folders does not.

Using Ubuntu 9.10 gvfs-1.4.1-0ubuntu1
Comment 11 Michael Gauthier 2009-11-30 20:57:12 UTC
Bug #546216 is a dupe of this.
Comment 12 Michael Gauthier 2009-11-30 21:03:53 UTC
Bug #583952 is a dupe of this.
Comment 13 Christian Kellner 2009-12-11 13:07:48 UTC
*** Bug 546216 has been marked as a duplicate of this bug. ***
Comment 14 Christian Kellner 2009-12-11 13:09:15 UTC
*** Bug 583952 has been marked as a duplicate of this bug. ***
Comment 15 Boyd Edmondson 2009-12-21 19:52:04 UTC
It has been over a year.  Isn't it time this bug got fixed?  Everytime I use our company's WebDAV shared Internet folder, I have to have the content put in a .zip file before I can download it.

This problem is still present on Ubuntu 9.10 release.

We use Linux, Mac, and Windows.  It is always an embarrashment that Linux is the only one that can't do this simple access -- for over 15 months!
Comment 16 Boyd Edmondson 2010-06-03 17:25:39 UTC
Ubuntu 10.04 fresh install still has this issue.

Can we please fix this?
Comment 17 Matthias Clasen 2010-06-03 19:16:55 UTC
Not sure if 'we' can. But if you can, feel free to send a patch.
Comment 18 Christian Kellner 2010-08-09 14:57:50 UTC
*** Bug 615255 has been marked as a duplicate of this bug. ***
Comment 19 Christian Kellner 2010-08-09 14:58:08 UTC
*** Bug 611570 has been marked as a duplicate of this bug. ***
Comment 20 Christian Kellner 2010-08-09 17:33:18 UTC
"We" are fixing this bug currently. The git branch on 'dav_sync_io' gitorious[1] has a first version of a fix. I tested it locally and it seems to work fine. I encourage everybody to give it a shot and report the results here. Since it is quite some complex threading stuff I would want a proper review from someone before I will commit it.
It also needs some cleanup.

[1]http://gitorious.org/lanedo/gvfs/commits/dav_sync_io
Comment 21 Boyd Edmondson 2010-08-16 15:55:48 UTC
Has anyone tested this fix?  I tried but I could not figure out how to test it.
Comment 22 Christian Kellner 2010-08-17 11:15:02 UTC
For those who are running ubuntu: I made, with the help of seb128, a PPA with the fix in it: https://launchpad.net/~gicmo/+archive/packagedump
Comment 23 Boyd Edmondson 2010-08-17 13:51:28 UTC
Christian, thanks for the package installation.  I was able to install the newer version and had success and failure.

I was able to copy a folder for the first time!  A small folder with a few subfolders and files worked perfectly.  A larger folder failed.

At first it appeared that the failures were only on certain file names, but then simple file names also started failing.  Eventualy the WebDav connection itself became unstable.

The first error was:  "There was an error reading the folder "JJ&A".  HTTP Error:  Resource Not Found."

Additional file name errors before I chose "Skip All":  "ResSys_Planning.pics", "The Solar System.graffle", "Eiko's Ring.graffel", "Templates", "ICONS".

Trying to open the desktop icon for WebDav after the above copy completed yielded:  "Error:  HTTP Error:  Connection terminated unexpectedly.  Please select another viewer and try again."

A second attempt to open the WebDav icon yielded:  "File is of an unknown type."

After that I unmounted the WebDav (successfully).

To be explict on the installation, I used the archive source from Comment 22 and upgraded "gvsfs", "gvsfs-backends", "gvsfs-bin", "gvsfs-fuse" and manually chose "libgvfscommon0".  All upgraded to 1.6.3+git20100817-oubuntu2 from 1.6.1-9ubuntu1build1.
Comment 24 Christian Kellner 2010-08-18 09:52:53 UTC
Could you gather some debug info from the daemon by doing:
export GVFS_HTTP_DEBUG="header"
/usr/lib/gvfs/gvfsd --replace

(Do before you have started the first DAV connection, otherwise it won't be picked up)
You should see the the communication between the gvfs dav daemon and the server. If you could attach that here that would be superb. (Maybe remove the auth-haeader, just to be sure not confidential info is in there).
Comment 25 Boyd Edmondson 2010-08-19 19:46:34 UTC
Created attachment 168315 [details]
Requested log data
Comment 26 Boyd Edmondson 2010-09-07 18:48:59 UTC
Christian, any progress on this issue?
Comment 27 Cosimo Cecchi 2010-11-05 11:14:29 UTC
*** Bug 605619 has been marked as a duplicate of this bug. ***
Comment 28 harobed 2011-05-01 00:08:27 UTC
Same issue here with Ubuntu 10.10
Comment 29 harobed 2011-05-01 16:34:03 UTC
Same issue here with Ubuntu 11.04.
gvfs 1.8.0-0ubuntu2
Comment 30 Boyd Edmondson 2011-05-02 14:24:16 UTC
I recently rebuilt one of our WebDAV's on our server because the website had become corrupted.  Creating the site from scratch now allows the Linux client to copy folders.  I also noticed with experimentation that for Linux to copy folders, the following MIME type had to be set:  ".*", "application/octet-stream".

(The original website had that MIME type but still failed to copy folders, even before it became corrupted.)
Comment 31 Boyd Edmondson 2011-05-02 14:48:31 UTC
No, sorry.  The system that I tested on is the one that had the test package Christian created in this email chain above.
Comment 32 Christian Kellner 2011-05-03 17:45:07 UTC
Created attachment 187138 [details] [review]
Stat (do a propfind) before opening the file to check if it is a directory

Instead of changing the way we do IO for read () I came up with a simpler fix now that will also do a stat (i.e. a PROPFIND) before every open () to see if a file is a directory or not.
I tested this locally and it worked fine. I will test this later at home and if no problems appear commit it to git.
Sorry that it took so long.
Comment 33 Boyd Edmondson 2011-05-03 17:47:51 UTC
That would be great!  Thank you.

We just had a big update to WebDAV on our systems, so getting this folder copying to work now would be perfect timing.

I look forward to the update.
Comment 34 Christian Kellner 2011-05-03 22:44:24 UTC
I have committed a version of the patch that fixed a small issue to git master (d3fcf41ef3).
Comment 35 Christian Kellner 2011-05-03 22:55:43 UTC
*** Bug 634038 has been marked as a duplicate of this bug. ***
Comment 36 Christian Kellner 2011-05-04 08:12:47 UTC
Cherry-picked it to gnome-3-0 branch so it will be in the nex stable release of GNOME (3.0.2).
Comment 37 Boyd Edmondson 2011-08-19 20:05:52 UTC
Christian, I notice that Ubuntu 11.04 still has this bug.
Comment 38 Christian Kellner 2012-06-13 11:07:41 UTC
*** Bug 664458 has been marked as a duplicate of this bug. ***