Bug 1244671 - [abrt] blivet-gui: blivet.errors.PartitioningError: Unable to allocate requested partition scheme. Traceback (most recent call last): File "/usr/lib/python3.4/site-packages/blivetgui/utils.py", line 967, in add_device blivet.partitioning.doPartit...
Summary: [abrt] blivet-gui: blivet.errors.PartitioningError: Unable to allocate reques...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-blivet
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vojtech Trefny
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:c3107eec63750c1638cfb0aa1eb...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-20 09:05 UTC by Jiri Konecny
Modified: 2015-08-27 17:58 UTC (History)
5 users (show)

Fixed In Version: 23.19.1-1.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-27 17:58:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1016 bytes, text/plain)
2015-07-20 09:05 UTC, Jiri Konecny
no flags Details
File: blivet-gui-com.log (25.56 KB, text/plain)
2015-07-20 09:05 UTC, Jiri Konecny
no flags Details
File: blivet-gui-tb (73.38 KB, text/plain)
2015-07-20 09:05 UTC, Jiri Konecny
no flags Details
File: blivet.log (38.56 KB, text/plain)
2015-07-20 09:05 UTC, Jiri Konecny
no flags Details
File: description (1.08 KB, text/plain)
2015-07-20 09:06 UTC, Jiri Konecny
no flags Details
File: environ (3.13 KB, text/plain)
2015-07-20 09:06 UTC, Jiri Konecny
no flags Details
File: program.log (7.38 KB, text/plain)
2015-07-20 09:06 UTC, Jiri Konecny
no flags Details

Description Jiri Konecny 2015-07-20 09:05:50 UTC
Description of problem:
When user create partition with all free space this traceback will raise.

How reporoducible:
Always

Steps to reproduce:
1) Click + to create partition
2) Set some Filesystem (for example ext4)
3) Leave used space slider to maximum
4) Confirm and crash will arise

Version-Release number of selected component:
blivet-gui-0.3.4-1.fc24.noarch

Additional info:
reporter:       libreport-2.6.0
blivet-gui.log: 
cmdline:        /usr/bin/python3  /bin/blivet-gui
executable:     /bin/blivet-gui
hashmarkername: blivet-gui
kernel:         4.0.7-300.fc22.x86_64
product:        Fedora
release:        Fedora release 22 (Twenty Two)
type:           Python
version:        22

Truncated backtrace:
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/blivetgui/blivetgui.py", line 409, in add_partition
    self._reraise_exception(result.exception, result.traceback)
  File "/usr/lib/python3.4/site-packages/blivetgui/blivetgui.py", line 227, in _reraise_exception
    raise type(exception)(str(exception) + "\n" + traceback)
blivet.errors.PartitioningError: Unable to allocate requested partition scheme.
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/blivetgui/utils.py", line 967, in add_device
    blivet.partitioning.doPartitioning(self.storage)
  File "/usr/lib/python3.4/site-packages/blivet/partitioning.py", line 549, in doPartitioning
    allocatePartitions(storage, disks, partitions, free)
  File "/usr/lib/python3.4/site-packages/blivet/partitioning.py", line 869, in allocatePartitions
    raise PartitioningError(_("Unable to allocate requested partition scheme."))
blivet.errors.PartitioningError: Unable to allocate requested partition scheme.

Comment 1 Jiri Konecny 2015-07-20 09:05:52 UTC
Created attachment 1053789 [details]
File: backtrace

Comment 2 Jiri Konecny 2015-07-20 09:05:54 UTC
Created attachment 1053791 [details]
File: blivet-gui-com.log

Comment 3 Jiri Konecny 2015-07-20 09:05:56 UTC
Created attachment 1053792 [details]
File: blivet-gui-tb

Comment 4 Jiri Konecny 2015-07-20 09:05:59 UTC
Created attachment 1053793 [details]
File: blivet.log

Comment 5 Jiri Konecny 2015-07-20 09:06:01 UTC
Created attachment 1053794 [details]
File: description

Comment 6 Jiri Konecny 2015-07-20 09:06:02 UTC
Created attachment 1053795 [details]
File: environ

Comment 7 Jiri Konecny 2015-07-20 09:06:03 UTC
Created attachment 1053796 [details]
File: program.log

Comment 8 Vojtech Trefny 2015-07-20 09:32:23 UTC
Changing to python-blivet and rawhide.

Reproducer for blivet:

----------------
import blivet
b=blivet.Blivet()
b.reset()

sdb = b.devicetree.getDeviceByName("sdb") # assuming sdb is an empty disk

free_regions = blivet.partitioning.getFreeRegions([sdb])
free_space = free_regions[0].length*free_regions[0].device.sectorSize
free_size = blivet.size.Size(free_space)

new_part = b.newPartition(size=free_size, parents=[sdb])
b.createDevice(new_part)
blivet.partitioning.doPartitioning(b)
----------------

Comment 9 Vojtech Trefny 2015-07-20 10:18:18 UTC
This is probably caused by this change in blivet -- https://github.com/rhinstaller/blivet/commit/a64a0ef72d6d1fdd72581a5ac0ff2306dbeb3fcc

Comment 10 David Lehman 2015-07-20 14:46:46 UTC
You'll have to either do the alignment yourself to get the maximum aligned partition size or specify the start and end sectors explicitly, like this:

free = blivet.partitioning.getFreeRegions([sdb])[0]
new_part = b.newPartition(start=free.start, end=free.end, parents=[sdb])

Comment 11 Vojtech Trefny 2015-07-21 11:21:31 UTC
(In reply to David Lehman from comment #10)
> You'll have to either do the alignment yourself to get the maximum aligned
> partition size or specify the start and end sectors explicitly, like this:
> 
> free = blivet.partitioning.getFreeRegions([sdb])[0]
> new_part = b.newPartition(start=free.start, end=free.end, parents=[sdb])

I can definitely do this in blivet-gui, but I still think blivet shouldn't fail in this situation -- the size is valid, just not aligned and blivet shouldn't align it to size larger than actually available free space.

Comment 12 David Lehman 2015-07-21 17:02:58 UTC
I think aligning the free region causes it to become smaller and no longer able to fit the partition (whose size is unchanged).

Comment 13 David Lehman 2015-07-21 17:04:31 UTC
I'm open to changing getFreeRegions so it returns aligned regions or perhaps raising a better exception in the current code. Changes to getFreeRegions will have to wait until blivet-2.0 since it changes API.

Comment 14 Fedora Update System 2015-08-22 16:25:35 UTC
anaconda-23.19.1-1.fc23, python-blivet-1.12.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update anaconda python-blivet'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-13831

Comment 15 Fedora Update System 2015-08-27 17:58:17 UTC
anaconda-23.19.1-1.fc23, python-blivet-1.12.1-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


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