Bug 325574 - Unable to modify file on Android device using kio-mtp
Summary: Unable to modify file on Android device using kio-mtp
Status: REOPENED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: MTP (show other bugs)
Version: 21.08.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Philipp Schmidt
URL:
Keywords: usability
: 383313 460784 466745 468241 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-03 08:03 UTC by muzuiget
Modified: 2023-04-10 17:39 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.08


Attachments
Interim-solution for mtp (987 bytes, text/plain)
2017-09-06 10:03 UTC, KarlheinzS
Details

Note You need to log in before you can comment on or make changes to this bug.
Description muzuiget 2013-10-03 08:03:40 UTC
When conncecting to an Android device with Dolphin via mtp protocol, I can't replace/rename/edit the file directly, Dolphin will show a alert dialog to me says like "Could not write to file". I need to delete the file then add back.

OS: Fedora 19 KDE 4.11.1
Android: Nexus 4, official Android 4.3 rom, and not rooted.
kio_mtp: Version 0.75 Release 2.20130323gitcc6b195.fc19
libmtp: Version 1.1.6 Release 0.fc19



Reproducible: Always
Comment 1 Jim Jones 2013-10-19 21:25:01 UTC
same here. can't rename,edit and replace
Comment 2 Jim Jones 2013-10-20 04:29:54 UTC
it also not possible to download files. it's only possible to upload files, folders work too but not in the root folder only in subfolders
Comment 3 Philipp Schmidt 2013-10-20 18:09:36 UTC
Sorry it took me so long. Can confirm it here. Hopefully my vacation at the end of the month will give me some time do delve into this ;).
Comment 4 Gus Gustafson 2015-06-22 15:24:45 UTC
Having this problem on Kubuntu 15.04.
Comment 5 skierpage 2016-07-14 22:26:30 UTC
Also failing on Kubuntu 16.04 with the backports PPA: 
Dolphin Version 15.12.3
Using:
* KDE Frameworks 5.23.0
* Qt 5.5.1 (built against 5.5.1)
* The xcb windowing system

There are two Device Notifier actions to "Open with File Manager". In the first if I navigate to Downloads Dolphin's location bar shows camera:/Motorola%2520Moto%2520X%2520(XT1058)@usb:001,004/store_00010001/Download/ . In the second it shows mtp:/XT1053/Internal storage/Download/

But with either URL I can't copy files to the device. Copying phone files from Download or DCIM/Camera to a folder on the computer works fine.

I also have KDE Connect installed, maybe it interferes.
Comment 6 Jajo 2017-01-19 10:48:11 UTC
Same issue here in Debian Unstable with my ASUS ZenFone 2
Comment 7 tesfabpel 2017-01-19 22:19:41 UTC
Also happens to me on ArchLinux 64bit with a Nexus 7 and a Nexus 5 (KDE Frameworks 5.30, Qt 5.7.1, Plasma 5.8.5 and Applications 16.12.1)
Comment 8 Alexander Mentyu 2017-08-18 13:34:30 UTC
Confirming this bug in:

Qt Version: 5.9.1
Frameworks Version: 5.36.0
Operating System: Linux 4.9.40-1-MANJARO x86_64
Distribution: "Netrunner Rolling"
Comment 9 KarlheinzS 2017-09-06 10:03:42 UTC
Created attachment 107713 [details]
Interim-solution for mtp

really kio-mtp crashes in dolphin when trying to connect to a device, even UBUNTU-Phone (p.ex. BQ-Aquaris 4.5).
!! my Interim-solution:
install nautilus + gnome-icin-theme-symbolic 
starting with nautilus i can connect to the device and get data.
not tested (i will test these days): 
to rename or to move a file.
to connect a android 6.x.
-->so, i think the problem is in dolphin.

user1@testkub:~$ locate mtp | grep lib | grep .so
/lib/modules/3.19.0-25-generic/kernel/sound/drivers/snd-mtpav.ko
/lib/modules/3.19.0-80-generic/kernel/sound/drivers/snd-mtpav.ko
/usr/lib/i386-linux-gnu/libmtp.so.9
/usr/lib/i386-linux-gnu/libmtp.so.9.1.0
/usr/lib/kde4/amarok_collection-mtpcollection.so
/usr/lib/kde4/kio_mtp.so
/usr/lib/kde4/kio_smtp.so
/usr/lib/libreoffice/share/config/soffice.cfg/cui/ui/applyautofmtpage.ui
/usr/lib/vlc/plugins/access/libaccess_mtp_plugin.so
/usr/lib/vlc/plugins/services_discovery/libmtp_plugin.so
/usr/share/apport/package-hooks/source_libmtp.py
user1@testkub:~$
Comment 10 KarlheinzS 2017-09-06 10:04:59 UTC
really kio-mtp crashes in dolphin when trying to connect to a device, even UBUNTU-Phone (p.ex. BQ-Aquaris 4.5).
!! my Interim-solution:
install nautilus + gnome-icin-theme-symbolic 
starting with nautilus i can connect to the device and get data.
not tested (i will test these days): 
to rename or to move a file.
to connect a android 6.x.
-->so, i think the problem is in dolphin.

user1@testkub:~$ locate mtp | grep lib | grep .so
/lib/modules/3.19.0-25-generic/kernel/sound/drivers/snd-mtpav.ko
/lib/modules/3.19.0-80-generic/kernel/sound/drivers/snd-mtpav.ko
/usr/lib/i386-linux-gnu/libmtp.so.9
/usr/lib/i386-linux-gnu/libmtp.so.9.1.0
/usr/lib/kde4/amarok_collection-mtpcollection.so
/usr/lib/kde4/kio_mtp.so
/usr/lib/kde4/kio_smtp.so
/usr/lib/libreoffice/share/config/soffice.cfg/cui/ui/applyautofmtpage.ui
/usr/lib/vlc/plugins/access/libaccess_mtp_plugin.so
/usr/lib/vlc/plugins/services_discovery/libmtp_plugin.so
/usr/share/apport/package-hooks/source_libmtp.py
user1@testkub:~$
Comment 11 postix 2021-11-24 16:08:37 UTC
Can confirm it on openSUSE TW (21.08.3) and for Android 12 (Pixel 4a). Does anyone know what the underlying issue is?
Comment 12 postix 2021-11-24 16:11:03 UTC
*** Bug 383313 has been marked as a duplicate of this bug. ***
Comment 13 Harald Sitter 2022-01-07 12:46:36 UTC
Two problems:

a) rename() is not correctly implemented so moving across folders does not work currently (probably should use LIBMTP_Move_Object but that requires substantial rejiggering of the existing code)
b) supposedly because of that             "moving": false, is set in the json definition (that is what disables the relevant actions in dolphin)
Comment 14 Jajo 2022-01-07 12:53:51 UTC
Just occuring to me I also commented on this. 
I'll try to replicate this now.
Comment 15 Harald Sitter 2022-11-16 07:37:13 UTC
*** Bug 460784 has been marked as a duplicate of this bug. ***
Comment 16 Bug Janitor Service 2023-03-23 10:01:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/235
Comment 17 Ben Bonacci 2023-03-26 10:21:04 UTC
*** Bug 466745 has been marked as a duplicate of this bug. ***
Comment 18 Harald Sitter 2023-03-31 12:34:16 UTC
Git commit 5c343d3d82d751e171f03745d695c872764f7edd by Harald Sitter.
Committed on 31/03/2023 at 10:09.
Pushed by sitter into branch 'master'.

mtp: support moving through get-put and increase concurrency to 2

this is a bit tricky. to support moving from one device to another
properly we need KIO to take control since doing it inside the worker is
exceptionally tricky with the current feature set. at the same time KIO
is a bit defective and presumes that it can have a concurrent getjob and
putjob running at the same time. to allow for that we now have 2 workers
instead of 1. technically they could be deadlocking each other,
practically they shouldn't because all the work is outsourced to the
kiod though anyway and thus getting multiplexed

M  +8    -0    mtp/kio_mtp.cpp
M  +2    -2    mtp/mtp.json

https://invent.kde.org/network/kio-extras/commit/5c343d3d82d751e171f03745d695c872764f7edd
Comment 19 Jim Jones 2023-04-10 13:26:06 UTC
i applied the patch on 22.12.3 and it's still not possible to move files between folders, as i get the following error before the operation would finish:

"Changing the attributes of files is not supported with protocol mtp."
Comment 20 Nate Graham 2023-04-10 17:39:02 UTC
*** Bug 468241 has been marked as a duplicate of this bug. ***