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 706254 - Afp backend cannot copy files
Afp backend cannot copy files
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: afp backend
1.16.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 710146 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-08-18 16:52 UTC by Andreas Tunek
Modified: 2013-10-17 06:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fallback to plain queryinfo (1.99 KB, patch)
2013-10-16 14:13 UTC, Colin Walters
none Details | Review

Description Andreas Tunek 2013-08-18 16:52:04 UTC
When I try to copy a file with afp I get a popup saying the operation is not supported by the backend.

Using fedora 19, gvfs-afp.x86_64 1.16.3-2.fc19
Comment 1 Felix Möller 2013-08-26 22:04:58 UTC
I does work for me with gvfs 1.16.1-0ubuntu1 on my Synology NAS.
Comment 2 Ondrej Holy 2013-09-09 13:20:50 UTC
(In reply to comment #0)
> When I try to copy a file with afp I get a popup saying the operation is not
> supported by the backend.
> 
> Using fedora 19, gvfs-afp.x86_64 1.16.3-2.fc19

Thank you for your bug report. 

It is weird, because there is an existing afp copy implementation. Is it really afp protocol?

Are you able to reproduce it using pure gvfs commandline tools?
e.g. gvfs-copy afp://... afp://...
Comment 3 Andreas Tunek 2013-09-20 17:14:51 UTC
gvfs-copy afp://username@nasse.local/tuna/WindowsActivator.exe winactivator.exe
Error copying file afp://tuna@nasse.local/tuna/WindowsActivator.exe: Operation not supported by backend
Comment 4 Andreas Tunek 2013-09-20 17:18:41 UTC
gvfs-copy smb://nasse/tuna/WindowsActivator.exe winactivator.exe

Works as expected.
Comment 5 Felix Möller 2013-09-28 20:39:57 UTC
I cannot reproduce this on Ubuntu 13.10:

fm@thinkpad:~$ gvfs-copy afp://felix@nas/home/container_captcha.php afp://felix@nas/home/container_captcha.php2
fm@thinkpad:~$

using:
gvfs:amd64     1.18.1-0ubuntu1
Comment 6 Ondrej Holy 2013-10-03 15:53:23 UTC
Felix, could you test also something like:
gvfs-copy afp://felix@nas/home/container_captcha.php container_captcha.php

because your example is using copy implementation (deamon -> deamon), however Andreas's example is probably using default read/write fallback (deamon -> local).
Comment 7 Felix Möller 2013-10-03 16:14:25 UTC
Ok, I can reproduce this.

fm@thinkpad:~$ gvfs-copy  afp://felix@nas/home/hh1.jpg hh1.jpg
Error copying file afp://felix@nas/home/hh1.jpg: Operation not supported by backend
Comment 8 Ross Lagerwall 2013-10-11 10:42:47 UTC
This is almost certainly caused by 02aaef5a4dd (g_file_copy(): Clean up logic for info query) in glib.

The problem is that the copy implementation in glib calls g_file_input_stream_query_info which requires the backend to implement query_info_on_read.  The same problem occurs for the archive backend.

I'm not sure what the best solution is.  Perhaps try g_file_input_stream_query_info and then fall back on g_file_query_info?
Comment 9 Carl-Anton Ingmarsson 2013-10-11 21:47:03 UTC
(In reply to comment #8)
> The problem is that the copy implementation in glib calls
> g_file_input_stream_query_info which requires the backend to implement
> query_info_on_read.  The same problem occurs for the archive backend.
> 

Implementing query_info_on_read() should be pretty easy for the afp backend. I'll try to get to that in the coming week.
Comment 10 Ross Lagerwall 2013-10-12 05:18:04 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > The problem is that the copy implementation in glib calls
> > g_file_input_stream_query_info which requires the backend to implement
> > query_info_on_read.  The same problem occurs for the archive backend.
> > 
> 
> Implementing query_info_on_read() should be pretty easy for the afp backend.
> I'll try to get to that in the coming week.

Yeah that would certainly be useful anyway, but is query_info_on_read something that is expected of all backends?

Currently only the http, smb, sftp and test backends implement it.  This is partially hidden by the fact that some backends implement pull so copying from ftp to a local file works but copying from ftp to a non-local backend like smb also fails.

I guess feedback from some of the more experienced devs here would be useful.
Comment 11 Colin Walters 2013-10-16 13:55:33 UTC
Hm, ugly.  Well, we can pretty easily change gio to fall back to a plain g_file_query_info() if we get NOT_SUPPORTED.

But it would also be good to update the backends to implement query_info_on_read().
Comment 12 Colin Walters 2013-10-16 14:13:46 UTC
Created attachment 257425 [details] [review]
fallback to plain queryinfo

This patch compiles, but I didn't test that that it fixes the actual problem.  What's the easiest backend to set up that reproduces this?  I don't have anything that speaks AFP myself.
Comment 13 Ross Lagerwall 2013-10-16 15:26:42 UTC
You can do it in a couple of ways:
Mount an archive and then try and copy a file from the archive to the local disk.

Mount an ftp site and copy from there to another non-local backend (i.e. localtest or smb or something).  Copying to the local disk works because the pull method is implemented.

Or similarly, copy a file from the trash to another non-local backend.
Comment 14 Ross Lagerwall 2013-10-16 15:31:00 UTC
The patch seems pretty logical.

But should each backend implement query_info_on_read?
It doesn't really make sense to me for something like ftp.  Obviously for things like afp that (apparently) does support an fstat-like command, query_info_on_read() should then be implemented; but for the others, I'm not so sure.
Comment 15 Jan Rathmann 2013-10-16 16:57:00 UTC
Colin, I have build new packages with your patch applied under Ubuntu Saucy (based on glib2.0_2.38.0-1ubuntu1), and I can verify that the patch solves the bug for me (which manifested itself when I tried to copy files from my digital camera, as reported here: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1217230 ). Thanks alot!
Comment 16 Colin Walters 2013-10-16 17:56:18 UTC
Thanks Jan and Ross!  Sorry for the unintentional regression.  Pushed to master:

https://git.gnome.org/browse/glib/commit/?id=be2656f13952dd22d348ff5e3f43240700cdef5a
Comment 17 Jakob Unterwurzacher 2013-10-17 06:59:19 UTC
*** Bug 710146 has been marked as a duplicate of this bug. ***