I can connect with my Android device, browse and retreive files. When I copy a file to the device the copy progress bar appears but stops at 12 bytes. Thunar becomes unresponsive and afer a few minues a "libmtp error" message is displayed.
After that thunar is no longer usable. Even when starting a new instance it immediatley freezes. I checked with strace and it always freezes on a poll syscall. The only way to recover is a reboot.
This bug is 100% reproducable.
arch linux, libmtp 1.1.18-1, thunar 4.16.3-1
Edited
Designs
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
I experience the same thing on manjaro. But it seems to be dependendt on which file I try to copy. It ends up throwing a libmtp error and after that all files on the phone are not accessible until the phone is disconnected and reconnected. Also Thunar has to be killed before it can be used for anything.
I've not been able to see any pattern to which files that are triggering this problem. But I think it's a libmtp issue, not a Thunar issue. Although Thunars handeling of the libmtp error is not good. It would be far better if Thunar could close that window after the error. Having to kill all Thunar windows to recover from a libmtp error is not good.
Libmtp error.
call to ptp_mtp_getobjectpropssupported() failed..
Do you want to skip it?
[skip All] [Skip] [Retry] [Cancel]
If clicking Retry, the message goes away and after a while (minutes) comes back. In the meanwhile other Thunar windows can be used.
If clicking any other button, Thunar freezes. ONly thing that can be one to recover is to kill thunar or disconnect the phone (USB).
I tested this now by copy all my pictures/videos (15 GB) from phone internal storage to SD-card inserted in phone. I then tried to copy all these from SD to PC using Thunar while phone was connected via USB. The error came with the first video file larger than 500MB. The failing file was 519MB.
After disconnecting and reconnecting usb, deleting all files on pc, and redoing the copy from start, it failed at the same file. At this point 2,1GB of other files were copied successfully before the fail.
I then sorted the files by size and tried to copy the largest file (1,15 GB). That worked. I then tried the second largest file (1,14 GB), it failed.
I then tried to copy all files smaller that 20MB (248 files, all pictures, a few videos) - success.
I then tried to copy all files in the range 20-50MB - failed.
After disconnecting/reconnecting phone I tried to copy the files that had failed before, one by one. They all failed (I disconnected/reconnected phone between each file.)
Finally I took the SD card into the pc. Basically to see if the problem would be related to issues with the SD card. It managed to copy all files in one batch.
For copy I always use drag and drop between windows. Drag from main panel in one window, drop in main panel in another window.
Thunar uses gvfs to mount MTP devices. You could check if the bug is as well reproducable with gvfs via gio mount / gio copy on that large video file, and if so, report a bug there.
Though sure, even if the MTP part is to blame, it would be good if thunar would be more failsave.
After reading the comments I noticed that it only happens when I copy a file to internal storage. Copying the same file to the SD cards works, which made me suspicious. I tried from a windows machine and got the same problem. Rebooting my android device finally fixed the problem, so issue was not with libmtp.
Still, thunar should handle this error more gracefully. Freezing should not happen at all, and maybe the error message could be more helpful.
@linusma , same for you ? Does a reboot of the MTP device help ? If so, I would update the bug title and the description, in order to have all useful info on the first post.
Because of #510 (closed) I downgraded to kernel 5.9.16 (from 5.10.15). With this kernel I have not been able to replicate the issue. Phone has not been rebooted.
Still, the issue here, in terms of Thunar, is the handeling of the error. You should not need to kill Thunar when libmtp throws an error, whatever the reason for the error is.
With kernel 5.11.1-1-manjaro there is a very similar issue. Steps to reproduce:
Open a Thunar window showing a folder on the phone (internal storage). Choose a folder that contains enough files to make scrolling available.
Open a Thunar window showing a folder on pc
select multiple files on the phone. Drag and drop these files from phone to pc.
While the copy is in progress, try to scroll the window showing the files on phone.
Thunar will freeze, copy will stop. After a while libmtp error is thrown.
Only way to recover is to disconnect phone.
The interesting thing here is that if you don't scroll the window, copy will finish successfully.