Error erasing device: Unknown or unsupported erase type `'

Bug #1294877 reported by fcole90
314
This bug affects 89 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
Undecided
Unassigned
Trusty
Fix Released
Undecided
Unassigned
udisks
Invalid
Medium
udisks2 (Ubuntu)
Invalid
High
Unassigned
Trusty
Invalid
Undecided
Unassigned
usb-creator (Ubuntu)
Fix Released
High
Martin Pitt
Trusty
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * This bug is a runtime exception caused by invalid erase type.
 * With this bug users can not erase disks with usb-creator.

[Test Case]

 * Prepare an usbstick with any partition(s),
   this could be done with "gparted".
 * Launch usb-creator-gtk or usb-creator-kde.
 * Insert the usbstick, click the button "Erase Disk".
 * It will popup an exception window with the error message similar to:

        Traceback (most recent call last):
          File "format.py", line 7, in <module>
            block.call_format_sync('dos', GLib.Variant('a{sv}', {'erase': GLib.Variant('s', '')}), None)
        gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error erasing device: Unknown or unsupported erase type `'

 * Please be noted, the erase operation may still fail even with
   this bug properly fixed due to some other bugs, such as bug #1318954.

[Regression Potential]

 * Since the erasing operation is also blocked by other bugs,
   we may not be able to verify the entire erasing operation,
   in such a case we can not promise the effect of the patch,
   and it may (although not sure to) has other side effect such as:

[1]: http://udisks.freedesktop.org/docs/latest/gdbus-org.freedesktop.UDisks2.Block.html#gdbus-method-org-freedesktop-UDisks2-Block.Format

A dialog with the following text appears anytime I try to wipe my usb pen (both when partitioned and unpartitioned):

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}', {'erase': GLib.Variant('s', '')}), None)
gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error synchronizing after initial wipe: Timed out waiting for object

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: usb-creator-gtk 0.2.55
ProcVersionSignature: Ubuntu 3.13.0-17.37-generic 3.13.6
Uname: Linux 3.13.0-17-generic x86_64
ApportVersion: 2.13.3-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Mar 19 23:26:15 2014
InstallationDate: Installed on 2013-10-05 (165 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Beta amd64 (20131005)
SourcePackage: usb-creator
UpgradeStatus: Upgraded to trusty on 2013-12-10 (99 days ago)

Revision history for this message
fcole90 (fcole90) wrote :
Revision history for this message
In , Ma Hsiao-chun (mahsiaochun) wrote :

The following Python code

from gi.repository import GLib
from gi.repository import UDisks

udisks = UDisks.Client.new_sync(None)
dev = udisks.get_object('/org/freedesktop/UDisks2/block_devices/sdb')
block = dev.get_block()
block.call_format_sync('dos', GLib.Variant('a{sv}', {'erase': GLib.Variant('s', '')}), None)

results in either
Traceback (most recent call last):
  File "format.py", line 7, in <module>
    block.call_format_sync('dos', GLib.Variant('a{sv}', {'erase': GLib.Variant('s', '')}), None)
gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error erasing device: Unknown or unsupported erase type `'
or
Traceback (most recent call last):
  File "format.py", line 7, in <module>
    block.call_format_sync('dos', GLib.Variant('a{sv}', {'erase': GLib.Variant('s', '')}), None)
gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error synchronizing after initial wipe: Timed out waiting for object

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
IKT (ikt) wrote :

I didn't think it was possible but the software is now completely worthless.

Changed in usb-creator (Ubuntu):
importance: Undecided → High
Revision history for this message
Ivan Larionov (xeron-oskom) wrote :

AFAIK it related to bug #1012081

Revision history for this message
Tom Fields (udzelem) wrote :

Simliar message here:

"
org.freedesktop.DBus.Python.AttributeError: 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 218, in Format
    parent_dev = _get_parent_object(udisks, device)
  File "/usr/share/usb-creator/usb-creator-helper", line 49, in _get_parent_object
    parent = partition.get_cached_property('Table').get_string()
AttributeError: 'NoneType' object has no attribute 'get_cached_property'
"

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote : Re: usb-creator fails to wipe usb device when the device has ext4 partition

Ok I changed the title to what seems to be the case also in this bug's reported case.

To sum up my experiences:
- If you have no partition table, ie. whole USB stick formatted as a partition without a table (/dev/sdb mounted, not /dev/sdb1), you get bug #1300361 "'NoneType' object has no attribute 'get_cached_property'"
- If you have a normal ("old style") DOS partition table, but you have ext4 partition in there, you get this "Timed out waiting for object"
- It works if you have a USB stick with a partition table and the partition formatted with vfat

I've tested twice changing between ext4 and vfat so I can reproduce this bug too but also a workaround is to use mkfs.vfat (or a similar tool) to format the USB stick's partition to vfat format before starting the Startup Disk Creator.

summary: - usb-creator fails to wipe usb device
+ usb-creator fails to wipe usb device when the device has ext4 partition
Revision history for this message
Ara Pulido (ara) wrote :

Dimitri, can you have a look to this one, please?

Changed in oem-priority:
status: New → Triaged
Changed in usb-creator (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Well, imho the bug is with udisks2, can you also reproduce these bugs using "Disks" application? cause when udisks2 is asked to format something, it should, well, format it =)

Changed in usb-creator (Ubuntu):
assignee: Dimitri John Ledkov (xnox) → nobody
status: Confirmed → Invalid
Changed in udisks2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Camo Ninja (castinnett) wrote :

Hey guys I am having the same problem but I used Gparted to format the usb drive to fat32 then the start up disk creator worked fine!

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Dimitri ;-)

Same problem here. To answer your question: When trying to format using Disks, quick format is fine but zeroing leads to 'Error synchronizing after initial wipe: Timed out waiting for object (usdisks-error-quark, 0)'.

I guess this nominates this issue as a duplicate of lp:1294877.

Revision history for this message
George (3grciii) wrote :

Same problem exists with 32-bit architecture:

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}', {'erase': GLib.Variant('s', '')}), None)
gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error synchronizing after initial wipe: Timed out waiting for object.

IMHO udisks is broken. Exact same process works flawlessly under 12.04 with identical unmodified hardware. Disk utility in the current release is another example of this flawed behavior. Benchmarking works fine in 12.04 but udisks blows up spectacularly attempting the same process in more recent releases. This is one of the rare occasions I wish to go backwards.

Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in udisks2 (Ubuntu):
importance: Undecided → High
Changed in udisks:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Martin Pitt (pitti) wrote :

That's not a bug. As the error message says, an empty "erase" value is invalid, you need to specify a mode:

http://udisks.freedesktop.org/docs/latest/gdbus-org.freedesktop.UDisks2.Block.html#gdbus-method-org-freedesktop-UDisks2-Block.Format

Revision history for this message
Martin Pitt (pitti) wrote : Re: usb-creator fails to wipe usb device when the device has ext4 partition

That's not a bug in udisks. As the error message says, an empty "erase" value is invalid, you need to specify a mode:

http://udisks.freedesktop.org/docs/latest/gdbus-org.freedesktop.UDisks2.Block.html#gdbus-method-org-freedesktop-UDisks2-Block.Format

Changed in udisks2 (Ubuntu):
status: Confirmed → Invalid
Changed in usb-creator (Ubuntu):
status: Invalid → Confirmed
Martin Pitt (pitti)
Changed in usb-creator (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * Use "zero" erase type instead of the invalid "". (LP: #1294877)
  * Bump Standards-Version to 3.9.5, no changes necessary.
 -- Martin Pitt <email address hidden> Mon, 16 Jun 2014 11:20:04 +0200

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

I tested this on trusty, with the "zero" erase type it popups below messages several seconds after clicking the "erase" button.

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 241, in Format
    block.call_format_sync('dos', GLib.Variant('a{sv}', {'erase': GLib.Variant('s', 'zero')}), None)
gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error synchronizing after initial wipe: Timed out waiting for object

It has similar error messages if we modify the call_format_sync() line as below:

            block.call_format_sync('dos', no_options, None)

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

The "timed out waiting" one is bug 1318954, for the record.

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

Oh, thanks for the information.

Changed in udisks:
status: Confirmed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: usb-creator fails to wipe usb device when the device has ext4 partition

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

Changed in udisks2 (Ubuntu Trusty):
status: New → Confirmed
Changed in usb-creator (Ubuntu Trusty):
status: New → Confirmed
Ara Pulido (ara)
Changed in oem-priority:
status: Triaged → In Progress
Ara Pulido (ara)
Changed in udisks2 (Ubuntu Trusty):
status: Confirmed → Invalid
Yu Ning (yuningdodo)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

Thinking about this again, using "erase": "zero" might not actually be what we want here. For usb-creator it's not really necessary to actually write zeros over the entire device, just to clear up all partition and file system signatures. Hence this should rather call Format() with type=empty. If someone actually wants to cleanly wipe a device, then using Disks instead of usb-creator is certainly appropriate.

Changed in usb-creator (Ubuntu):
status: Fix Released → In Progress
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Yu Ning (yuningdodo) wrote :

Yes, I had also tried to use the type=empty in comment #16 (the last line), it should work.

Ara Pulido (ara)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

Note that there is an udisks2 bug here as well, but that's already tracked in bug 1059872.

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

There was a typo in the changelog, but this got fixed now by Martin (in 14.10 so far):

usb-creator (0.2.61) utopic; urgency=medium

  * Don't specify an erase type. Using "zero" will take an awfully long time,
    time out, and isn't necessary. (LP: #294877)
  * Revert "Ignore errors from synchronisations after wipefs calls". This
    udisks hack doesn't work (it now silently fails to format the device,
    instead of showing the error message), and won't stay in udisks.
    (See LP #1059872)
 -- Martin Pitt <email address hidden> Mon, 18 Aug 2014 12:51:13 +0200

Changed in usb-creator (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Oops, thanks Timo :)

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

I uploaded the fix to the trusty SRU review queue.

summary: - usb-creator fails to wipe usb device when the device has ext4 partition
+ Error erasing device: Unknown or unsupported erase type `'
Changed in usb-creator (Ubuntu Trusty):
status: Confirmed → In Progress
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Fabio, 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.2 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 :

I verified with usb-creator 0.2.56, my usbstick has dos partition table and two fat32 partitions, then I launch usb-creator-gtk, select the first partition and click "Eraase Disk", after a second or two, the partition is successfully erased, all files in the partition are erased as expected.

So I believe this issue is correctly fixed. I'll add the tag verification-done.

BTW, I also checked with these cases:

* when there is no partition table, bug #1300361 will be triggered

* when there is dos partition table but no partitions:

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

* when there is GPT partition table and partitions:

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 233, in Format
    part.call_set_type_sync('0x0c', no_options, None)
gi._glib.GError: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Given type `0x0c' is not a valid UUID

tags: added: verification-done
removed: verification-needed
Revision history for this message
Yu Ning (yuningdodo) wrote :

Bug #1361474 is filed for the second fail case in comment #29.

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

Bug #1361475 is filed for the third fail case in comment #29.

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

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

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

  * Drop invalid empty "erase" type. We don't need to erase the device (you
    can use "Disks" if you want that for some reason). Fixes "Unknown or
    unsupported erase type `' " failure. (LP: #1294877)
 -- Martin Pitt <email address hidden> Tue, 19 Aug 2014 07:46:20 +0200

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.

Revision history for this message
Jimmi Elofsson (jimmielofsson) wrote :

I get this

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

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

The timed out error should be a different issue, bug #1059872.

Revision history for this message
Bryan Pederson (haykeye13) wrote :

I still get this error with the new version 0.2.56.2.

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

@Bryan, could you please paste the error messages here?

Ara Pulido (ara)
Changed in oem-priority:
status: In Progress → Fix Released
Revision history for this message
Alexandros Prekates (aprekates) wrote :

i get this error in 2.56.2 in ubuntu 14.04

The stick has a ntfs partition .

The usb-creator should report the issue more clean.

'Hey! cant erase that stick!..'

Revision history for this message
Julian Klein (margin-auto) wrote :

With 14.04. and usb-creator-gtk version 0.2.56.2 i get the following error message:

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

Only after both deleting the parition table and reformatting the stick using fat32 it worked. It would be nice if usb-creator would offer these deleting and formatting automatically by itself

Revision history for this message
sudodus (nio-wiklund) wrote :

I'm glad that there is progress with usb-creator-gtk. Obviously there were several bugs. Now it works fairly well (except that there are problems with the erase function).

I made an alternative tool, mkusb, that easily wipes the traces from previous file systems as well as makes cloned copies of the iso files of many linux distros (all current Ubuntu flavours and versions except Ubuntu 12.04 LTS (Precise) mini.iso).

https://help.ubuntu.com/community/mkusb

mkusb is good for the standard case (using the pendrive to install a system), but it does not work to make a persistent live system. When you want persistence, usb-creator-gtk and Unetbootin will do the job. I have tested them recently, and they work for me.

Revision history for this message
Roger Peppe (rogpeppe) wrote :

This issue seems to marked as "fix released" under Trusty, but I am seeing the issue (or one
 very similar). I have a brand-new SSD drive that I've put into an external USB enclosure
and I am trying to install 14.10 onto it.

When I click on "Erase Disk" (the only apparently available option) after authorizing, I see
this error message:

org.freedesktop.DBus.Python.AttributeError: 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 218, in Format
    parent_dev = _get_parent_object(udisks, device)
  File "/usr/share/usb-creator/usb-creator-helper", line 49, in _get_parent_object
    parent = partition.get_cached_property('Table').get_string()
AttributeError: 'NoneType' object has no attribute 'get_cached_property'

Revision history for this message
Ewan (ewann) wrote :

Some variation of this(these?) bug(s?) still seems to exist on vivid. I landed here googling my original error message. While attempting to workaround / document it I now experience an error:

org.freedesktop.DBus.Python.GLib.Error: 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 274, in Format
    part.call_set_flags_sync(boot_dos_flag, no_options, None)
GLib.Error: udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error setting partition flags on /dev/sdb2: Command-line `parted --script "/dev/sdb" "set 2 boot off"' exited with non-zero exit status 1: Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes.
 (0)

WORKAROUND:
I was able to work around this for my case as described in http://askubuntu.com/questions/485357/unknown-error-from-startup-disk-creator - "right click on the .iso in the file explorer and select 'Open With Disk Image Writer' and then 'restore' the ISO image to the selected USB device."

Not sure if this comment really belongs in this bug or a new one

Revision history for this message
Tharakan (tharakan) wrote :

I can confirm that the bug exists (and has a simple workaround).
Mine is an updated UbuntuMate (15.04) and while trying to create a new Bootable USB pen drive got the same error. As mentioned elsewhere, opened up the pen drive in fdisk, removed all partitions, created one partition as 'c' type (VFAT ...), exit, mkfs.vfat /dev/sdb1. Now when I go back and create the bootable USB it works as expected.

My machine:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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