Bug 593487

Summary: CryptoError: luks_close failed
Product: Red Hat Enterprise Linux 6 Reporter: Alex Williamson <alex.williamson>
Component: cryptsetup-luksAssignee: Milan Broz <mbroz>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 6.0CC: agk, atodorov, bburns, borgan, dwysocha, mbroz, prockai, pvrabec, syeghiay, tao
Target Milestone: betaKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cryptsetup-luks-1.1.1-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-02 18:57:22 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 Flags
error report
none
not some crazy xml format none

Description Alex Williamson 2010-05-18 22:13:41 UTC
Description of problem:

Installing to a system with a LUKS encrypted logical volume for home, anaconda asks for the passphrase, then crashes with the below backtrace.

<report><binding name="localhash">06c818d03e8cf22c647924bf402b40049795b82b815a246e22d8fe0a6764dafa</binding><binding name="description">The following was filed automatically by anaconda:
anaconda 13.21.39 exception report
Traceback (most recent call first):
  File "/usr/lib/anaconda/storage/devicelibs/crypto.py", line 120, in luks_close
    raise CryptoError("luks_close failed for %s" % name)
  File "/usr/lib/anaconda/storage/formats/luks.py", line 182, in teardown
    crypto.luks_close(self.mapName)
  File "/usr/lib/anaconda/storage/devices.py", line 1667, in teardown
    self.slave.originalFormat.teardown()
  File "/usr/lib/anaconda/storage/__init__.py", line 1293, in findExistingRootDevices
    device.teardown(recursive=True)
  File "/usr/lib/anaconda/upgrade.py", line 94, in findExistingRoots
    rootparts = findExistingRootDevices(anaconda, upgradeany=upgradeany)
  File "/usr/lib/anaconda/upgrade.py", line 81, in findRootParts
    flags.cmdline.has_key("upgradeany"))
  File "/usr/lib/anaconda/dispatch.py", line 205, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 126, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/gui.py", line 1348, in setScreen
    self.anaconda.dispatch.gotoNext()
  File "/usr/lib/anaconda/gui.py", line 1261, in nextClicked
    self.setScreen ()
CryptoError: luks_close failed for luks-94a3ee80-0366-41a9-9247-0802a4a50385

Full report to be attached

Version-Release number of selected component (if applicable):
RHEL6.0-20100512.0-Server-x86_64-DVD1.iso

How reproducible:
100%

Steps to Reproduce:
1. Attempt to install to a system with an existing volume group containing an encrypted logical volume
2.
3.
  
Actual results:
Fails

Expected results:
Success

Additional info:

Comment 1 Alex Williamson 2010-05-18 22:15:08 UTC
Created attachment 414976 [details]
error report

Comment 3 Bill Nottingham 2010-05-19 18:33:18 UTC
*** Bug 593671 has been marked as a duplicate of this bug. ***

Comment 4 Chris Lumens 2010-05-20 15:25:47 UTC
Can you please attach the /tmp/anaconda-tb-* file as plain text, not as some crazy xml format?

Comment 5 Alexander Todorov 2010-05-20 15:40:33 UTC
Chris,
does the attachment on the duplicate bug help:
https://bugzilla.redhat.com/attachment.cgi?id=415103

Comment 6 Alex Williamson 2010-05-20 15:56:18 UTC
Created attachment 415453 [details]
not some crazy xml format

Comment 7 David Lehman 2010-05-21 17:47:43 UTC
The error code from python-cryptsetup is -15 (-ENOTBLK).

This seems to be a general failure to close/unmap LUKS devices whose backing device is also a device-mapper device.

To reproduce, format any LV as LUKS. Activate the LV, run cryptsetup luksOpen to map it, then try to unmap it using cryptsetup luksClose. You will get a failure much like this:

  Device 253:0 doesn't exist or access denied.

Comment 8 Milan Broz 2010-05-21 19:00:44 UTC
I really wonder what I broke here... 
This should be covered by usptream regression tests.
Anyway, I can reproduce it in RHEL6.

Comment 9 Milan Broz 2010-05-23 14:31:09 UTC
Fixed upstream, POST for now.

Comment 10 Bill Burns 2010-05-24 17:44:14 UTC
*** Bug 594789 has been marked as a duplicate of this bug. ***

Comment 11 Milan Broz 2010-05-25 08:44:20 UTC
Fixed in cryptsetup-luks-1.1.1-1.el6.

Comment 13 David Cantrell 2010-05-27 15:58:34 UTC
*** Bug 596340 has been marked as a duplicate of this bug. ***

Comment 15 Alexander Todorov 2010-06-15 10:02:20 UTC
I've used the steps to reproduce from the duplicate bug and tested with 0610.n.0 tree. No traceback. Moving to VERIFIED.

Comment 17 releng-rhel@redhat.com 2010-07-02 18:57:22 UTC
Red Hat Enterprise Linux Beta 2 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.