Bug 411489 - USB (MTP) connection to Android fails if Dolphin was running before plugging in
Summary: USB (MTP) connection to Android fails if Dolphin was running before plugging in
Status: CONFIRMED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: MTP (show other bugs)
Version: 22.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-01 10:04 UTC by Jens
Modified: 2024-03-14 06:19 UTC (History)
18 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens 2019-09-01 10:04:33 UTC
SUMMARY
On two computers, both running up to date KDE Neon 19.08.0, we have this situation.

STEPS TO REPRODUCE
1. With one or more Dolphin windows opened, plug your Android smartphone via USB (Samsung Galaxy S7 in our case).
2. Allow access on the device and click "Browse Files with File Manager" in the popup window.
3. Dolphin opens, but shows an error like "No media found. Check if the device is unlocked and MTP is enabled."

OTOH, if I close *all* Dolphin windows before plugging the USB cable in the smartphone and then plug it in and allow access *before* opening the next Dolphin window, access works fine and I can browse the SD card and the internal memory of the phone.

This may be libmtp related too, but I think the fact that Dolphin must not be running before plugging in the USB cable is a Dolphin issue, thus reporting to Dolphin.
Comment 1 Nate Graham 2019-09-04 17:44:47 UTC
Yep, can confirm.
Comment 2 equeim 2021-04-23 14:07:17 UTC
I have similar issue with 20.12.2 on Fedora 34, although it shows error about 'udi=/org/kde/solid/udev/...' file not existing instead.
Comment 3 Robby Engelmann 2021-08-17 18:03:34 UTC
I can confirm this issue using todays git-master versions of frameworks, plasma and gears under openSUSE Tumbleweed snapshot 20210816.
Comment 4 popov895 2021-08-23 10:39:22 UTC
I can no longer mount the MTP device even after restarting Dolphin.

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20210820
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
KDE Applications Version: 21.08.0
Qt Version: 5.15.2
Graphics Platform: X11
Comment 5 popov895 2021-08-23 18:54:27 UTC
(In reply to popov895 from comment #4)
> I can no longer mount the MTP device even after restarting Dolphin.

Hmm, I don't see this issue on the latest KDE neon live image. openSUSE only?
Comment 6 popov895 2021-08-25 21:30:06 UTC
(In reply to popov895 from comment #5)
> openSUSE only?
Yep, already fixed (https://bugzilla.opensuse.org/show_bug.cgi?id=1189687).
Comment 7 Harald Sitter 2022-01-07 12:52:20 UTC
Fixed recently
Comment 8 popov895 2022-01-07 15:18:57 UTC
Which commit?
Comment 9 S. Christian Collins 2022-03-05 15:46:38 UTC
This bug is still present as described by OP in Plasma 5.24.2 (frameworks 5.91.0, Qt 5.15.3). Two months ago, Harold Sitter said there was a fix, but no mention of which Plasma version.
Comment 10 equeim 2022-03-05 15:49:32 UTC
(In reply to S. Christian Collins from comment #9)
> This bug is still present as described by OP in Plasma 5.24.2 (frameworks
> 5.91.0, Qt 5.15.3). Two months ago, Harold Sitter said there was a fix, but
> no mention of which Plasma version.

I suspect that it depends on versions of other system components. In my experience, this bug is present on KDE Neon based on Ubuntu 20.04 but doesn't occur on latest Fedora version.
Comment 11 S. Christian Collins 2022-03-05 16:04:56 UTC
Yes, I am having the bug on KDE neon.
Comment 12 Jacky Cheong 2022-05-20 11:55:41 UTC
same
Comment 13 Jacky Cheong 2022-05-20 11:56:48 UTC
(In reply to Jacky Cheong from comment #12)
> same

btw I'm using fedora 36 // kernel 5.17.7 // kde plasma 5.24.5
Comment 14 heecks 2022-06-03 11:09:53 UTC
Issue still present in Kubuntu 22.04 :
KDE Plasma 5.24.4
KDE Frameworks 5.92.2
Qt 5.15.3 
Kernel 5.15.0-33
Comment 15 Subham Poddar 2022-12-25 03:48:51 UTC
When dolphin is opened , after which you connect the device (for me Samsung Galaxy M32) , it shows "Could not access device. Make sure it is unlocked, and tap Allow on the popup on its screen. If that does not work, make sure MTP is enabled in its USB connection settings." .
And after that even closing dolphin and reconnecting usb will not work , you have to restart the system , then connect usb then open dolphin to access android storage.

Bug still persist for :
Operating System: Arch Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 5.15.85-1-lts (64-bit)
Comment 16 Subham Poddar 2023-01-05 05:52:58 UTC
(In reply to Subham Poddar from comment #15)
> When dolphin is opened , after which you connect the device (for me Samsung
> Galaxy M32) , it shows "Could not access device. Make sure it is unlocked,
> and tap Allow on the popup on its screen. If that does not work, make sure
> MTP is enabled in its USB connection settings." .
> And after that even closing dolphin and reconnecting usb will not work , you
> have to restart the system , then connect usb then open dolphin to access
> android storage.
> 
> Bug still persist for :
> Operating System: Arch Linux
> KDE Plasma Version: 5.26.4
> KDE Frameworks Version: 5.101.0
> Qt Version: 5.15.7
> Kernel Version: 5.15.85-1-lts (64-bit)

Bug Still Persists for :-
Operating System: Arch Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 5.15.86-1-lts (64-bit)
Graphics Platform: X11
Comment 17 Bob Igo 2023-02-28 14:55:11 UTC
Bug remains in kio-extras 22.08.2, Kubuntu 22.10, Plasma 5.25.5
Comment 18 9d9dib4tv 2024-01-04 22:19:12 UTC
The bug perisists.  I am trying to access GrapheneOS on a Pixel 6 from Ubuntu 22.04 KDE/Plasma.  During the troubleshooting process, at different times I've gotten both of the errors 
> No storage media found.  Make sure your device is unblocked and has MTP enabled in its USB connection settings.`
and
> The file or folder udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 does not exist
in Dolphin.

I can confirm that if I close all running instances of Dolphin and wait for the system tray pop-up that appears when I plug the phone in, then the instance of Dolphin that starts when I click that pop-up is able to access the filesystem of the phone.  That's not a long-term workaround, though.  I have many ongoing projects at all times, and I need to have Dolphin windows open for most of them.  It is not reasonable to have to go multiple workspaces to close and later re-open and re-navigate each window every time I need to exchange files with my phone.

The `libusb` bug referenced in this [KDE bug](https://bugs.kde.org/show_bug.cgi?id=430606) on the topic and this [Mageia bug](https://bugs.mageia.org/show_bug.cgi?id=28216) was fixed in `libusb` v1.0.24; since my system (Ubuntu 22.04) has v1.0.25, it's most likely that the `libusb` bug is not the issue.

Can anything be done?

Ubuntu 22.04
KDE Plasma version: 5.24.7
KDE Frameworks version: 5.92.0
Qt version: 5.15.3
Kernel version: 6.2.0-37-generic (64-bit)
Graphics Platform: X11
`kio-extras`: 4:21.12.3-0ubuntu1
`libusb-1.0_0`: 2:1.0.25-1ubuntu2
`libmtp9`: 1.1.19-1build1
`mtp-tools`: 1.1.19-1build1
`jmptfs`: 0.5-3
Comment 19 Azure Number 2024-01-07 12:47:45 UTC
My workaround this bug:-

When bug appear giving error message "Could not access device. Make sure it is unlocked, and tap Allow on the popup on its screen. If that does not work, make sure MTP is enabled in its USB connection settings."  , first I open different folder in dolphin other than your MTP device folder, so I open click Home in Places of Dolphin. After that I open System Activity pressing Ctrl+esc , which shows System Activity window. Where I end the process called 'kiod5' , wait few seconds like 5 seconds or more. Then again click on the MTP device in dolphin , and I can easily access the storage of my smartphone.