GNOME Bugzilla – Bug 585992
Copying files to FTP server via Fuse fails if the file doesn't exist already
Last modified: 2009-06-18 14:06:50 UTC
When I copy a file to a FTP server, the file is created with 0 bytes on the server and I get an error "No such file or directory". On a second attempt to copy the file, it works fine. This happens when the target file does not yet exist on the FTP server. And it only happens when using FUSE. Tested with GVfs 1.2.3. And it happens only with some FTP servers. While testing, I used a test account on www.bplaced.net where the bug occurs. To verify, I tested it with a local vsftpd server where it works as expected. Not sure what FTP server is running on bplaced.net, but maybe this is related.
Created attachment 136733 [details] Example of copying a file via "cp" to a FTP server
Hello Enrico! Could you please provide a debug log from gvfsd-ftp ? You could start it in a terminal by running something like "GVFS_DEBUG=1 /usr/lib/gvfs/gvfsd-ftp host=www.bplaced.net user=foo password=bar" to be able to capture the output while running the copy tests in another terminal.
Your suggested command didn't work for me as it couldn't log into the server and said: "Mount failed: Password dialogue cancelled". Anyway, I then used GVFS_DEBUG=1 /usr/lib/gvfs/gvfsd --replace >/tmp/gvfs.log 2>&1 and mounted the ftp connection manually which worked and gave me a lot of information in the log. I replayed my test commands then for both, the server at bplaced (which seems to be a PureFTP server) and my private vsftpd server, both logs and command sets are attached. Not that I know much of the FTP protocol but at least one thing seems obvious: the PureFTP server offers the EPSV feature but when GVfs tries to use it, the server says "500 Unknown command". But you probably know better what exactly this means and how it is related.
Created attachment 136821 [details] Debug log of bplaced.net
Created attachment 136822 [details] Debug log of vsftpd
The EPSV error isn't a problem since gvfs falls back on PASV. I think you're seeing the problem already reported in bug #574968, which seems to be a problem in the gvfs fuse daemon (not in the ftp backend).
Yes, it really seems to be the same issue as in bug #574968. *** This bug has been marked as a duplicate of 574968 ***
Hello, this bug exists with Pure-FTPd FTP server with MySQL user authentication Version 1.0.21-11.4. I hope this helps. Best regards from germany, Peter Majmesku
The bug exists on all ftp server implementations, it's a client side bug. Pure-FTPd just makes it more visible by giving currently-uploading files a temporary name until they are done. Even on other ftp server implementations you'll see the file having the wrong size though, since the fuse daemon did it's "stat" before the upload was finished.
How I can fix that on my System? I'm using Ubuntu 9.04 Jaunty.
Find the bug in the fuse daemon and provide a patch, or use programs that accesses gvfs via gio (glib) instead of ~/.gvfs/. The fuse daemon (~/.gvfs/) is only for "legacy" backwards compatibility.