Erasing NTFS formatted flash raises AttributeError: 'NoneType' object has no attribute 'get_cached_property'

Bug #1380041 reported by Vladimir Rutsky on 2014-10-11
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
usb-creator (Ubuntu)
Undecided
Unassigned
Trusty
Medium
Unassigned

Bug Description

When I'm trying to erase USB flash I'm get popup with following stack trace:

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'

To workaround this problem I've done:
1. Remove existing partition on flash drive in GParted.
2. Create new FAT32 partition for whole flash drive in GParted.
3. Unplug/plug flash drive.
4. Start usb-creator-gtk --- "Make Startup Disk" now active and works.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: usb-creator-gtk 0.2.56.2
ProcVersionSignature: Ubuntu 3.13.0-35.62-generic 3.13.11.6
Uname: Linux 3.13.0-35-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Oct 11 12:00:17 2014
InstallationDate: Installed on 2014-01-01 (282 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
SourcePackage: usb-creator
UpgradeStatus: Upgraded to trusty on 2014-04-27 (166 days ago)

Vladimir Rutsky (rutsky) wrote :
Vladimir Rutsky (rutsky) wrote :

This bug is similar to #1307622 (which is duplicate of #1300361), but in my situation USB flash had partition table.

Brian Murray (brian-murray) wrote :

This is already fixed in Vivid and Utopic:

 $ bzr log -r446 -p
------------------------------------------------------------
revno: 446
committer: Dimitri John Ledkov <email address hidden>
branch nick: usb-creator
timestamp: Tue 2014-07-22 18:37:18 +0100
message:
  Correctly detect partition-table less parent devices.
diff:
=== modified file 'bin/usb-creator-helper'
--- bin/usb-creator-helper 2014-07-20 21:47:41 +0000
+++ bin/usb-creator-helper 2014-07-22 17:37:18 +0000
@@ -46,6 +46,8 @@
     if obj.get_partition_table():
         return obj
     partition = obj.get_partition()
+ if not partition:
+ return obj
     parent = partition.get_cached_property('Table').get_string()
     return udisks.get_object(parent)

=== modified file 'debian/changelog'
--- debian/changelog 2014-07-20 21:47:49 +0000
+++ debian/changelog 2014-07-22 17:37:18 +0000
@@ -1,3 +1,9 @@
+usb-creator (0.2.60) UNRELEASED; urgency=medium
+
+ * Correctly detect partition-table less parent devices.
+
+ -- Dimitri John Ledkov <email address hidden> Tue, 22 Jul 2014 18:37:00 +0100

Changed in usb-creator (Ubuntu):
status: New → Fix Released
Changed in usb-creator (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → Medium

Hello Vladimir, 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: Triaged → Fix Committed
tags: added: verification-needed
Yu Ning (yuningdodo) wrote :

I tested on a trusty box, with usb-creator-{common,gtk} 0.2.56.3 I can erase the ntfs usbstick without popup error.

However there is one thing to mention, after the erasing it prompt "There is not enough free space for this image" and the "Make Startup Disk" button is inactivated. After another erasing now the button is activated and I can burn the ISO image successfully.

Anyway I think the issue is properly fixed, I'll update the tags for trusty.

tags: added: verification-done
removed: verification-needed
Vladimir Rutsky (rutsky) wrote :

I tested usb-creator-gtk 0.2.56.3 and can't reproduce this bug anymore, thanks!
But also I can see issue noted by Yu Ning: after first erasing usb-creator-gtk says that there is not enough free space on flash drive. Erasing second time helps.

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

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  Edit
Everyone can see this information.

Other bug subscribers