Bug 1245854
Summary: | blivet.errors.DeviceFactoryError: invalid value NotImplemented for size | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Adam Williamson <awilliam> | ||||||||||||||||||||||||||
Component: | anaconda | Assignee: | Anaconda Maintenance Team <anaconda-maint-list> | ||||||||||||||||||||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||||||||||||||||||
Severity: | unspecified | Docs Contact: | |||||||||||||||||||||||||||
Priority: | unspecified | ||||||||||||||||||||||||||||
Version: | 23 | CC: | anaconda-maint-list, g.kaviyarasu, jonathan, vanmeeuwen+fedora | ||||||||||||||||||||||||||
Target Milestone: | --- | ||||||||||||||||||||||||||||
Target Release: | --- | ||||||||||||||||||||||||||||
Hardware: | x86_64 | ||||||||||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||||||||||
Whiteboard: | abrt_hash:155bee7654195e18f43a34bb8a4ba20e8d0ee8469e7fd5a5ce1350cf42286854 | ||||||||||||||||||||||||||||
Fixed In Version: | blivet-1.10-1 | Doc Type: | Bug Fix | ||||||||||||||||||||||||||
Doc Text: | Story Points: | --- | |||||||||||||||||||||||||||
Clone Of: | Environment: | ||||||||||||||||||||||||||||
Last Closed: | 2015-07-27 17:51:43 UTC | Type: | --- | ||||||||||||||||||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||||||||||||||||||
Documentation: | --- | CRM: | |||||||||||||||||||||||||||
Verified Versions: | Category: | --- | |||||||||||||||||||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||||||||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||||||||||||||||
Embargoed: | |||||||||||||||||||||||||||||
Attachments: |
|
Description
Adam Williamson
2015-07-23 00:56:04 UTC
Created attachment 1055126 [details]
File: anaconda-tb
Created attachment 1055127 [details]
File: anaconda.log
Created attachment 1055128 [details]
File: dnf.log
Created attachment 1055129 [details]
File: environ
Created attachment 1055130 [details]
File: lsblk_output
Created attachment 1055131 [details]
File: nmcli_dev_list
Created attachment 1055132 [details]
File: os_info
Created attachment 1055133 [details]
File: program.log
Created attachment 1055134 [details]
File: storage.log
Created attachment 1055135 [details]
File: syslog
Created attachment 1055136 [details]
File: ifcfg.log
Created attachment 1055137 [details]
File: packaging.log
This is failing somewhere in this block in PartitionSetFactory.configure(): log.debug("adding a %s with size %s", self.parent_factory.size_set_class.__name__, total_space) size_set = self.parent_factory.size_set_class(members, total_space) self.storage.size_sets.append(size_set) for member in members[:]: member = member.raw_device member.req_max_size = size_set.size custom.py _destroy_device() creates an LVMFactory which gets a child PartitionSetFactory, and it's while that child factory is getting configured that we hit the crash. We hit the "adding a %s with size %s" log.debug, but we don't hit a log.debug added just before the next step - so this seems to be where it explodes. Looking into it further. Hum, scratch that...must've messed up an updates.img. I found a better traceback in the anaconda-tb now: 21:21:35,652 CRIT anaconda: Traceback (most recent call last): File "/tmp/updates/blivet/devicefactory.py", line 794, in configure self._configure() File "/tmp/updates/blivet/devicefactory.py", line 1344, in _configure super(LVMFactory, self)._configure() File "/tmp/updates/blivet/devicefactory.py", line 818, in _configure self.child_factory.configure() File "/tmp/updates/blivet/devicefactory.py", line 1140, in configure self._post_create() File "/tmp/updates/blivet/devicefactory.py", line 933, in _post_create doPartitioning(self.storage) File "/tmp/updates/blivet/partitioning.py", line 550, in doPartitioning growPartitions(disks, partitions, free, size_sets=storage.size_sets) File "/tmp/updates/blivet/partitioning.py", line 1694, in growPartitions manageSizeSets(size_sets, chunks) File "/tmp/updates/blivet/partitioning.py", line 1598, in manageSizeSets chunk.reclaim(request, extra) File "/tmp/updates/blivet/partitioning.py", line 1077, in reclaim log.debug("reclaim: %s %d (%s)", request, amount, self.lengthToSize(amount)) File "/tmp/updates/blivet/partitioning.py", line 1358, in lengthToSize return sectorsToSize(length, self.sectorSize) File "/tmp/updates/blivet/partitioning.py", line 298, in sectorsToSize return Size(sectors * sectorSize) File "/tmp/updates/blivet/size.py", line 316, in __mul__ return Size(Decimal.__mul__(self, other)) File "/tmp/updates/blivet/size.py", line 277, in __new__ raise ValueError("invalid value %s for size" % value) ValueError: invalid value NotImplemented for size OK, so the problem is that when lengthToSize calls 'sectorsToSize(length, self.sectorSize)', length is a float. Here's a simple reproducer: from blivet.size import Size fl = float(1) sz = Size(1) Size(fl*sz) That raises an exception, and that's basically what's happening here. sectorsToSize gets hit a whole lot and almost always the type of the first param is int, and that works - but just on this path the type of the first param is float and it explodes. Now I get to figure out why the hell length is a float! This is fun, if by 'fun' you mean 'no fun at all'. Aha. OK. I got it. It's a py2 vs. py3 thing. The problem is here, in manageSizeSets: extra = -chunk.sizeToLength(needed) / len(ss.devices) in context, -chunk.sizeToLength is an int - in my test case it's 2162163712 - and so, obviously, will be len(ss.devices). Now, observe: [adamw@adam anaconda (master *%)]$ python2 Python 2.7.10 (default, Jun 29 2015, 16:02:04) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> type(2162163712/2) <type 'int'> >>> [adamw@adam anaconda (master *%)]$ python3 Python 3.4.3 (default, Jun 29 2015, 12:16:01) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> type(2162163712/2) <class 'float'> >>> i.e. in python2, 'int / int' returns an int. In python3, 'int / int' returns a float. I think the fix for this should be as simple as: - extra = -chunk.sizeToLength(needed) / len(ss.devices) + extra = -chunk.sizeToLength(needed) // len(ss.devices) *** Bug 1245446 has been marked as a duplicate of this bug. *** Merged by dlehman, will be fixed in next blivet. This is indeed fixed in TC2, openQA and manual testing confirm it. |