GNOME Bugzilla – Bug 706254
Afp backend cannot copy files
Last modified: 2013-10-17 06:59:19 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
I does work for me with gvfs 1.16.1-0ubuntu1 on my Synology NAS.
(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://...
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
gvfs-copy smb://nasse/tuna/WindowsActivator.exe winactivator.exe Works as expected.
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
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).
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
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?
(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.
(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.
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().
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.
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.
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.
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!
Thanks Jan and Ross! Sorry for the unintentional regression. Pushed to master: https://git.gnome.org/browse/glib/commit/?id=be2656f13952dd22d348ff5e3f43240700cdef5a
*** Bug 710146 has been marked as a duplicate of this bug. ***