GNOME Bugzilla – Bug 793121
corrupt files via /run/user/<id>/gvfs
Last modified: 2018-09-21 18:17:50 UTC
files can be corrupt if copied from /run/user/<id>/gvfs/ this happens for files around 8-10k in size. the resulting file is truncated. the following fails: cp "/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C018%5D/Internal storage/test.json" /tmp/failed.json this works: gio copy mtp://[usb:001,018]/Internal%20storage/test.json /tmp/ok.json
There hasn't been a 1.34.x release with the fix for bug 784477 in it, and that might be related, as you are saying it only goes wrong using 'cp' which means it could be vulnerable to partial-read-past-EOF. The failure behaviour is undefined, and so your device may do something weird (my device stalls the transfer). Please retry with that fix applied and let us know.
I forgot to make the stable release, let's do it now, thanks for pointing it out!
applied patch from bug 784477 to gvfs-1.34.1 with the patch applied cp still gives me a corrupt file. "gio copy" still works but Gio in python (works without the patch) also fails now: from gi.repository import Gio data = Gio.File.new_from_uri('mtp://[usb:001,018]/Internal%20storage/test.json').load_contents(None).contents
Hmm. It is weird that python stop working, but it might be a consequence of custom build... so rather go back to your system version. Does cp print some error, or just fail silently? Can you please provide gvfsd log? See: https://wiki.gnome.org/Projects/gvfs/debugging Please use "GVFS_DEBUG=1 GVFS_DEBUG_FUSE=1 GVFS_MTP_DEBUG=all" in the second step. In the third step, please just connect the phone, try to copy one file using cp and then continue to the fourth step.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/327.