[SRU] Error erasing device when there is dos partition table but no partition

Bug #1361474 reported by Yu Ning
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
usb-creator (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
High
Yu Ning

Bug Description

[Impact]
Unable to erase the device if there's a partition table but no partitions.

[Test Case]

Steps to reproduce:
1. prepare an usbstick with dos partition table but no partition, this can be done with gparted
2. erase the usbstick with usb-creator-gtk or usb-creator-kde

Expected result:
The usbstick is successfully erased (and a partition should be created)

Actual result:
An error message is popped up:

org.freedesktop.DBus.Python.gi._glib.GError: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/share/usb-creator/usb-creator-helper", line 239, in Format
    block.call_format_sync('dos', GLib.Variant('a{sv}', {}), None)
gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error synchronizing after initial wipe: Timed out waiting for object

[Regression Potential]

Should not affect negatively the normal use case (=usb stick with partition table, one partition vfat formatted).

Related branches

Yu Ning (yuningdodo)
information type: Proprietary → Public
affects: oem-priority → usb-creator
no longer affects: usb-creator
Revision history for this message
Yu Ning (yuningdodo) wrote :

I have proposed a patch which should fix this issue:
https://code.launchpad.net/~yuningdodo/usb-creator/usb-creator.lp1361474+lp1300361-recreate-udisks-client/+merge/232693

Will anyone give it a try?

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

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

Changed in usb-creator (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package usb-creator - 0.2.62

---------------
usb-creator (0.2.62) utopic; urgency=medium

  * Re-create the udisks client otherwise it will not return the newly
    created device or partition. (LP: #1361474, #1300361)
 -- Yu Ning <email address hidden> Fri, 29 Aug 2014 19:48:03 +0800

Changed in usb-creator (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Yu Ning (yuningdodo) wrote :

I believe we also need to backport this into trusty, however I don't find the url/button to "also affect" trusty, could anyone give me a hint please?

Revision history for this message
Martin Pitt (pitti) wrote :

Yu Ning, it's "Target to series", and I just approved the trusty task.

Revision history for this message
Yu Ning (yuningdodo) wrote :

Martin Pitt, thank you very much. For trusty I had proposed a patch about a month ago, although it's mixed with something for another patch, could you or anyone review it?

https://code.launchpad.net/~yuningdodo/ubuntu/trusty/usb-creator/usb-creator.lp1361474+lp1300361-recreate-udisks-client/+merge/232852

BTW, I still can't find the "Target to series" link on the page, weird.

Revision history for this message
Yu Ning (yuningdodo) wrote :

I just updated my patch for trusty to workaround the "timed out" issue.

usb-creator uses udisks2 to format the partition table, and udisks2 uses wipefs to erase the old partition table. However in trusty wipefs only support erasing partitions but not partition table. So instead of backporting the wipefs from utopic to trusty I think it's simpler to use parted to do the job directly in usb-creator.

With this update we no longer need util-linux to be backported.

Here is the patch:
https://code.launchpad.net/~yuningdodo/ubuntu/trusty/usb-creator/usb-creator.lp1361474+lp1300361-recreate-udisks-client/+merge/232852

Changed in usb-creator (Ubuntu Trusty):
importance: Undecided → High
description: updated
summary: - Error erasing device when there is dos partition table but no partition
+ [SRU] Error erasing device when there is dos partition table but no
+ partition
Changed in usb-creator (Ubuntu Trusty):
assignee: nobody → Yu Ning (yuningdodo)
status: New → In Progress
Revision history for this message
Yu Ning (yuningdodo) wrote :

Timo, thanks for assigning the bug to me, just to double confirm it, what am I supposed to do next? According to the wiki [1] now it's time to get some sponsors to upload the patch? Please let me know whatever I should do to get the job done, I'm so glad to have the chance to make usb-creator better, it's a very important tool to me.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The next step would be indeed getting a sponsor. I did the changes to the bugs so that they would be more ready for sponsoring, but a sponsor who is core-dev (can upload main packages) should be found. Practically everything needed from your/our side is done, other than answering possible future questions.

Revision history for this message
Brian Murray (brian-murray) wrote :

I've uploaded this to the trusty -proposed queue.

Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Yu, or anyone else affected,

Accepted usb-creator into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/usb-creator/0.2.56.3 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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Changed in usb-creator (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Yu Ning (yuningdodo) wrote :

Please ignore comment #12, it was for another bug.

Revision history for this message
Yu Ning (yuningdodo) wrote :

I made some tests on trusty with usb-creator-{common,gtk} 0.2.56.3.

1. create a usbstick with a GPT partition table but no partition
2. erase it with usb-creator-gtk

I can erase it without timed out error, but after the erasing it prompt "There is not enough free space for this image." and the "Make Startup Disk" button is inactivated. But if I erase it again now the prompt disappears and the button is activated, and I can burn the ISO image successfully.

So I think the issue is properly fixed. I'll update the tags for Trusty.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package usb-creator - 0.2.56.3

---------------
usb-creator (0.2.56.3) trusty-proposed; urgency=medium

  [ Brian Murray ]
  * udisks/backend.py: fix some calls to mount_sync that were missed in the
    port to the UDisks2 API. Thanks to Marc Culler for the patch.
    (LP: #1279987)

  [ Yu Ning ]
  * usb-creator-helper: use parent object only if there is a parent.
    (LP: #1380041)
  * usb-creator-helper: re-create the udisks client otherwise it will not
    return the newly created device or partition. (LP: #1361474, #1300361)
  * usb-creator-helper: use parted instead of udisks2 to create the new
    partition table since udisks2 uses wipefs to erase the old partition
    table, however partition table erasing is not supported in wipefs yet in
    trusty, and that would cause a timed out error.
 -- Brian Murray <email address hidden> Thu, 18 Dec 2014 14:48:14 -0800

Changed in usb-creator (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for usb-creator 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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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