Bug 1095329 - AttributeError: 'NoneType' object has no attribute 'sectorSize'
Summary: AttributeError: 'NoneType' object has no attribute 'sectorSize'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-blivet
Version: 22
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: mulhern
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:d1a9b7a33c68dabe031ee2ce255...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-07 13:16 UTC by Igor Gnatenko
Modified: 2015-06-23 15:35 UTC (History)
7 users (show)

Fixed In Version: python-blivet-0.53
Clone Of:
Environment:
Last Closed: 2015-06-23 15:35:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: anaconda-tb (587.21 KB, text/plain)
2014-05-07 13:16 UTC, Igor Gnatenko
no flags Details
File: anaconda.log (17.48 KB, text/plain)
2014-05-07 13:16 UTC, Igor Gnatenko
no flags Details
File: environ (459 bytes, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: lsblk_output (2.84 KB, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: nmcli_dev_list (1.06 KB, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: os_info (381 bytes, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: program.log (51.72 KB, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: storage.log (177.84 KB, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: syslog (88.34 KB, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: ifcfg.log (1.53 KB, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details
File: packaging.log (198.01 KB, text/plain)
2014-05-07 13:17 UTC, Igor Gnatenko
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1095244 0 unspecified CLOSED AttributeError: 'NoneType' object has no attribute 'duplicate' 2021-02-22 00:41:40 UTC

Internal Links: 1095244

Description Igor Gnatenko 2014-05-07 13:16:51 UTC
Version-Release number of selected component:
anaconda-21.35-1

The following was filed automatically by anaconda:
anaconda 21.35-1 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/blivet/formats/disklabel.py", line 127, in dict
    "sectorSize": self.partedDevice.sectorSize,
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 701, in dict
    "format": self.format.dict, "removable": self.removable,
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 1694, in dumpState
    shelf[key] = [d.dict for d in self.devices]
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 371, in doIt
    self.dumpState("final")
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 170, in turnOnFilesystems
    storage.doIt()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/install.py", line 167, in doInstall
    turnOnFilesystems(storage, mountOnly=flags.flags.dirInstall)
  File "/usr/lib64/python2.7/threading.py", line 766, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 227, in run
    threading.Thread.run(self, *args, **kwargs)
AttributeError: 'NoneType' object has no attribute 'sectorSize'

Additional info:
cmdline:        /usr/bin/python  /sbin/anaconda
cmdline_file:   repo=http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/ initrd=http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/images/pxeboot/initrd.img BOOT_IMAGE=http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/images/pxeboot/vmlinuz 
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         3.15.0-0.rc4.git1.1.fc21.x86_64
product:        Fedora
release:        Cannot get release name.
type:           anaconda
version:        rawhide

Comment 1 Igor Gnatenko 2014-05-07 13:16:56 UTC
Created attachment 893261 [details]
File: anaconda-tb

Comment 2 Igor Gnatenko 2014-05-07 13:16:59 UTC
Created attachment 893262 [details]
File: anaconda.log

Comment 3 Igor Gnatenko 2014-05-07 13:17:02 UTC
Created attachment 893263 [details]
File: environ

Comment 4 Igor Gnatenko 2014-05-07 13:17:05 UTC
Created attachment 893264 [details]
File: lsblk_output

Comment 5 Igor Gnatenko 2014-05-07 13:17:07 UTC
Created attachment 893265 [details]
File: nmcli_dev_list

Comment 6 Igor Gnatenko 2014-05-07 13:17:10 UTC
Created attachment 893266 [details]
File: os_info

Comment 7 Igor Gnatenko 2014-05-07 13:17:12 UTC
Created attachment 893267 [details]
File: program.log

Comment 8 Igor Gnatenko 2014-05-07 13:17:17 UTC
Created attachment 893268 [details]
File: storage.log

Comment 9 Igor Gnatenko 2014-05-07 13:17:21 UTC
Created attachment 893269 [details]
File: syslog

Comment 10 Igor Gnatenko 2014-05-07 13:17:24 UTC
Created attachment 893270 [details]
File: ifcfg.log

Comment 11 Igor Gnatenko 2014-05-07 13:17:27 UTC
Created attachment 893271 [details]
File: packaging.log

Comment 12 mulhern 2014-05-08 13:14:34 UTC
There are two things that seem wrong here:

1) dumpState() is allowing this exception to propagate. It should catch and log at least all AttributeErrors.
2) Disklabel.dict() should not assume that partedDevice has been set, since the property explicitly allows None. labelType, partitions, and alignment are all properties which handle a missing partedDevice somehow. sectorSize() should be a property as well, since it is used in both dict() and __repr__().

No other problems are immediately obvious.

Comment 13 mulhern 2014-05-08 14:28:51 UTC
Note that many of the attributes listed rely on partedDisk, itself a property.

If partedDevice is None, partedDisk will propagate a parted.DiskException. This seems like the correct behavior.

Note that in this particular case partedDevice is None because there was an error when reading OpticalDevice /dev/sr0 "No medium found"

Comment 14 mulhern 2014-05-08 17:00:25 UTC
If no media can be found on the OpticalDevice then it should have the default format corresponding to None, not a Disklabel format, and so the code that actually throws the exception should not be executing. So there is an underlying bug.

The problem is that DeviceTree.updateDeviceFormat() is be invoked by anaconda, and it has no safeguards to prevent putting a format on the device if no media is present. In addUdevDevice() the safeguard exists.
Since handleUdevDeviceFormat is only called from these two places, it seems reasonable to put the safeguards in that method.

Comment 15 mulhern 2014-05-08 19:36:55 UTC
Reposted.

Comment 16 Jaroslav Reznik 2015-03-03 17:13:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22


Note You need to log in before you can comment on or make changes to this bug.