Created attachment 151131 [details] "Malformed URL" error message SUMMARY *** When connecting my phone in file transfer mode via USB, the Disks & Devices widget recognizes it, but when trying to open it in the file manager, the attached error message about a malformed URL appears. *** STEPS TO REPRODUCE 1. Connect a phone via USB and select data transfer mode in phone's connection settings 2. In Disks & Devices widgets, click "Open in File Manager" OBSERVED RESULT Error message "Malformed URL udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/." Device doesn't open. EXPECTED RESULT Device opens in file manager, same as when accessing it from Dolphin in Devices panel. ADDITIONAL INFORMATION Opening the device from Dolphin works. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.25.4 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5 Kernel Version: 5.18.16-arch1-1 (64-bit)
Cannot reproduce with my phone and git master everything KDE. Does the problem go away if you click "Allow" on your phone's screen before clicking the "Open in File Manager" button in the Disks & Devices popup.
(In reply to Nate Graham from comment #1) > Does the > problem go away if you click "Allow" on your phone's screen before clicking > the "Open in File Manager" button in the Disks & Devices popup. There is no "Allow" button on my phone to click. I only get the notification that it's connected, and when I tap on it to get to USB settings, I select "Data transfer" as the option before clicking the "Open in File Manager" button on my PC.
My phone is a Pixel 4a with Android 12.
Thanks. Maybe things are different in newer versions of Android. My crusty old phone is stuck on version 8.
If you put "mtp:" in front of the URL and enter that in Dolphin does it do something useful?
Please run "solid-hardware5 details udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/" and show the output
(In reply to Nicolas Fella from comment #5) > If you put "mtp:" in front of the URL and enter that in Dolphin does it do > something useful? Yes, this correctly opens the device in the same way the entry in the places panel does. > Please run "solid-hardware5 details udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/" and show the output > udi = 'udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/' > parent = '' (string) > vendor = '' (string) > product = '' (string) > description = '' (string) > icon = '' (string)
If I leave the 'udi=" part out in the command I get > udi = '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/' > parent = '/org/kde/solid/udev' (string) > vendor = 'Google' (string) > product = 'Pixel 4a' (string) > description = 'Pixel 4a' (string) > icon = 'multimedia-player' (string) > Block.major = 189 (0xbd) (int) > Block.minor = 16 (0x10) (int) > Block.device = '/dev/bus/usb/001/017' (string) > Camera.supportedProtocols = {'ptp'} (string list) > Camera.supportedDrivers = {'gphoto'} (string list) > PortableMediaPlayer.supportedProtocols = {'mtp'} (string list) > PortableMediaPlayer.supportedDrivers = {'usb'} (string list) >
Does running "kioclient5 exec mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//" work?
(In reply to Nicolas Fella from comment #9) > Does running "kioclient5 exec > mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//" > work? No, this gives me the same error dialog, and the following terminal output: > kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/mtp" not found > kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/mtp" not found > command= "/home/natalie/kde/usr/bin/dolphin" args= ("/home/natalie/kde/usr/bin/dolphin", "mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//") > kf.kio.core: Protocol Class of url QUrl("mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//") , isn't ':local', cancelling job. > Copying QUrl("mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//") to QUrl("file:///home/natalie/.cache/kioexec/krun/183392_0/unnamed")
I see you have dolphin built from source. Do you have kio-extras built too?
Ah, yes, I had totally forgotten I'm using source-built Dolphin as my default file manager on top of stable everything else. With the regularly installed version of Dolphin it works, so not a bug. Sorry for the confusion; I'll make sure to first test with vanilla Plasma next time.
No problem :) There is still something weird going on, so there may be a genuine bug somewhere that you uncovered What happens is roughly this: - Plasma calls kioclient5 exec mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2// - KIO (OpenUrlJob in particular) checks which app should be used to open mtp: URLs. The mtp worker for kio is provided by kio-extras, that's why I was asking whether that is installed - KIO doesn't find any app that handles mtp, so it decides to invoke Dolphin via kioexec. Not sure why, it probably shouldn't do that I can reproduce the error by running "~/kde/usr/lib64/libexec/kf5/kioexec ~/kde/usr/bin/dolphin mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//" Internally kioexec fails while copying the URL to a temp location. I can reproduce that with "kioclient cp mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2// ." Adding a slash between mtp: and udi= makes the error go away It looks like https://invent.kde.org/network/kio-extras/-/merge_requests/146 was supposed to fix that kind of thing, but perhaps that fix was incomplete
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/182
Actually what I was seeing was just the (confusing) error message when copying with a URL that has a wrong udi. I'm still not quite sure what triggered the exact error in your case
I have kio-extras built and start Dolphin with the prefix file, still getting the error, so probably I have something misconfigured. If the issue is only with my setup, I can live with opening the phone from Dolphin instead. Running "~/kde/usr/lib/libexec/kf5/kioexec ~/kde/usr/bin/dolphin mtp:/udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//" (with the slash) just gives me an error dialog > Could not read file with terminal output > command= "/home/natalie/kde/usr/bin/dolphin" args= ("/home/natalie/kde/usr/bin/dolphin", "mtp:/udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//") > kf.kio.core: Protocol Class of url QUrl("mtp:/udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//") , isn't ':local', cancelling job. > Copying QUrl("mtp:/udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2//") to QUrl("file:///home/natalie/.cache/kioexec/krun/335497_0/unnamed") > All files downloaded, will call slotRunApp shortly > No files downloaded -> exiting > kf.notifications: Playing audio notification failed: Destroyed Not sure how helpful this is.
Git commit befb9170bd8e565f52b7631f3c9d83581961f8af by Nicolas Fella. Committed on 06/08/2022 at 15:15. Pushed by nicolasfella into branch 'master'. [mtp] Improve error when trying to copy from/to a nonexistant mtp device If the device udi is not found we are currently throwing ERR_MALFORMED_URL, which is quite confusing because the URL is syntactically perfectly valid Instead use ERR_DOES_NOT_EXIST like we do for the other functions in that case M +7 -3 mtp/kio_mtp.cpp https://invent.kde.org/network/kio-extras/commit/befb9170bd8e565f52b7631f3c9d83581961f8af