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 720238 - Nokia Lumia 620 (WP8) fails to mount reliably via gvfs-mtp in nautilus (Ubuntu 13.10)
Nokia Lumia 620 (WP8) fails to mount reliably via gvfs-mtp in nautilus (Ubunt...
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: mtp backend
1.18.x
Other Linux
: Normal normal
: ---
Assigned To: Philip Langdale
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-11 08:52 UTC by benjaminosm
Modified: 2014-09-26 07:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
strace output obtained on mounting Nokia Lumia 625 (79.24 KB, text/x-log)
2014-03-22 16:59 UTC, Valerio Ponte
Details
strace output obtained on writing Nokia Lumia 625 (73.56 KB, text/x-log)
2014-03-22 16:59 UTC, Valerio Ponte
Details
gvfsd-mtp crash on unmount of Nokia Lumia 625 (5.35 KB, text/x-log)
2014-03-22 17:00 UTC, Valerio Ponte
Details

Description benjaminosm 2013-12-11 08:52:09 UTC
I got a Nokia Lumia 620 as a backup phone. I'd say I can mount my Nexus 4 reliably with Ubuntu via nautilus using gvfs-mtp. Users with Android devices like the Nexus 4 still get error messages on a regularly basis of the device not being able to mount, but replugging the device mostly fixes the issue.

However, the experience with the Lumia 620 is far worse (the desktop sometimes freezes) and the workaround I found to get the device to work is very crude.

The Lumia 620 itself was added to libmtp with this report: http://sourceforge.net/p/libmtp/bugs/780/

Bug Report on Launchpad: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1247572

I got no crashes today when walking through the steps below, but I still need to run mtp-detect to mount the internal storage and sd card.


## Steps to reproduce:

1. Reboot (or cold boot) computer and phone. Login to computers destop and unlock the phone by entering PIN.
2. Plug the phone via USB into the computer. (Cable works with Nexus 4 or another Android device.) The phone will give a signal that it is connected to the computer.
3. Try to open the phone in Nautilus. My desktop either freezes (cold boot) here or nautilus hangs (reboot).

3.a) If nautilus hangs: Open a terminal with Ctrl+Alt+T and kill nautilus with xkill.
3.b) If your desktop froze: Go to a virtual terminal with Ctrl+Alt+F1.
3.c) If you just get an error message: Open a terminal with Ctrl+Alt+T and go to step 4.

4. Execute 'mtp-detect' (from mtp-tools package) from terminal (either via Dektop or virtual terminal). If you get one of the following messages wait a few seconds and try again.

  $ mtp-detect
  Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.6

  Listing raw device(s)
  Device 0 (VID=0421 and PID=0661) is a Nokia Nokia Lumia WP8.
     Found 1 device(s):
     Nokia: Nokia Lumia WP8 (0421:0661) @ bus 2, dev 22
  Attempting to connect device(s)
  ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
  LIBMTP libusb: Attempt to reset device
  LIBMTP PANIC: failed to open session on second attempt
  Unable to open raw device 0
  OK.

---

  $ mtp-detect
  Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.6

  Listing raw device(s)
  Device 0 (VID=0421 and PID=0661) is a Nokia Nokia Lumia WP8.
     Found 1 device(s):
     Nokia: Nokia Lumia WP8 (0421:0661) @ bus 2, dev 22
  Attempting to connect device(s)
  PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
  LIBMTP libusb: Attempt to reset device
  LIBMTP PANIC: failed to open session on second attempt
  Unable to open raw device 0
  OK.

---

Repeat this until you get a long list of scrolling text that ends with something similar to this:

  MTP-specific device properties:
     Friendly name: Windows Phone
     Synchronization partner: (NULL)
     Battery level 74 of 100 (74%)
  libmtp supported (playable) filetypes:
     Folder
     Text file
     ISO MPEG-1 Audio Layer 3
     Audio Video Interleave
     JPEG file
     Microsoft Windows Media Audio
     Advanced Audio Coding (AAC)/MPEG-2 Part 7/MPEG-4 Part 3
     Microsoft Windows Media Video
     Abstract Album file
     Abstract Playlist file
     GIF bitmap file
     JFIF file
     Portable Network Graphics
     TIFF bitmap file
     BMP bitmap file
     MPEG-4 Part 14 Container Format (Audio+Video Emphasis)
     MPEG-4 Part 14 Container Format (Audio Emphasis)
     DOC file
     XLS file
     PPT file
  OK.

---

5. Go to a virtual terminal and do 'sudo service lightdm restart'. Login again, you hear the phone reconnecting to your computer and should now be able to open your phone in nautilus seeing the phones internal storage and the SD card (if there is) als sub devices.

6. Unplug the phone from the computer and start with step 2 if you want to connect the phone again.

## Additional information

$ lsb_release -rd
Description: Ubuntu 13.10
Release: 13.10

$ apt-cache policy gvfs gvfs-backends mtp-tools
gvfs:
  Installed: 1.18.2-0ubuntu1
  Candidate: 1.18.2-0ubuntu1
  Version table:
 *** 1.18.2-0ubuntu1 0
        500 http://de.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status
gvfs-backends:
  Installed: 1.18.2-0ubuntu1
  Candidate: 1.18.2-0ubuntu1
  Version table:
 *** 1.18.2-0ubuntu1 0
        500 http://de.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status
mtp-tools:
  Installed: 1.1.6-2
  Candidate: 1.1.6-2
  Version table:
 *** 1.1.6-2 0
        500 http://de.archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages
        100 /var/lib/dpkg/status
Comment 1 Valerio Ponte 2014-03-16 15:12:38 UTC
I can confirm the exact same behaviour happening on a Nokia Lumia 625
Comment 2 Ondrej Holy 2014-03-21 13:46:09 UTC
Thanks for you bug report.

Could you also provide stacktrace for gvfsd-mtp deamon?
Comment 3 Valerio Ponte 2014-03-22 16:59:26 UTC
Created attachment 272645 [details]
strace output obtained on mounting Nokia Lumia 625
Comment 4 Valerio Ponte 2014-03-22 16:59:59 UTC
Created attachment 272646 [details]
strace output obtained on writing Nokia Lumia 625
Comment 5 Valerio Ponte 2014-03-22 17:00:37 UTC
Created attachment 272647 [details]
gvfsd-mtp crash on unmount of Nokia Lumia 625
Comment 6 Valerio Ponte 2014-03-22 17:01:28 UTC
I could not reproduce the same behaviour described in the original bug report this time; generally it seems that what happens varies a bit (I've been able to froze nautilus just one time). 

Anyway, I still can't connect my Nokia Lumia 625 to my Ubuntu box. Here is what I have done this time:

1. Rebooted phone and computer
2. Logged in computer, logged in phone, locked phone screen
3. Connected the phone and the computer
4. Nautilus recognizes that there is a Nokia Lumia connected and mounts it
5. Attached strace to gvfsd-mtp process and redirected its output to strace-gvfsd-mtp.log
6. Opened Nokia Lumia mount in nautilus, here the first issue is evident: there is no file shown, while there should be several
7. Stopped strace and restarted it redirecting its output to strace-gvfsd-mtp-2.log
8. Tried to create a new directory, a nautilus error popup appears
9. Stopped strace

During my tests I mounted and unmounted my phone several times, but I never disconnected the cable. It happened once that on unmount gvfsd-mtp crashed, please find the apport crash file attached.

Finally, I am not sure if the files I provided are what you expected or not. If they are not feel free to ask more informations.
Comment 7 Ondrej Holy 2014-04-03 14:43:33 UTC
Thanks for the information, but I mean with stacktrace do backtrace in gdb (when it is frozen).

Don't know the mtp backend deeply, but it looks like libmtp bug to me if libmtp fails as you write in the first commit...
Comment 8 Valerio Ponte 2014-04-05 17:18:00 UTC
I think that the issues I have are slightly different from those that OP has.

By repeating the same step sequence that OP has I only once observed nautilus freezing. So I don't really know how to obtain a backtrace with gdb since I have no crash.

I still believe that this is the same issue though, since mtp-detect hangs for a few seconds and then output this

LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device

exactly as OP described.
Comment 9 benjaminosm 2014-06-26 09:50:39 UTC
Sorry for replying so late. I haven't found enough time for extensive testing, but with Ubuntu 14.04 I haven't experienced major issues fo far. Unless somebody else has reproducible similar issues, I would suggest closing this bug.
Comment 10 Ross Lagerwall 2014-06-26 17:01:18 UTC
OK, closing since the original issue is resolved. If anyone has issues running mtp-detect, I suggest filing a bug against libmtp.
Comment 11 benjaminosm 2014-09-26 07:20:08 UTC
Just a note for everyone who still has issues and finds this bug here: I couldn't mount my Lumia 620 after resetting and upgrading to 8.1 recently. I just received an update for the phone today (OS version: 8.10.14176.243) and it mounts instantly again on Ubuntu 14.04.

(Model: Nokia Lumia 620; Carrier: Telekom DE 205.09; Software: Windows Phone 8.1 Update; I am using the "Preview for Developers" program)