Bug 438478 - Device notifier shows SD card being inserted only once
Summary: Device notifier shows SD card being inserted only once
Status: RESOLVED DUPLICATE of bug 438874
Alias: None
Product: frameworks-solid
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-11 19:06 UTC by Oded Arbel
Modified: 2021-10-19 15:15 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Output from running journalctl while mounting a USB drive (8.54 KB, text/plain)
2021-07-28 23:16 UTC, bkimerer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2021-06-11 19:06:49 UTC
SUMMARY
When inserting an SD card to the computer, the device notifier system tray applet pops up and allow the user to mount the SD card. After taking the SD card out of the SD slot, if we put it in again - the device notifier does not show.

STEPS TO REPRODUCE
1. Insert an SD card to an SD card slot.
2. After the device notifier pops up, take the SD card out of the slot
3. Insert SD card back to the SD card slot.

OBSERVED RESULT
Nothing happens.

EXPECTED RESULT
The device notifier should show the SD card again.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.22.80
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
The SD card is listed correctly (when inserted) in Dolphin and can be mounted and ejected from there. Also the kernel log shows the device correctly attached and removed.

Here is the plasma shell log for the above reproduction:

---8<---
 SD card inserted (device notifier pops up):

Jun 11 22:03:31 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/drives/SC128_0x59b63c96" has new interfaces: ("org.freedesktop.UDisks2.Drive")
Jun 11 22:03:31 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/block_devices/mmcblk0" has new interfaces: ("org.freedesktop.UDisks2.Block", "org.freedesktop.UDisks2.PartitionTable")
Jun 11 22:03:31 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/block_devices/mmcblk0p1" has new interfaces: ("org.freedesktop.UDisks2.Block", "org.freedesktop.UDisks2.Filesystem", "org.freedesktop.UDisks2.Partition")
Jun 11 22:03:31 vesho plasmashell[157321]: kf.plasma.quick: Applet "Disks & Devices" loaded after 0 msec
Jun 11 22:03:31 vesho plasmashell[157321]: kf.plasma.quick: Increasing score for "Disks & Devices" to 100
Jun 11 22:03:31 vesho plasmashell[157321]: kf.plasma.quick: Applet "System Tray" loaded after 0 msec
Jun 11 22:03:31 vesho plasmashell[157321]: kf.plasma.quick: Applet "System Tray" loaded after 0 msec
Jun 11 22:03:31 vesho plasmashell[157321]: kf.plasma.quick: Increasing score for "System Tray" to 100
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.
Jun 11 22:03:32 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.

SD card removed:

Jun 11 22:03:35 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/block_devices/mmcblk0p1" lost interfaces: ("org.freedesktop.UDisks2.Filesystem", "org.freedesktop.UDisks2.Partition", "org.freedesktop.UDisks2.Block")
Jun 11 22:03:35 vesho plasmashell[157321]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:199: TypeError: Cannot read property 'Removable' of undefined
Jun 11 22:03:35 vesho plasmashell[157321]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:207: TypeError: Cannot read property 'Removable' of undefined
Jun 11 22:03:35 vesho plasmashell[157321]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:47: TypeError: Cannot read property 'File Path' of undefined
Jun 11 22:03:35 vesho plasmashell[157321]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:260: TypeError: Cannot read property 'Removable' of undefined
Jun 11 22:03:35 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/block_devices/mmcblk0" lost interfaces: ("org.freedesktop.UDisks2.PartitionTable", "org.freedesktop.UDisks2.Block")
Jun 11 22:03:35 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/drives/SC128_0x59b63c96" lost interfaces: ("org.freedesktop.UDisks2.Drive")
Jun 11 22:03:36 vesho plasmashell[157321]: kf.coreaddons: Overwriting existing cached entry due to collision.

SD card inserted again (device notifier not showing):

Jun 11 22:03:44 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/drives/SC128_0x59b63c96" has new interfaces: ("org.freedesktop.UDisks2.Drive")
Jun 11 22:03:44 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/block_devices/mmcblk0" has new interfaces: ("org.freedesktop.UDisks2.Block", "org.freedesktop.UDisks2.PartitionTable")
Jun 11 22:03:44 vesho plasmashell[157321]: kf.solid.backends.udisks2: "/org/freedesktop/UDisks2/block_devices/mmcblk0p1" has new interfaces: ("org.freedesktop.UDisks2.Block", "org.freedesktop.UDisks2.Filesystem", "org.freedesktop.UDisks2.Partition")
---8<---

The process can be reproduced after restarting plasmashell.
Comment 1 Oded Arbel 2021-06-11 19:17:48 UTC
In case it wasn't very clear - after inserting the SD card a second time, I can open the device notifier applet and the SD card is not showing.

I manually fixed the few QML error reported in the logs by adding `sdSource.data[udi] != undefined` in the appropriate places, but that did not fix the problem - so it is not caused by the QML issues.

The problem also happens only for SD cards on my system - USB disk behave as expected.
Comment 2 Nate Graham 2021-06-15 22:36:48 UTC
Can reproduce.

(In reply to Oded Arbel from comment #1)
> I manually fixed the few QML error reported in the logs by adding
> `sdSource.data[udi] != undefined` in the appropriate places
Ooh, that's nice. Would you mind submitting a merge request for it?
Comment 3 Oded Arbel 2021-06-17 10:08:59 UTC
(In reply to Nate Graham from comment #2)
> (In reply to Oded Arbel from comment #1)
> > I manually fixed the few QML error reported in the logs by adding
> > `sdSource.data[udi] != undefined` in the appropriate places
> Ooh, that's nice. Would you mind submitting a merge request for it?

Done: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/937
Comment 4 MikeC 2021-06-22 19:13:32 UTC
The same issue occurs for plugging in an external usb drive - the system tray popup window only offers to mount it once - no other usb drive is offered a mount once a drive has been umounted via the right click menu option from the dolphin drive list. Logging out and logging back in, allows a single external usb drive that is then plugged in to be mounted once only again.
Comment 5 MikeC 2021-06-22 19:16:42 UTC
In my case this bug appeared with Plasma 5.22.1-1 Frameworks 5.83.0-1 in Arch Linux.
Comment 6 Xwang 2021-06-22 19:19:42 UTC
I have the same issue.
Comment 7 Oded Arbel 2021-06-23 08:02:44 UTC
(In reply to MikeC from comment #4)
> The same issue occurs for plugging in an external usb drive - the system
> tray popup window only offers to mount it once - no other usb drive is
> offered a mount once a drive has been umounted via the right click menu
> option from the dolphin drive list.

If you are talking about seeing a mount option for a device that was just "ejected", then that is an old behavior - IIRC Plasma always ignored drives that were just ejected: you have to physically disconnect it and reconnect for it to show again.

This report is that for SD cards, even taking them out of the slot and putting them back it, won't show the mount option. And I can't reproduce this with USB thumb drive - these work for me by taking them out and plugging them back in.
Comment 8 Xwang 2021-06-23 11:01:03 UTC
(In reply to Oded Arbel from comment #7)
> (In reply to MikeC from comment #4)
> > The same issue occurs for plugging in an external usb drive - the system
> > tray popup window only offers to mount it once - no other usb drive is
> > offered a mount once a drive has been umounted via the right click menu
> > option from the dolphin drive list.
> 
> If you are talking about seeing a mount option for a device that was just
> "ejected", then that is an old behavior - IIRC Plasma always ignored drives
> that were just ejected: you have to physically disconnect it and reconnect
> for it to show again.
> 
> This report is that for SD cards, even taking them out of the slot and
> putting them back it, won't show the mount option. And I can't reproduce
> this with USB thumb drive - these work for me by taking them out and
> plugging them back in.

Up to some weeks ago, at least on my archlinux system, the sdcard was displayed and ready to be mounted again when I unmounted it without disconnecting it.

IMHO this is the correct behaviour.
You can unmount a device, but if it is still present, device notifier should show it and should permit to remount again.
Both for sd card and USB.
Comment 9 MikeC 2021-06-23 13:35:12 UTC
In my comment concerning usb drives - yes, it was selected to be unmounted, then physically disconnected, and then physically connected back in  - no pop-up offered a mount, and indeed going to the Disks and Devices option in the system tray also said that no devices were available to mount despite physical removal and reconnection - also if a completely different usb drive is plugged in at that point, then it also is not offered a mount, and cannot be seen by the Disks and Devices - so this is a reversion since it behaved perfectly well and correctly prior to the last update to the plasma desktop. So this is a bug that need to be fixed.
Comment 10 MikeC 2021-07-04 19:19:55 UTC
Prior to a commit to fix this bug, is there a work around that will allow more than one external drive to be mounted successively during a single login session? There are scenarios where it is highly desirable to be able to do so, such as running backups to several different external usn drives in succession.
Comment 11 MikeC 2021-07-04 19:47:31 UTC
This seems related to https://bugs.kde.org/show_bug.cgi?id=438874
Comment 12 MikeC 2021-07-09 15:36:55 UTC
With the update to kde-applications 21.04.3-1 this seems to be fixed.
Comment 13 Xwang 2021-07-09 19:25:51 UTC
I still have the issue with kde-applications 21.04.3-1
Comment 14 MikeC 2021-07-10 10:49:37 UTC
I was wrong - the bug is still there - but seems to depend on the partition structure of the drives being plugged in to usb. With two ssd usb drives, both with a single ext4 partition, the first is offered a mount via Disks & Devices that pops up when plugged in. Once unmounted, and physically removed, then when the second usb drive is plugged in the Disks & Devices does not pop-up and no mount is offered. However Dolphin sees the drive and it can be mounted from there.  On the other hand a usb thumb drive with two partitions on it does seem to get recognised for a second Disks a& Devices mount offer. So the bug is still there for me and needs to be fixed.
Comment 15 bkimerer 2021-07-28 23:16:18 UTC
Created attachment 140380 [details]
Output from running journalctl while mounting a USB drive
Comment 16 bkimerer 2021-07-28 23:24:26 UTC
I am seeing this on Mageia 9 development (Cauldron). 

For each login I get one notification, and after that the drives are ignored by the notifier.

My inxi info

System:    Host: BSKMageia Kernel: 5.13.6-desktop-1.mga9 x86_64 bits: 64 Desktop: KDE Plasma 5.21.5 Distro: Mageia 9 mga9 
Machine:   Type: Desktop Mobo: ASUSTeK model: P5G41T-M LX PLUS v: Rev X.0x serial: <superuser required> 
           BIOS: American Megatrends v: 0502 date: 10/21/2011 
CPU:       Info: Dual Core Intel Core2 Duo E7300 [MCP] speed: 2668 MHz 
Graphics:  Device-1: NVIDIA G94 [GeForce 9600 GT] driver: nouveau v: kernel 
           Display: x11 server: Mageia X.org 1.20.12 driver: loaded: nouveau,v4l resolution: 1920x1080~60Hz 
           OpenGL: renderer: NV94 v: 3.3 Mesa 21.1.5 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 
           Device-2: Realtek RTL-8100/8101L/8139 PCI Fast Ethernet Adapter driver: 8139too 
           Device-3: Qualcomm Atheros AR9271 802.11n type: USB driver: ath9k_htc 
Drives:    Local Storage: total: 465.76 GiB used: 40.03 GiB (8.6%) 
Info:      Processes: 179 Uptime: 1h 04m Memory: 3.84 GiB used: 1.25 GiB (32.5%) Shell: Bash inxi: 3.3.04 

I ran "journalctl -af" while I performed the following sequence after a clean login.

  Inserted the drive - the device notifier popped up.
  Mounted the drive and accessed it
  Unmounted the drive
  Inserted the drive again - the device notifier did not pup up
  Mounted the drive using udisksctl
  Accessed the drive
  Unmounted the drive using udisksctl

There are, errors in the log at the point where I unmounted the drive using the Device Notifier. The log reports qml errors coming out of devicenotifier around line 52 in the file. The file was attached in the previous post.

Maybe those error messages can help chase this down.
Comment 17 Nate Graham 2021-08-09 21:34:14 UTC
Seems to have the same root cause as Bug 438874.

*** This bug has been marked as a duplicate of bug 438874 ***
Comment 18 MikeC 2021-10-19 14:57:32 UTC
This is fixed in 5.23
Comment 19 Nate Graham 2021-10-19 15:15:18 UTC
Yes, the duplicate bug it's marked as is marked as fixed in 5.23. :)