libmtp error could not get object handles

Bug #1810176 reported by Matt Sandefur
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
libmtp (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

When connecting my android galaxy s7 phone via usb, I am unable to access my Music folder, which contains 380 subfolders. The file manager is inactive for a long time, and finally displays the error:

Sorry, could not display all the contents of "Music": libmtp error: could not get object handles.

Adding one more subfolder on the android side seems to work around the issue, so the issue is related to the number of items.

Given this, my issue appears to be a specific example of the issue described in the link below.
https://sourceforge.net/p/libmtp/bugs/1808/

Observed in linux mint 18.3 64 bit / ubuntu 16.04

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in libmtp (Ubuntu):
status: New → Confirmed
Revision history for this message
Ricardo Gentil de Araújo Pereira (rhalah) wrote :

Similar error here.
Can copy file from Phone folder, but if I try to access Camera folder (inside DCIM folder), Nemo shows this error after some time processing.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, could you try on a recent Ubuntu verison (maybe from a liveCD) if that's still an issue?

Changed in libmtp (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
van hanegen (4997865862-o) wrote :

Just the same issue with my Galaxy C5 PRO, when i'm trying to get access to Сamera folder inside DCIM folder on the micro-sd card. Both with Ubuntu 16.04 and Ubuntu 18.04 (default nau managers)

Revision history for this message
Adalbert Hanßen (melolontha) wrote :

My cell phone is a Samsung Note 3 (SM-N9005) running Android 5.0.

Today I encountered the libtmp error message

Der Ordner »OpenCamera« konnte nicht geöffnet werden.
libmtp-Fehler: could not get object handles..

when trying to access

mtp://[usb:003,002]/Phone/DCIM/OpenCamera/

via USB. In my case I wanted to access a directory in the internal storage, not the one in the installed micro-sd-card.

I can access all pictures on mtp://[usb:003,004]/Card/DCIM/Camera/ and on message for mtp://[usb:003,004]/Card/DCIM/OpenCamera/.

According to Total Commander there are 380 picture files on /storage/emulated/0/DCIM/OpenCamera (this way the directory mtp://[usb:003,004]/Card/DCIM/OpenCamera/ is called there).

The internal memory of my cell phone is quite crowded at the moment: only 499 MB of 32GB are currently available.

Revision history for this message
van hanegen (4997865862-o) wrote :

It seems it got fixed somehow, and i can open folders on my phone's micro-sd card again

Revision history for this message
Gareth Evans (garethevans-9) wrote :

I am experiencing this problem on Ubuntu Mate 18.04.2 reading/writing the

/DCIM/Camera

folder on a Samsung Galaxy S5 mini with Android 6.0.1

The first ~250 of 550 jpg images copy successfully, then file the operation window freezes and does not respond to clicking the cancel button.

/var/log/syslog shows

Jul 15 03:24:41 xxxx gvfsd[3824]: Error 2: Error 02ff: PTP I/O Error
Jul 15 03:24:54 xxxx gvfsd[3824]: Error 2: PTP Layer error 02ff: LIBMTP_Get_Files_And_Folders(): could not get object handles.

When /DCIM/Camera/ is accessed, Caja navigation freezes, eventually producing the "could not get object handles" error.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for libmtp (Ubuntu) because there has been no activity for 60 days.]

Changed in libmtp (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Timo Bretten (t-bretten) wrote :

I am experiencing the same issue on Ubuntu Budgie 18.04.3 LTS bug when trying to copy .mp3 files via USB to an encrypted SD inside a Sony Xperia ZX2.

Revision history for this message
arash (arashfiroozi) wrote :

hello experiencing the same issue on ubuntu 20.04 lts bug when trying too see content of my music folder in sd card sumsung galexy m20

arash (arashfiroozi)
Changed in libmtp (Ubuntu):
status: Expired → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in libmtp (Ubuntu):
status: New → Confirmed
Revision history for this message
Chris (ezaquarii) wrote :

Experiencing the same problem on Ubuntu 20.04 when trying to copy files to DCIM/Camera folder on Android Samsung a20 device.

MTP is basically unusable.

Revision history for this message
Peter J (pj1803) wrote :
Download full text (4.3 KiB)

I have the same problem on Linux Mint 18.3 (Ubuntu derivitive). I could access files and folders except for the folder containing a whole lot of images. Error message was:

The folder contents could not be displayed.
Sorry, could not display all the contents of "Wallpaper" : libmtp error: could not get object handles.

I tried restarting the computer, and the phone independently - neither resolved the issue. After researching this issue, several people suggested that the number of files (in the folder) may be an issue.

This work-around resolved the issue for me: On my phone, I created a new folder at the same level as the problem folder, and moved 1 file from the problem folder to the new folder. I could then access the problem folder from my Linux machine. I copied some more files into the folder, and then moved the relocated file back into the previously problematic folder and could still access the folder. I then removed the newly created (and now empty) folder.

Ok. Some more information that may help resolve the problem:
There were 1788 files in the folder when I encountered the issue.
There were 1787 files in it after I moved 1 file and could access the folder.
There were 1816 files in the folder when I'd finished copying files (and it was still accessible).
The folder containing the files is a sub folder of another user created folder on the phone.

The libmtp components on my system are:
$ dpkg -l | grep libmtp
ii libmtp-common 1.1.10-2ubuntu1 all Media Transfer Protocol (MTP) common files
ii libmtp-dbg:amd64 1.1.10-2ubuntu1 amd64 Media Transfer Protocol (MTP) debugging symbols
ii libmtp-dev:amd64 1.1.10-2ubuntu1 amd64 Media Transfer Protocol (MTP) development files
ii libmtp-doc 1.1.10-2ubuntu1 all Media Transfer Protocol (MTP) library documentation
ii libmtp-runtime 1.1.10-2ubuntu1 amd64 Media Transfer Protocol (MTP) runtime tools
ii libmtp9:amd64 1.1.10-2ubuntu1 amd64 Media Transfer Protocol (MTP) library
ii libmtpserver-dev 0.0.4+15.04.20150219-0ubuntu3~gcc5.1 amd64 Library for implementing MTP protocol servers - development files
ii libmtpserver1 0.0.4+15.04.20150219-0ubuntu3~gcc5.1 amd64 Library for implementing MTP protocol servers - shared library

Other information that may help (though I suspect that this problem is not specific to this):
$ inxi -MSf
System: Host: pj1 Kernel: 4.15.0-106-generic x86_64 (64 bit) Desktop: Cinnamon 3.6.7
           Distro: Linux Mint 18.3 Sylvia
Machine: System: Gigabyte product: B250M-D...

Read more...

Revision history for this message
Stirling Joyner (sejoy) wrote :

The Mint workaround almost worked for me. I am also on 20.04. I moved a file out of my target folder and into a new folder on the same level. The files in both folders became accessible. I moved the file back into the original folder and the folder became inaccessible again. When I try to move any files from my computer into the target folder, the folder once again becomes inaccessible. After a few minutes of nothing happening, I get the message, "Error While Copying: There was an error creating the folder "folder_to_transfer". File not found". After that, if I leave the folder and go back in, I can no longer access the files. I get the same error I originally did: "Location could not be displayed: Sorry, could not display contents of "target_folder": libmtp error: could not get object handles of [hex]"

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

Other bug subscribers

Remote bug watches

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