USB key eject does not eject

Bug #1993054 reported by corrado venturini
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-shell-extension-ubuntu-dock (Ubuntu)
In Progress
Low
Marco Trevisan (Treviño)
Jammy
New
Undecided
Unassigned
Noble
In Progress
Low
Marco Trevisan (Treviño)

Bug Description

I insert an USB key:
  icon appear in the dock and in the nautilus sidebar with title and a small arrow
right click on icon in the dock and select 'Eject':
  the icon disappear in the dock but does NOT disappear from the nautilus sidebar
click on the arrow near the icon in nautilus sidebar:
  the icon disappear and I see a message in notification area with: '... USB flash memory ... can be removed'

problem happens when org.gnome.shell.extensions.dash-to-dock show-mounts-only-mounted is set to TRUE
the problem does not occur if show-mounts-only-mounted is set to FALSE

ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: gnome-shell-extension-ubuntu-dock 74ubuntu2
ProcVersionSignature: Ubuntu 5.19.0-21.21-generic 5.19.7
Uname: Linux 5.19.0-21-generic x86_64
ApportVersion: 2.23.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sun Oct 16 09:48:16 2022
InstallationDate: Installed on 2022-09-30 (15 days ago)
InstallationMedia: Ubuntu 22.10 "Kinetic Kudu" - Beta amd64 (20220927.1)
PackageArchitecture: all
SourcePackage: gnome-shell-extension-ubuntu-dock
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
corrado venturini (corradoventu) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell-extension-ubuntu-dock (Ubuntu):
status: New → Confirmed
Changed in gnome-shell-extension-ubuntu-dock (Ubuntu):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Revision history for this message
corrado venturini (corradoventu) wrote :

Still same problem on Ubuntu 23.04 with gnome-shell-extension-ubuntu-dock: Installed: 79ubuntu1

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

So, by default in ubuntu we always show unmounted volumes, but I'm not sure if the logic is somewhat inverted here...

Revision history for this message
corrado venturini (corradoventu) wrote :

Yes the default is show unmounted volumes but I have many partitions on my disks so usually I change show-mounts-only-mounted to FALSE. I found the problem by accident on a fresh install where I hadn't made the change yet

Revision history for this message
corrado venturini (corradoventu) wrote :

Sorry for my post #5 I gave misleading info.
now I repeated the operation and found the problem only with show unmounted volumes NO, if all unmounted volumes are show eject from the dock works fine.
I ran again the test with show unmounted YES and NO and attaching both journals
show-no.txt and show-yes.txt

Revision history for this message
corrado venturini (corradoventu) wrote :

attaching journal with show-YES

Revision history for this message
corrado venturini (corradoventu) wrote :

Still same problem in Ubuntu 23.10 with gnome-shell-extension-ubuntu-dock: Installed: 81ubuntu1

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
https://iso.qa.ubuntu.com/qatracker/reports/bugs/1993054

tags: added: iso-testing
Changed in gnome-shell-extension-ubuntu-dock (Ubuntu):
importance: Undecided → Low
Revision history for this message
corrado venturini (corradoventu) wrote :
Download full text (5.4 KiB)

I did some tests for this problem:
all test with include unmounted volumes = NO

test1 - click eject on files does eject
test2 - click eject on dock does NOT eject, eject must be completed with eject on dock
test3 - click Unmount on dock does the same as Eject

-------------------------------------------------------------------

test1 --- click Eject on files --------------------------------

at [6820.172534] click Eject on files - eject completed

corrado@corrado-n2-nn-1115:~$ sudo dmesg -W
[sudo] password for corrado:
[ 6820.214188] evict_inodes inode 000000007a1f2b20, i_count = 1, was skipped!
[ 6820.214196] evict_inodes inode 000000004999f002, i_count = 1, was skipped!
[ 6820.214199] evict_inodes inode 00000000af46cbb1, i_count = 1, was skipped!
[ 6820.320984] sdc: detected capacity change from 30720000 to 0

corrado@corrado-n2-nn-1115:~$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[6820.172534] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc/sdc1 (block)
UDEV [6820.238892] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc/sdc1 (block)
KERNEL[6820.270341] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc (block)
KERNEL[6820.270641] remove /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc/sdc1 (block)
KERNEL[6820.271085] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc (block)
UDEV [6820.272584] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc (block)
UDEV [6820.273600] remove /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc/sdc1 (block)
UDEV [6820.275655] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc (block)

test2 --- click Eject on dock and then on files ------------

at [6474.305211] click Eject on dock - eject NOT done
at [6510.630651] click Eject on files - eject completed

corrado@corrado-n2-nn-1115:~$ sudo dmesg -W
[sudo] password for corrado:
[ 6474.342504] evict_inodes inode 0000000086a23104, i_count = 1, was skipped!
[ 6474.342508] evict_inodes inode 000000005caf6d28, i_count = 1, was skipped!
[ 6474.342509] evict_inodes inode 00000000a02ca119, i_count = 1, was skipped!
[ 6510.678411] sdc: detected capacity change from 30720000 to 0

corrado@corrado-n2-nn-1115:~$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[6474.305211] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc/sdc1 (block)
UDEV [6474.373867] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc/sdc1 (block)
KERNEL[6510.630651] change /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/host4/target4:0:0/4:0:0:0/block/sdc (block)
KERNEL[6510.630872] remove /devices/pci0000:00/0000:00:1...

Read more...

Revision history for this message
Victor (koshka--ru) wrote (last edit ):

I changed "this.cancellable" in lines 632 and 635 to "null" in the locations.js file and now everything works as it should

Revision history for this message
corrado venturini (corradoventu) wrote :

Done the same update to locations.js file and after reboot problem is solved.
Thanks a lot

Revision history for this message
corrado venturini (corradoventu) wrote :

still same problem with gnome-shell-extension-ubuntu-dock: Installed: 89ubuntu4

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Can you please check if doing something like this can provide some useful logging bits to journalctl /usr/bin/gnome-shell ?

diff --git a/locations.js b/locations.js
index 9795f3fd..8b19959c 100644
--- a/locations.js
+++ b/locations.js
@@ -447,6 +447,8 @@ class MountableVolumeAppInfo extends LocationAppInfo {
         });

         this._signalsHandler = new Utils.GlobalSignalsHandler();
+ print('Cancellable', this.cancellable, cancellable, 'cancelled', this.cancellable?.is_cancelled());
+ cancellable?.connect(c => logError(c, 'Cancellable cancelled'));

         const updateAndMonitor = () => {
             this._update();
@@ -629,12 +631,15 @@ class MountableVolumeAppInfo extends LocationAppInfo {
         const operation = new ShellMountOperation.ShellMountOperation(removable);
         try {
             if (action === 'mount') {
+ print(action, 'Cancellable', this.cancellable, 'cancelled', this.cancellable?.is_cancelled());
                 await this.volume.mount(Gio.MountMountFlags.NONE, operation.mountOp,
                     this.cancellable);
             } else if (action === 'unmount') {
+ print(action, 'Cancellable', this.cancellable, 'cancelled', this.cancellable?.is_cancelled());
                 await this.mount.unmount_with_operation(Gio.MountUnmountFlags.FORCE,
                     operation.mountOp, this.cancellable);
             } else if (action === 'eject') {
+ print(action, 'Cancellable', this.cancellable, 'cancelled', this.cancellable?.is_cancelled());
                 await removable.eject_with_operation(Gio.MountUnmountFlags.FORCE,
                     operation.mountOp, this.cancellable);
             } else {

Revision history for this message
corrado venturini (corradoventu) wrote :

sorry, I don't understand what I should do with the code you send me
run in terminal?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

No, no...

Just copy the content of https://paste.ubuntu.com/p/kdbxSDVSps/plain/ as /<email address hidden>/locations.js and restart the session.

Then attach here the content of

journalctl /usr/bin/gnome-shell

After the issue has shown

Revision history for this message
corrado venturini (corradoventu) wrote :

Done, ok?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

It was ok but I was missing a change, try with this https://pastebin.ubuntu.com/p/G4KpfFrTBt/plain/ ?

Revision history for this message
corrado venturini (corradoventu) wrote :

ok?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Mh, the trace gives me some info, but the weird thing is that I can't figure out when those calls such as eject_with_operation are happening... Let me try again if I can reproduce, otherwise maybe when you've time (next week though), ping me at @3v1n0:matrix.org so that maybe we can do some more interactive debugging :)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ok, found the reason finally and a way to reproduce...

Thanks for the logging and to the https://github.com/xairy/raw-gadget/tree/master/dummy_hcd kernel module that allowed me to simulate more USB storage devices (together with g_mass_storage) for better fine-tuning of their specs :)

Changed in gnome-shell-extension-ubuntu-dock (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.