gvfs-copy --preserve doesn't work with MTP devices

Bug #1175947 reported by diaz8 on 2013-05-03
90
This bug affects 18 people
Affects Status Importance Assigned to Milestone
gvfs
Fix Released
Wishlist
gvfs (Ubuntu)
Low
Philip Langdale
Vivid
Low
Unassigned

Bug Description

[Impact]

* When using gvfs-copy --preserve from a MTP device to local, the timestamp
  is not preserved.

* touch "localfile" --reference="MTP file" works OK.

* I assume --preserve is not working.

[Test Case]

* Copy files from a MTP device using the --preserve option and check
  timestamps.

[Regression Potential]

* Verify files copied from MTP devices and their attributes.

Changed in gvfs (Ubuntu):
assignee: nobody → Philip Langdale (langdalepl)
diaz8 (diaz8) wrote :

Hi,

Please let me know if you want / need some log or test I could perform to speed the task.

Regards.

Philip Langdale (langdalepl) wrote :

The main issue is that no backend in gvfs actually respects it, and the documented semantics are not clear, so I'm not sure what the 'right' fix is. That and not having enough free time.

Scott Anderson (scotta1265-t) wrote :

Hi. I'm having the same problem with gvfs-copy --preserve not working
using Nautilus with a crossover cable, both running gvfs 1.12.1-0ubuntu1.2
Ubuntu LTS

In fact, the whole Nautilus-Samba relationship is so buggy (because of wireless adapters being ON prior to Samba connection over cross-over) that most of the time I just end up using FIlezilla to transfer files...
(maybe there's some fix, but I haven't found one...)

Sad too, because I really believe that the gvfs is a fantastic concept.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gvfs (Ubuntu):
status: New → Confirmed
Julian Alarcon (julian-alarcon) wrote :

I know that this is not a solution, but maybe this can help to some of you.
I found a script to set the modified date using the EXIF data from videos and pics.
http://unix.stackexchange.com/questions/89264/change-created-date-from-exif-data

I made some changes to the script (the original one didn't work for me).

First install this package: libimage-exiftool-perl
sudo apt install libimage-exiftool-perl

Then create a script with this code (don't forget to set executable permissions):

#!/bin/sh
for i in /path/to/folder/with/pics/*; do
    SPEC=`exiftool -t -S -d "%Y-%m-%d %H:%M:%S" -CreateDate "$i"`
    echo $SPEC
    echo "$i:$DATE"
    touch -d "$SPEC" "$i"
done

This will change all the modified dates from all files on /path/to/folder/with/pics/ with the one on the EXIF metadata information.

This is not a workaround, thi is just a fix for some kind of files.

Julian Alarcon (julian-alarcon) wrote :

I just tested and the date was preserved!! On Ubuntu 14.04, libmtp version 1.1.6-20-g1b9f164-1ubuntu2

Can you try to copy a file from the device to some local folder and check if the date is preserved?

My device is a Sony Xperia Z1 C6903.

Janis Elmeris (janis-elmeris) wrote :

I still have the problem: on Linux Mint 17 (based on Ubuntu 14.04), libmtp version 1.1.6-20-g1b9f164-1ubuntu2, device Samsung Galaxy S4 I9505.

Julian Alarcon (julian-alarcon) wrote :

Maybe this is also related with the Android version and OEM modifications. My Xperia Z1 has Android version 4.4.4.

Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue you are reporting is an upstream one and it would be nice if somebody having it could send the bug to the developers of the software by following the instructions at https://wiki.ubuntu.com/Bugs/Upstream/GNOME. If you have done so, please tell us the number of the upstream bug (or the link), so we can add a bugwatch that will inform us about its status. Thanks in advance.

Changed in gvfs:
importance: Unknown → Wishlist
status: Unknown → Confirmed
Changed in gvfs:
status: Confirmed → Fix Released
GrzesiekC (grzesiekc) wrote :

Hi all,

Will this fix land in 14.04 ?

Regards
Gregory

Philip Langdale (langdalepl) wrote :

That's up the the Ubuntu package maintainers, but I doubt it.

dantonic (dantonicelli) wrote :

Having same problem with a galaxy note 3. I appreciate ubuntu, but just want to say that these are the kind of problems that have caused me(and I'm guessing others as well) to leave Linux and go back to Windows many times. This bug is still present and it's been 2.5 years... I would consider this a basic obvious feature that should be part of any file copying function. Guess I need to boot Windows just so I can preserve the integrity of my files.

Changed in gvfs (Ubuntu):
status: Confirmed → Fix Committed
Sebastien Bacher (seb128) wrote :

the bugfix version include the needed change has been uploaded to wily and vivid (waiting for review)

description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gvfs - 1.24.2-0ubuntu1

---------------
gvfs (1.24.2-0ubuntu1) wily; urgency=medium

  * New upstream version
    - udisks2: Fix a crash when unmounting (lp: #1500516)
    - udisks2: Handle libsecret errors properly to avoid a crash
      (lp: #1132250)
    - mtp: Copy mtime when pulling (lp: #1175947)
    - gvfs-open: Do not alter uris before use (lp: #1453174)

 -- Sebastien Bacher <email address hidden> Tue, 29 Sep 2015 11:48:31 +0200

Changed in gvfs (Ubuntu):
status: Fix Committed → Fix Released

Hello diaz8, or anyone else affected,

Accepted gvfs into vivid-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gvfs/1.24.2-0ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Andrew Wilkinson (ajw-free) wrote :

 I recently upgraded from Ubuntu 15.04 to Ubuntu 15.10 beta 2.

After doing a package upgrade on 30 September 2015 I noticed that the gvfs package updated.

I have now tested transferring files via USB from my Samsung Galaxy Note 4 phone to my Ubuntu 15.10 desktop and I am pleased to report that the timestamp is correctly preserved.

I should add that it has been a very frustrating long wait (over two years), for this critical bug to be fixed. Such a long delay is potentially damaging to Ubuntu as bugs of this nature should receive top priority. Mobile phones and tablets are now a way of life and it is simply unacceptable to lose the date information on a file that is transferred from a phone to a PC - it is a form of "data corruption".

I am grateful to the software developers who fixed the bug in time for the release of Ubuntu 15.10.

GrzesiekC (grzesiekc) wrote :

Hi all,

It doesn’t work in some cases.
Thanks to courtesy of the Google programmers and their lack of support.

Please look at setLastModified() issue:

https://code.google.com/p/android/issues/detail?id=18624

Regards
Gregory

Andrew Wilkinson (ajw-free) wrote :

I'm sorry to read that the fix does not yet work in all cases.

Following on from my previous post:

I am using Ubuntu 15.10 beta2 followed by recent apt-get dist upgrade on +-30 September 2015.
The gvfs package updated to: gvfs_1.24.2-0ubuntu1_amd64.deb

I have tested the following three android devices:

Samsung Galaxy Note 4 SM-N910F (running Android 5.1)
Samsung Galaxy S4 i9500 (running Android 5.0.1)
Samsung Galaxy Note 10.1 2014 SM-P601 (running Android 4.4.2)

I performed the following tests via usb:

(1) Copying files from phone to Ubuntu laptop (RESULT: timestamp preserved)
(2) Copying files from Ubuntu laptop to phone (RESULT: *** timestamp NOT preserved ***)

(3) Copying files from phone to Windows 7 (RESULT: timestamp preserved)
(4) Copying files from Windows 7 to phone (RESULT: timestamp preserved)

All three android devices behave in the same way.

It is weird that timestamps are properly preserved in both directions for Windows 7,
yet timestamps are only preserved in one direction for Ubuntu (with gvfs 1.24.2).

The previous post suggested that there are problems relating to lack of support from Google android developers (and that is why it is difficult for Linux developers to fix).

Why then does it work properly for Windows if it is an Android problem?

Clearly the problem is only partially solved for Ubuntu.

It is still a serious problem if transferring files from Ubuntu to the phone destroys timestamps.
Please, can someone fix this problem or contact someone who can! (for the sake of Linux!!!)

(But I am still delighted that I can now move my photos & videos from my phone to my laptop without timestamp corruption. The problem was more serious for videos as it appears that no date information is stored inside the mp4 file; for jpg images, the date is stored inside the file).

GrzesiekC (grzesiekc) wrote :

Andrew could you test copying files inside phone and check timestamps i.e.:
- Internal <> Internal,
- Internal <> SD Card
- Internal <> USB (OTG).

Does any of your devices has an encrypted internal partition ?

As far as I can recall there can be these issues regarding timestamps:

- gvfs (Internal, SD, USB)
- FUSE implementation (SD and USB)
- Encryption (Internal, SD, USB)

My S4 had these issues since 4.2.

Happy to hear that it works for you :-).

Sebastien Bacher (seb128) wrote :

did anyone try the SRU to vivid?

tags: added: raring vivid
Changed in gvfs (Ubuntu):
importance: Undecided → Low
Changed in gvfs (Ubuntu Vivid):
importance: Undecided → Low
status: New → Fix Committed
tags: added: trusty
description: updated
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gvfs - 1.24.2-0ubuntu0.1

---------------
gvfs (1.24.2-0ubuntu0.1) vivid; urgency=medium

  * New upstream version
    - udisks2: Fix a crash when unmounting (lp: #1500516)
    - mtp: Copy mtime when pulling (lp: #1175947)
    - gvfs-open: Do not alter uris before use (lp: #1453174)

 -- Sebastien Bacher <email address hidden> Tue, 29 Sep 2015 11:48:31 +0200

Changed in gvfs (Ubuntu Vivid):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for gvfs has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.