Bug 854580

Summary: cannot populate devices with opened LUKS
Product: [Fedora] Fedora Reporter: Jan Safranek <jsafrane>
Component: python-blivetAssignee: David Lehman <dlehman>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 18CC: anaconda-maint-list, bcl, dlehman, g.kaviyarasu, jonathan, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-21 12:37:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Safranek 2012-09-05 11:24:05 UTC
Description of problem:
I use pyanaconda.storage module outside Anaconda installer. I have an encrypted partition, mounted somewhere.

storage.devicetree.populate() fails with traceback:

  File "anaconda_init.py", line 25, in <module>
    storage.devicetree.populate()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1856, in populate
    self._populate()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1970, in _populate
    self.addUdevDevice(dev)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1086, in addUdevDevice
    self.handleUdevDeviceFormat(info, device)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1667, in handleUdevDeviceFormat
    self.handleUdevLUKSFormat(info, device)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1164, in handleUdevLUKSFormat
    self.__passphrases)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 78, in getLUKSPassphrase
    raise RuntimeError("device is already mapped")

Version-Release number of selected component (if applicable):
anaconda-18.6.5-1.fc18.x86_64

How reproducible:
always

Steps to Reproduce:
1. cryptsetup luksOpen /dev/sda1 myLuks
2. try to populate storage.devicetree
  
Anaconda probably expects that it's running on 'unconfigured' system, where nobody opened LUKS device. If I 'luksClose /dev/mapper/myLuks', it starts working.

If Anaconda is to be used as storage library, this must be fixed.

Comment 1 David Lehman 2013-02-05 23:19:12 UTC
This is fixed in commit 086d80ce0de1660.

Comment 2 Jan Safranek 2013-10-21 12:37:27 UTC
This seems to be fixed in python-blivet-0.24-1.fc21.noarch (and probably also few releases before).