files
files copied to clipboard
files hang when selecting files on an android phone
What Happened?
files app hangs

Workaround
If you need your files from the android device, this is how you still can get them:
- create an archive from the files on android
- now you can just transfer this one file. i used cut - paste. when you select one file and try to drag - drop it, it will hang again
Steps to Reproduce
i want to copy files from an android 8 phone (mtp) to my NAS (SAMBA share)
- mount samba share
- open samba share folder in files app
- connect android phone
- navigate to files on android phone and select multiple files (32 in my case)
- ???
- files app hangs
the issue is always reproducible. here is a video https://youtu.be/G3FP3j3Rk10
Expected Behavior
programs should not hang
OS Version
Other Linux
NixOS unstable
Software Version
Latest release (I have run all updates)
Log Output
No response
Hardware Info
Xiaomi Redmi Note 4 with Android 8.1 (Lineage OS) Intel PC
When i pull the cable from the phone, the files app with the samba mount is responsive again.
I see this in journal:
Oct 02 20:22:57 gaming kernel: usb 1-8: USB disconnect, device number 8
Oct 02 20:22:57 gaming gvfsd[104365]: PTP: reading event an error 0x05 occurred
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: PTP Layer error 02ff: obj2file: call to ptp_mtp_getobjectpropssupported() failed.
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: Error 02ff: PTP I/O Error
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: PTP Layer error 02ff: Error getting friendlyname.
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: Error 02ff: PTP I/O Error
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: PTP Layer error 02ff: Error getting friendlyname.
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: Error 02ff: PTP I/O Error
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: PTP Layer error 02ff: Error getting friendlyname.
Oct 02 20:22:57 gaming gvfsd[104365]: Error 2: Error 02ff: PTP I/O Error
Oct 02 20:22:58 gaming .io.elementary.[111149]: DeviceRow.vala:88: Error querying filesystem info for 'mtp://Android_Android_cf72e0e20504/': No such interface “org.gtk.vfs.Mount” on object at path /org/gtk/vfs/mount/1
Oct 02 20:22:58 gaming gvfsd[104365]: Device 0 (VID=2717 and PID=ff48) is a Xiaomi Mi-2s (MTP).
Oct 02 20:22:58 gaming gvfsd[104365]: Android device detected, assigning default bug flags
Oct 02 20:22:58 gaming gvfsd[104365]: Received event PTP_EC_DevicePropChanged in session 1
Oct 02 20:22:58 gaming gvfsd[104365]: Received event PTP_EC_DevicePropChanged in session 1
So this is caused by android moint. I had similar issues in the past.
A similar issue:
When i just select one file from the android mount and try to drag and drop it to a local folder, the whole system is messed up. I can't click anywhere.
Here is a video: https://youtu.be/ky-Jco1MSAo
This is always reproducible.
There is an unresolved issue around re-opening Files after it has failed to open a certain location - Files tries to restore that location and may fail to open. At the moment the workaround is to turn "History" off in the settings and then make sure Files is closed with openable locations in the tabs before turning History on again.
I just tried DnD between an Android phone and the Files sidebar (which results in a file copy, not move) and that worked OK. I noticed that your video shows dragging between two Files windows so I will try that next.
Did not have a problem dragging an mp3 file from my phone to the home Music folder just now, using two windows.
Note that the phone was in "File Transfer" mode which give an address with the mtp:// protocol. I cannot tell from the video which protocol caused the issue.
After some testing in both "File Transfer" (mtp://) and "Picture Transfer" (ptp / gphoto2) modes copying of single picture and music files generally worked except that once I had a non-reproducible crash. If you can narrow down the circumstances you get the freeze (or do not get it) that would help. The journal messages suggest the problem is occuring in gvfs while in ptp mode. If there is an io error in the middle of a drag and drop operation then a major freeze is possible (not necessarily down to Files).
I think you had a lot more files on your phone than me. You could try turning off thumbnailing to reduce the amount of io going on during the operation.
I cannot tell from the video which protocol caused the issue.
i only used "File Transfer" (mtp)
copying of single picture and music files generally worked [...] If you can narrow down the circumstances you get the freeze (or do not get it) that would help.
it works to cut and paste a single file to another window
it does not work to drag and drop a single file to another window
it does not work to drag and drop multiple selected files to another window
can you try to open a folder on android that has many files, like 500? then select all and try to drag and drop them to another window (local folder). files will probably hang for a second, you might even get the warning. you can click wait there and transfer might start. it did for me now... it feels kind of unreliable, because in some cases, it does not work and files hangs completely and i have to attach the phone again
when i have a folder on android open with 500 files, many jpg, select all and then try to scroll down, it hangs. so might be related to thumbnails
why does all files windows hang when one is opening an external folder with a lot of files (e.g. 500)? can that be improved?
I think you had a lot more files on your phone than me. You could try turning off thumbnailing
yes. i can have the 500 files selected and scroll without hanging. thumbnails might be the issue here
I have another issue with thumbnails that might be related.
When i open a folder from an SD-Card (USB-Reader) with JPEG photos that are about 7MB and then select grid view, Files crash.

It reads every file to create thumbnails and that seem too much (IO or memory or whatever).
The issue is reproducible.
dmesg -T
[Wed Dec 8 03:43:50 2021] .io.elementary.[70562]: segfault at d8 ip 00007faf0f17b1b9 sp 00007ffd23c30ed0 error 6 in libpantheon-files-core.so.6.1.0[7faf0f141000+48000]
[Wed Dec 8 03:43:50 2021] Code: 4c 8b 40 08 31 c0 e8 06 a0 fc ff 48 8b 5d 28 48 85 db 74 3c 0f 1f 44 00 00 48 8b 3b 48 85 ff 0f 84 f1 a3 fc ff e8 6f a3 fc ff <c7> 80 d8 00 00 00 01 00 00 00 49 89 c4 48 89 c7 e8 42 64 fc ff 4c
[Wed Dec 8 04:29:29 2021] .io.elementary.[124141]: segfault at d8 ip 00007f3331acc1b9 sp 00007ffc07d12460 error 6 in libpantheon-files-core.so.6.1.0[7f3331a92000+48000]
[Wed Dec 8 04:29:29 2021] Code: 4c 8b 40 08 31 c0 e8 06 a0 fc ff 48 8b 5d 28 48 85 db 74 3c 0f 1f 44 00 00 48 8b 3b 48 85 ff 0f 84 f1 a3 fc ff e8 6f a3 fc ff <c7> 80 d8 00 00 00 01 00 00 00 49 89 c4 48 89 c7 e8 42 64 fc ff 4c
[Wed Dec 8 04:37:36 2021] .io.elementary.[130603]: segfault at d8 ip 00007f736fb0a1b9 sp 00007ffd483eb200 error 6 in libpantheon-files-core.so.6.1.0[7f736fad0000+48000]
[Wed Dec 8 04:37:36 2021] Code: 4c 8b 40 08 31 c0 e8 06 a0 fc ff 48 8b 5d 28 48 85 db 74 3c 0f 1f 44 00 00 48 8b 3b 48 85 ff 0f 84 f1 a3 fc ff e8 6f a3 fc ff <c7> 80 d8 00 00 00 01 00 00 00 49 89 c4 48 89 c7 e8 42 64 fc ff 4c
I have this coredump.
[root@gaming:~]# coredumpctl info 130603
PID: 130603 (.io.elementary.)
UID: 1000 (davidak)
GID: 100 (users)
Signal: 11 (SEGV)
Timestamp: Wed 2021-12-08 04:37:37 CET (10min ago)
Command Line: /run/current-system/sw/bin/io.elementary.files
Executable: /nix/store/vg2agj53pp4qq3b93wg38x6lmcnfdpqf-elementary-files-6.1.0/bin/.io.elementary.files-wrapped
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
Session: 2
Owner UID: 1000 (davidak)
Boot ID: c9da79142e9742b391c2cc1f1a982f3a
Machine ID: 7adea793c51646eb9781f0a4f62322d6
Hostname: gaming
Storage: /var/lib/systemd/coredump/core.\x2eio\x2eelementary\x2e.1000.c9da79142e9742b391c2cc1f1a982f3a.130603.1638934657000000.lz4 (present)
Disk Size: 8.8M
Message: Process 130603 (.io.elementary.) of user 1000 dumped core.
Here is the bachtrace:
(gdb) bt
#0 0x00007f736fb0a1b9 in ___lambda48__gasync_ready_callback () from /nix/store/vg2agj53pp4qq3b93wg38x6lmcnfdpqf-elementary-files-6.1.0/lib/libpantheon-files-core.so.6
#1 0x00007f736f7f4333 in g_task_return_now (task=task@entry=0x243e010) at ../gio/gtask.c:1219
#2 0x00007f736f7f4cab in g_task_return (task=0x243e010, type=<optimized out>) at ../gio/gtask.c:1289
#3 0x00007f736fb0828e in _vala_g_async_ready_callback () from /nix/store/vg2agj53pp4qq3b93wg38x6lmcnfdpqf-elementary-files-6.1.0/lib/libpantheon-files-core.so.6
#4 0x00007f736f7f4333 in g_task_return_now (task=task@entry=0x243e0d0) at ../gio/gtask.c:1219
#5 0x00007f736f7f4cab in g_task_return (task=0x243e0d0, type=<optimized out>) at ../gio/gtask.c:1289
#6 0x00007f736f7f583e in g_task_return (type=G_TASK_RETURN_ERROR, task=<optimized out>) at ../gio/gtask.c:1886
#7 0x00007f736f7f5a50 in g_task_return_new_error (task=task@entry=0x243e0d0, domain=domain@entry=291, code=code@entry=24, format=format@entry=0x7f736f8b07da "%s")
at ../gio/gtask.c:1919
#8 0x00007f736f847168 in send_message_data_deliver_error (task=0x243e0d0, domain=291, code=24, message=0x7f736f8b3bbd "Timeout was reached") at ../gio/gdbusconnection.c:1859
#9 0x00007f736f8471d0 in send_message_with_reply_timeout_cb (user_data=0x243e0d0, user_data@entry=<error reading variable: value has been optimized out>)
at ../gio/gdbusconnection.c:1901
#10 0x00007f736f9d1534 in g_timeout_dispatch (source=0x242d8b0, callback=<optimized out>, user_data=<optimized out>) at ../glib/gmain.c:4933
#11 0x00007f736f9d09af in g_main_dispatch (context=0x13e1cd0) at ../glib/gmain.c:3381
#12 g_main_context_dispatch (context=0x13e1cd0) at ../glib/gmain.c:4099
#13 0x00007f736f9d0d58 in g_main_context_iterate (context=context@entry=0x13e1cd0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#14 0x00007f736f9d0e0f in g_main_context_iteration (context=context@entry=0x13e1cd0, may_block=may_block@entry=1) at ../glib/gmain.c:4240
#15 0x00007f736f821485 in g_application_run (application=0x13f4140, argc=1212069204, argv=<optimized out>) at ../gio/gapplication.c:2569
#16 0x000000000042c02c in main ()
(the other 2 backtraces look similar)
"Timeout was reached") at ../gio/gdbusconnection.c:1859
Did it just take too long to read the files and reached a timeout which means the program completely crashes?
Files should only seek to thumbnail files that it is actually displaying (plus a few either side) rather than the whole folder. Might be worth creating the issue while running a system monitor to check what resources (memory etc) are being used.