Summary: | device notifier pretends it cannot mount usb device while actually mounting it | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Éric Brunet <eric.brunet> |
Component: | Disks & Devices | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andysem, brokencanoe, bugs.kde.attila, bugseforuns, cedric.devillers, chx1975, claudiolanconelli, dolgener, dorpmueller, d_tassos, ed.shornock, flateric, frederick888, gedakc, germano.massullo, gerrysw11, glutbugreports, hugh+kdebug, humufr, kde, luca.pedrielli, marco.gulino, mariusz.libera, mike.cloaked, nate, nicoadamo, notmart, notuxius, pip.kde, rdieter, slartibart70, spam, x, xwaang1976 |
Priority: | NOR | Keywords: | usability |
Version: | 5.12.2 | ||
Target Milestone: | 1.0 | ||
Platform: | Kubuntu | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/solid/d735708ff11c40ee6b9bee64544250d55067403f | Version Fixed In: | 5.46 |
Sentry Crash Report: | |||
Attachments: |
device notifier workaround
Requested dbus-monitor.log dbus-monitor log on Arch Linux, plasma 5.12.5 |
Description
Éric Brunet
2016-10-16 22:26:44 UTC
do the two computers use the same distribution/plasma version/distribution version? Same here, fedora 23, plasma 5.7.5 Happens most of the time when plugging in a usb3 stick into a usb2.0 port on a lenovo t420 laptop - this was working properly before the latest updates. As mentioned above, the error message appears but the stick is mounted properly. No such error messages when moutning/umounting on commandline without kde device notifier. (In reply to Marco Martin from comment #1) > do the two computers use the same distribution/plasma version/distribution > version? Both computers are fedora 23. One is up to date (plasma 5.7.5), the other not quite (plasma 5.7.3). But I have been experiencing this bug for a long time: it has been present for several version of fedora and of plasma. Unfortunately, I cannot say since when. Several times, I have simply waited for the next update, and was in the impression that the next update did fix it. (And maybe it has been fixed for some period of time?) But at some point the bug would reappear. As it doesn't occur every time, and as I don't use so often an external drive, it is hard for me to be precise. I'd like to confirm the same issue on openSuse 42.1, plasma 5.8.3 and qt 5.6.2. The bug is always reproducible. I also noticed that sometimes after a reboot it works for a while, but not everytime (and i don't reboot the laptop often). I've also had this issue for a while. Same issue on Arch with plasma 5.8.4, Qt 5.7, KDE Frameworks 5.28.0 Confirmed. I can reliably reproduce this, Arch Linux here as well and ready to help with debugging. I can confirm this bug is still present in 5.8.95. It get sometimes fixed after a reboot but not always. Today the problem appeared again after a resume from suspend. I'm not sure of what triggers the bug, but when it's present i have no way to make it go away. I can provide more technical information if you let me know where to look for thems. Hi ! Same issue under KDE Neon LTS, KDE Plasma 5.8.5, Framework 5.30.0. Can't reproduce in: Distribution: KDE neon Developer Edition - Stable Branches Plasma: 5.11.4 Frameworks: 5.41.0 Qt: 5.9.3 Kernel 4.10.0-40-generic Tried multiple times on different flash drives It still happens in OpenSuse 42.2 : Plasma : 5.11.95 Framework : 5.42.0 QT : 5.10.0 Kernel : 4.4.104 Note that after install, an upgrade or sometimes after a reboot it works. But after some times it breaks and stays broken until next upgrade. Note also that in my case this is a laptop and goes often on standby. I'm able to reproduce this on two different systems in Debian unstable with plasma 5.12.0. (In reply to ed.shornock from comment #11) > I'm able to reproduce this on two different systems in Debian unstable with > plasma 5.12.0. Additional info: If I try to mount the device in Dolphin I see a red error, stating "An error occurred while accessing 'Home', the system responded: The device is already mounted: Device /dev/sdl1 is already mounted at '/media/myuser/disk title'. The Device Notifier shows "You are not authorized to mount this device." but the device **is** mounted. It also shows the bar graph depicting the space used. The journal shows " systemd[1]: Started Clean the /media/myuser/disk title mount point" confirmed in debian buster plasma 5.10.5 kde framework 5.37.0 Qt 5.9.2 plasma 5.12.2 is affected on Arch Linux. this error is a bit annoying I tried to automount the devices on attach (with systemsettings removable device module) and a bit helps (In reply to Dr. Chapatin from comment #14) > plasma 5.12.2 is affected on Arch Linux. I can reproduce this bug when automount is disabled in "removable devices" kcm and two removable devices are available (CD/DVD/BD and pendrive, for example). *** Bug 391381 has been marked as a duplicate of this bug. *** I can confirm this behavior on debian testing, with KDE Frameworks 5.42.0, too. However: the fact that its probability of occurrence increased drastically after I switched to a more powerful workstation, suggests that this "Malformed URL" errors are some kind of timeout phenomenon. In other words, plasma seems to give up too early on a faster machine, when the ponderous USB device isn't quite ready yet. It might be helpful if plasma could wait some additional ~250 ms before throwing this error? Can confirm. (Manjaro, Plasma 5.12.2) Since last update this happens now on both my systems every time. When inserting a USB stick and choose the "open in file manager" in the device notifier I get the malfomed URL error, but the USB stick mounts anyway. If you choose it again it will open in dolphin as intended. There is no problem if you mount by clicking on it on the devices sidebar in dolphin. *** Bug 391717 has been marked as a duplicate of this bug. *** Still present in 5.12.3 on Archlinux. When using the device notifier and trying to mount and open the device with the option "Open with File manager". I am getting, if unmounted, an error message with the "Malformed URL". This bug is new to Fedora 27. Everything was fine before the latest update (couple of weeks ago). This bug is alwas reproducible on Fedora. Additional info: Even when I am using Dolphin and try to mount a partition on my harddrive which is not mounted, I get an error message inside of Dolphin. Please check my bug report (Bug 391717) which is marked as duplicate, because I believe that the symptoms of this bug here were different then my in the beginning (they are not excatly the same). Same here, Archlinux. Plasma 5.12.3 frameworks 5.44.0 applications 17.12.3 Very annoying bug. my experience in opensuse is that if subsequently I unmount the usb stick on the command line the "malformed URL" problem goes away - weird that it is cross-distro as otherwise I would suggest it is not a KDE problem. Not sure if is it related, but simultaneously with until recently I could hot plug a USB caddy containing a NTFS 1Tb hard drive (for lazy back up of "stuff") but now KDE doesn't like it - complaining that the file system is a problem Currently 5.12 or 5.44 plasma packages in Kubuntu 18.04. ===== I have this problem when trying to mount any removable device or internal disk partition, either from Dolphin or from removable device manager in panel. It always shows an error message when you try to mount the device first time, the device is not opened in Dolphin but it is mounted correctly. Then at the second attempt it does not show error message and device is opened in Dolphin. The messages that I get in Spanish: From Dolphin: "Ocurrió un error al acceder a «Carpeta personal», el sistema respondió: El dispositivo ya está montado: Device /dev/sdb3 is already mounted at `/media/yafu/PART 1'." From removable device manager in panel a window message titled "Error Cliente KIO ?" and "Formato de URL erroneo" message. By the way, in a recent Dolphin update, when you mount partitions from the small folder/home icon to the left of the Dolphin address bar (that icon only appears if you have Panels > Places disabled), every time you Mount a device from there that menu is filled enormously with "Umount <<Partition X>>" items. Really annoying. I have the same issue in archlinux. Additional info: I think I can explain this bug. The device notifier is trying to mount the USB-Device and calls immediately dolphin. At this time the USB-Device is still not mounted. The mount procedure is not done and Dolphin wants to show the mounted device. This is obviously a "timing" issue. In my opinion the device notifier MUST wait until the USB-Device is mounted before it calls Dolphin. One more thing: Before I click "Open with File Manager" I click on that little icon on the right side "Click to access this device from other applications". After that the USB-Device is mounted. Now I can click on "Open with File Manager" and Dolphin shows the USB-Device without any error message. (In reply to Attila from comment #27) > Additional info: > > I think I can explain this bug. The device notifier is trying to mount the > USB-Device and calls immediately dolphin. changing /usr/share/solid/actions/test-predicate-openinwindow.desktop Exec=kde-open5 "%f" in Exec=/bin/sleep 1; kde-open5 "%f" helps? Unfortunately it doesn't help (even sleep for 10 seconds), but you got me to try one more thing because I was curious. I have changed the line to Exec=/usr/bin/kdialog --msgbox "%f"; kde-open5 "%f" because I wanted to see what argument is passed to kde-open5. The result is that the argument is empty, when I click on "Open with File Manager" for the first time and the error message appears. When I click again on "Open with File Manager" the argument is like /run/media/MY_USER_NAME/dae9aaff-533c-40e0-ab5c-70d231620ad0/ and Dolphin shows the USB-Device without any error message. At this time the USB-Device is already mounted. I don't know anything about kde-open5. Does the call to mount a device happen in this application? Any idea? Can I try something else? (In reply to Attila from comment #29) > Unfortunately it doesn't help (even sleep for 10 seconds) I have done so many tests that can be confused, but here it seems to work ;) Exec=/bin/sleep 0.5; [ ! -z "%f" ] && kde-open5 "%f" if I receive an empty file name do nothing. > I don't know anything about kde-open5. Does the call to mount a device > happen in this application? No, I don't think. If you change Exec in Exec=/bin/sleep 10 devices are mounted anyway It only opens file or URL with right applications. ------------------------------------------------------------------- $ kde-open5 --help Usage: kde-open5 [options] urls... Command-line tool for network-transparent operations Arguments: url file or URL ------------------------------------------------------------------- I have changed the line to Exec=/bin/sleep 0.5; [ ! -z "%f" ] && kde-open5 "%f" When I click on "Open with File Manager" for the first time then nothing happens. That was the intention of [ ! -z "%f" ]. When I click on "Open with File Manager" for the second time then Dolphin shows the USB-Device without any error message but it doesn't solve the issue. In any case I have to click twice on "Open with File Manager" to see the USB-Device. By the way you are right. The call to mount a device doesn't happen in kde-open5. Questions: 1. What distribution do you have, because it seems to work on your machine? 2. Would you mind it to install Fedora 27 to give it a try? In this case you can easily commit and investigate this bug. I would appreciate any suggestion. (In reply to Attila from comment #31) > ...but it doesn't solve the issue. Sure, it's only a workaround( and it seems not working for all :( ) I'm only a simple user, not a dev. Debian testing Plasma 5.12.4 Kf 5.44.0 Qt 5.9.2 (In reply to luca from comment #32) > (In reply to Attila from comment #31) > Sure, it's only a workaround( and it seems not working for all :( ) > I'm only a simple user, not a dev. Sorry, I thought that you are a developer. I am a user too. TO THE DEVELOPERS OUT THERE: Could some one PLEASE take care of this bug, commit and fix it? It is so easy to reproduce it. PLEASE. (In reply to luca from comment #32) > (In reply to Attila from comment #31) > > ...but it doesn't solve the issue. > > Sure, it's only a workaround( and it seems not working for all :( ) > I'm only a simple user, not a dev. > > Debian testing > Plasma 5.12.4 > Kf 5.44.0 > Qt 5.9.2 I'm also using Debian testing/unstable and the sleep workaround doesn't work for me either. Setting Exec=[ ! -z "%f" ] && kde-open5 "%f" makes this slightly less annoying. I still have to click twice to access the mounted device but I don't get the error to click away (In reply to ed.shornock from comment #34) > > I'm also using Debian testing/unstable and the sleep workaround doesn't work > for me either. > not always working for me too :( https://github.com/storaged-project/udisks/issues/502 possibly relevant... (In reply to Paul from comment #36) > https://github.com/storaged-project/udisks/issues/502 > > possibly relevant... Good find! I rebuilt udisks2 without libmount enabled and this annoying bug has gone away. This is my workaround for those who don't want to recompile udisks2 on Fedora 27: I have downloaded this two rpm's for Fedora 26: - udisks2-2.6.5-4.fc26.x86_64.rpm - libudisks2-2.6.5-4.fc26.i686.rpm Then I did a downgrade in a "konsole" as root like this: dnf downgrade udisks2-2.6.5-4.fc26.x86_64.rpm libudisks2-2.6.5-4.fc26.i686.rpm This is it. Just plug in your USB-Device. You don't need to logout or reboot. It works immediately. Of course don't forget to exclude this two rpm's before you do an update or they will be updated and the bug is back. This is just a temporary solution. I can confirm this issue on the Kubuntu 18.04 development release, updated as of 2018-04-16. Additional information: $ policy udisks2 libudisks2-0 udisks2: Installiert: 2.7.6-2ubuntu6 Installationskandidat: 2.7.6-2ubuntu6 Versionstabelle: *** 2.7.6-2ubuntu6 500 500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages 100 /var/lib/dpkg/status libudisks2-0: Installiert: 2.7.6-2ubuntu6 Installationskandidat: 2.7.6-2ubuntu6 Versionstabelle: *** 2.7.6-2ubuntu6 500 500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages 100 /var/lib/dpkg/status KDE Frameworks: 5.44.0 Qt: 5.9.4 Locale: German ---------- As others have pointed out above, the Exec line does get rid of the error message, but forces me to click twice to mount the device (which is definitely preferable to having to deal with the error). I tried downgrading my udisks2 packages to 2.6.5-2ubuntu2, but ran into dependency issues and had to abort that experiment. A fix for this would be really appreciated. It seems to affect a significant number of installations and is very detrimental to the user experience. Having new users who have just installed their KDE distro of choice be presented with an error message like this after they've inserted their first USB device really doesn't shine a positive light on the DE, and might make some people second-guess their choice. Created attachment 112348 [details]
device notifier workaround
I've spend some time looking into this and found out that the issue is not with the Device Notifier itself but with Solid, or with how Solid interacts with Udisks. I don't really know what's the source of the bug but I've come up with a workaround that fixes Device Notifier (so far it's working as expected for me). If anyone wants to try it out, you have to rebuild plasma-workspace with the attached patch applied. It fixes only Device Notifier, mounting with Dolphin is still broken as it seems to be calling Solid in a different way.
Thank you for the patch! Patches in bug reports tend to get lost, so would you mind submitting it using Phabricator? http://phabricator.kde.org/ Here is the documentation: https://community.kde.org/Infrastructure/Phabricator Can one of you run " sudo dbus-monitor --system > someLogFile " reproduce the bug, and attach that here please. Created attachment 112354 [details]
Requested dbus-monitor.log
Here you are
Created attachment 112357 [details]
dbus-monitor log on Arch Linux, plasma 5.12.5
So reading that log: we mount at line 5871 that replies on line 6163 MountPoints emits it's property has changed on line 6965. after we've signalled setupDone on the solid side. Which maps perfectly to what Mariusz did in his workaround. Udisks Mount does actually return the mounted path on success, so udisks really isn't at fault it is. It's just that solid ignores that returned value as it listens to the PropertiesChanged signal, but then things get out of sync. I think patching solid is pretty feasible. For clarity my line numbers are against #43 Somewhat blind patch https://phabricator.kde.org/P202 against solid. It matches what the bug is, but I'm not able to test it. Could one of you? I've tested it with a couple of pendrives and an external usb drive, everything functions properly - accessing devices from Device Notifier and from Dolphin works without errors. Awesome work, thanks for fixing it. :) Your patch helped. It's a lot easier when someone explains a bug in a dev readable format. Will submit for review, thanks Git commit d735708ff11c40ee6b9bee64544250d55067403f by David Edmundson. Committed on 02/05/2018 at 12:48. Pushed by davidedmundson into branch 'master'. Update mount point after mount operations Summary: The order of udisks evaluation has changed from: call Mount propertiesChanged mount call returns call Mount mount call returns propertiesChanged The mount has finished, but the property is not yet updated. Solid caches properties, updating them when they change. This worked before but due to the re-ordering client code gets "setupDone" requests the mount point gets an outdated version from the cache and we get errors. Invalidating the cache causes us to round-trip to the udisks daemon meaning we'll have the correct values. Test Plan: Diagnosed but with dbus-monitor trace Asked someone on the bug report to test this Reviewers: #plasma Subscribers: #frameworks Tags: #frameworks Differential Revision: https://phabricator.kde.org/D12648 M +7 -0 src/solid/devices/backends/udisks2/udisksdevice.cpp M +1 -0 src/solid/devices/backends/udisks2/udisksdevice.h M +4 -4 src/solid/devices/backends/udisks2/udisksstorageaccess.cpp https://commits.kde.org/solid/d735708ff11c40ee6b9bee64544250d55067403f Patch was already applied on Arch Linux and the problem is really fixed. Thank you all. *** Bug 391386 has been marked as a duplicate of this bug. *** A quick note that this also occurs for external LUKS encrypted drives mounted via USB, - potentially the same bug. Will review in further releases. *** Bug 395065 has been marked as a duplicate of this bug. *** Kubuntu 18.04.3 LTS still has this annoying bug. solid version 5.44 There is nothing KDE can do about that. You should contact the Kubuntu people about it. See for example the related request for another Solid backport: https://phabricator.kde.org/T9525 For Kubuntu 18.04 users: I created a PPA that has the patch in post #50 applied to the current Kubuntu 18.04 solid package. See: https://launchpad.net/~gedakc/+archive/ubuntu/solid-1804-ppa In my testing the updated packages in my PPA did indeed fix the problem as described in this bug report. |