Thunar incorrectly thinks USB storage device hasn't finished ejecting

Bug #1762595 reported by halogen2 on 2018-04-10
100
This bug affects 18 people
Affects Status Importance Assigned to Milestone
gvfs (Arch Linux)
Fix Released
Undecided
Evangelos Foutras
gvfs (Ubuntu)
Status tracked in Cosmic
Bionic
High
Unassigned
Cosmic
High
Unassigned

Bug Description

[Impact]

 * This bug affects Thunar, and likely other file managers relying on udisks2.

 * When ejecting a USB disk, the disk ejects normally. However, Thunar does not detect that it was successfully ejected.

 * The "Writing data to device" notification will be displayed for some time.

 * Eventually, Thunar pops up an error dialog saying 'Failed to eject "<filesystem label>". Timeout was reached.'

 * Thunar will sometimes also exit at this point.

 * It has been determined that the upstream patch included in this upload resolves this error.

[Test Case]

 1. Mount a partition of a USB hard disk or flash drive.

 2. Using the eject button in the Thunar window sidebar, eject the mounted partition of the USB HDD.

 3. The disk will spin down and eject normally. The "Writing data to device" notification will be displayed until an error dialog saying 'Failed to eject "<filesystem label>". Timeout was reached.'

[Regression Potential]

 * Regression potential is very minimal. The patch is from upstream gvfs, contains a single line change, and applies only to the drive stopping event.

[Original Report]

$ lsb_release -rd
Description: Ubuntu 18.04 LTS
Release: 18.04

$ apt-cache policy thunar
thunar:
  Installed: 1.6.15-0ubuntu1
  Candidate: 1.6.15-0ubuntu1
  Version table:
 *** 1.6.15-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

Steps to reproduce:

1) Mount a partition of a USB harddisk

2) Using the eject button in the Thunar window sidebar, eject the mounted partition of the USB HDD.

3) After the USB HDD is ejected and spins down, unplug it
.

At (2), the disk ejects normally. But Thunar thinks it hasn't been ejected and is still trying to eject. The "Writing data to device" notification continues to display. Eventually, Thunar pops up an error dialog saying 'Failed to eject "<filesystem label>". Timeout was reached.' Sometimes Thunar will exit after this.

Same thing happens with some USB flash drives, so the bug can also be tested with a pendrive.

Launchpad Janitor (janitor) wrote :

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

Changed in thunar (Ubuntu):
status: New → Confirmed
description: updated
summary: - Thunar incorrectly thinks USB hard disk hasn't finished ejecting
+ Thunar incorrectly thinks USB storage device hasn't finished ejecting
description: updated
halogen2 (halogen2) on 2018-04-30
description: updated
description: updated
halogen2 (halogen2) wrote :

Some of my USB flash drives can be ejected by Thunar without hitting this bug. The description should not imply that it happens with all USB flash drives.

description: updated

On 30/04/18 19:09, halogen2 wrote:
> Some of my USB flash drives can be ejected by Thunar without hitting
> this bug. The description should not imply that it happens with all USB
> flash drives.
>
> ** Description changed:
>
> $ lsb_release -rd
> Description: Ubuntu 18.04 LTS
> Release: 18.04
>
> $ apt-cache policy thunar
> thunar:
>   Installed: 1.6.15-0ubuntu1
>   Candidate: 1.6.15-0ubuntu1
>   Version table:
>  *** 1.6.15-0ubuntu1 500
>         500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
>         100 /var/lib/dpkg/status
>
> Steps to reproduce:
>
> 1) Mount a partition of a USB harddisk
>
> 2) Using the eject button in the Thunar window sidebar, eject the
> mounted partition of the USB HDD.
>
> 3) After the USB HDD is ejected and spins down, unplug it
> .
>
> At (2), the disk ejects normally. But Thunar thinks it hasn't been
> ejected and is still trying to eject. The "Writing data to device"
> notification continues to display. Eventually, Thunar pops up an error
> dialog saying 'Failed to eject "<filesystem label>". Timeout was
> reached.' Sometimes Thunar will exit after this.
>
> - Same thing happens with USB flash drives, so the bug can also be tested
> - with a pendrive.
> + Same thing happens with some USB flash drives, so the bug can also be
> + tested with a pendrive.
>
I've seen Usb's not wanting to unmount/eject. Not seen the error message
- however

I've seen issues with partitions not wanting to unmount.

Further to this bug report - I checked another filemanager (pcmanfm) I
found that to just close - not good. Someone from Lubuntu is looking at
that - they were seeing very slow action after unmounting.

If that is the case - the bug is maybe somewhere else (gvfs perhaps)

I've got backtrace and strace ready for 'this' bug, got the same for
pcmanfm.

Spoken to one if the Xubuntu dev's re this bug.

slumbergod (slumbergod) wrote :

This bug happens when I try to unmount or eject all of my USB flash drives or USB external drives from Thunar. The error message notification pops up several minutes after I click eject or unmount and often the drive has already been removed.

ondondil (ondondil) wrote :

In my case this happens only when I eject USB drives. Unmounting works fine.
I couldn't reproduce the issue with pcmanfm. Using gio mount -e /path/to/usb doesn't return any errors.

Usually after several minutes I also get error message that says "Failed to eject "<filesystem label>". Timeout was reached."

Sometimes, about 30 minutes after ejecting the drive, thunar daemon segfaults. I sent the automatic crash report via apport.

Douglas H. Silva (o-alquimista) wrote :

I'm attaching the crash report whoopsie created after I was able to reproduce this bug.

Evangelos Foutras (foutrelis) wrote :

This is a bug in GVFS, already fixed by: https://gitlab.gnome.org/GNOME/gvfs/commit/38831e4e

(In Arch Linux, this is fixed with the gvfs 1.36.2-2 update.)

affects: thunar (Arch Linux) → gvfs (Arch Linux)
Changed in gvfs (Arch Linux):
assignee: nobody → Evangelos Foutras (foutrelis)
status: New → Fix Released
slumbergod (slumbergod) wrote :

And will anyone from the Xubuntu developers team be applying this update for Xubuntu 18.04 users?

Sean Davis (bluesabre) on 2018-06-24
no longer affects: thunar (Ubuntu)
Sean Davis (bluesabre) wrote :

Packaging debdiff to include the upstream patch

description: updated
Launchpad Janitor (janitor) wrote :

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

Changed in gvfs (Ubuntu Bionic):
status: New → Confirmed
Changed in gvfs (Ubuntu):
status: New → Confirmed
Martin Dauskardt (md001) wrote :

It's a shame that Ubuntu has still no fix released and even not assigned the issue to a developer.

I compiled gvfs for Ubuntu 18.04 (64 bit version) with the patch. It should be sufficient to change /usr/lib/gvfs/gvfs-udisks2-volume-monitor against the attached new binary.

slumbergod (slumbergod) wrote :

I've been trying the xubuntu experimental ppa to see if it has been fixed there but NO still present for me with or without that ppa.

Sean Davis (bluesabre) wrote :

Subscribing ~ubuntu-core-dev since gvfs is in main.

Sebastien Bacher (seb128) wrote :

Thanks for the work on getting that fix backported, it's on its way to cosmic and to the bionic SRU queue now

Changed in gvfs (Ubuntu Bionic):
importance: Undecided → High
Changed in gvfs (Ubuntu Cosmic):
importance: Undecided → High
Changed in gvfs (Ubuntu Bionic):
status: Confirmed → Fix Committed
Changed in gvfs (Ubuntu Cosmic):
status: Confirmed → Fix Committed
Robie Basak (racb) wrote :

I'd like confirmation from another SRU team member before accepting because of an edge case situation with versions that has arisen here. Details: https://irclogs.ubuntu.com/2018/07/04/%23ubuntu-devel.html (latest logs not appeared yet but they will).

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gvfs - 1.36.1-0ubuntu3

---------------
gvfs (1.36.1-0ubuntu3) cosmic; urgency=medium

  * d/patches/0010-add-missing-source-tag.patch:
    - Backport upstream patch for udisks2 to fix detection
      of an ejected USB device (LP: #1762595)

 -- Sean Davis <email address hidden> Sun, 24 Jun 2018 08:08:52 -0400

Changed in gvfs (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Martin Dauskardt (md001) wrote :

How long will it take to for 1.36.1-0ubuntu3 to appear in Bionic?
After
sudo apt-get update
sudo apt-get dist-upgrade
I get nothing.
sudo apt-get install gvfs says that gvfs is already the newest version (1.36.1-0ubuntu1).

Nish Aravamudan (nacc) wrote :

On Sat, Jul 7, 2018, 03:00 Martin Dauskardt <email address hidden> wrote:

> How long will it take to for 1.36.1-0ubuntu3 to appear in Bionic?
>

Well it won't -- please read https://wiki.ubuntu.com/StableReleaseUpdates
to understand the process.

Hello halogen2, or anyone else affected,

Accepted gvfs into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gvfs/1.36.1-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed verification-needed-bionic
halogen2 (halogen2) wrote :

Seems fixed by gvfs 1.36.1-0ubuntu1.1. Thanks!

(It required a reboot before the fix took effect.)

Michael Dooley (mdooley) wrote :

gvfs 1.36.1-0ubuntu1.1 seems to have fixed it in Ubuntu MATE 18.04. Thanks.

Kev Bowring (flocculant) wrote :

Changed bionic verification tag following comments #21, 22

tags: added: verification-done-bionic
removed: verification-needed-bionic
Freihut (freihut) wrote :

gvfs 1.36.1-0ubuntu1.1 tested on Xubuntu 18.04.
After ejecting USB-Drive with Thunar: USB-Drive not longer visible, "Writing data to device" notification disappeared after several seconds, no "Failed to eject [...] Timeout was reached." appeared. Works as intended now. Thanks!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gvfs - 1.36.1-0ubuntu1.1

---------------
gvfs (1.36.1-0ubuntu1.1) bionic; urgency=medium

  * d/patches/0010-add-missing-source-tag.patch:
    - Backport upstream patch for udisks2 to fix detection
      of an ejected USB device (LP: #1762595)

 -- Sean Davis <email address hidden> Sun, 24 Jun 2018 08:08:52 -0400

Changed in gvfs (Ubuntu Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for gvfs has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers