Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2153593

Summary: Stratisd fails to read LUKS metadata on previously encrypted Stratis devices
Product: Red Hat Enterprise Linux 9 Reporter: Bryan Gurney <bgurney>
Component: stratisdAssignee: Bryan Gurney <bgurney>
Status: CLOSED ERRATA QA Contact: Filip Suba <fsuba>
Severity: unspecified Docs Contact:
Priority: high    
Version: 9.2CC: amulhern, cwei, dkeefe
Target Milestone: rcKeywords: Triaged
Target Release: 9.2Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: stratisd-3.4.3-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:41:19 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 Bryan Gurney 2022-12-14 20:23:58 UTC
Description of problem:
Stratisd 3.4.0 unconditionally requires a "pool_name" key in the LUKS token on an encrypted device, but the "pool_name" key is not present when the encrypted device was initialized by an earlier version of stratisd.

Version-Release number of selected component (if applicable):
stratisd-3.4.2-1.el9

How reproducible:
100%, when the affected pool was created with a stratisd version of 3.3 or earlier.

Steps to Reproduce:
1. Create a keyfile, saved in "testkey.txt", and set a key description for it:
# stratis key set --keyfile-path ./testkey.txt testkey1

2. Using an older version of stratisd (this was reproducible with stratisd-3.2.2-1.el9), and with a test block device (this example uses "/dev/vdb"), create an encrypted pool using the key description created in step 1:
# stratis pool create --key-desc testkey1 spool1 /dev/vdb

3. Stop the pool.
# stratis pool stop spool1

4. Stop the stratis daemon.
# systemctl stop stratisd

5. Update to the version of stratisd with the issue:
# dnf install stratisd-3.4.2-1.el9.x86_64.rpm stratis-cli-3.4.0-1.el9.noarch.rpm

6. Start stratisd.
# systemctl start stratisd

Actual results:
stratisd[32818]: [2022-12-14T18:38:28Z DEBUG stratisd::engine::strat_engine::backstore::crypt::shared] LUKS2 token in the Stratis token slot does not appear to be a Stratis token: Stratis token is missing key 'pool_name' or the value is of the wrong type.

Expected results:
The encrypted pool is able to be started with no issues, when provided by its pool UUID, and with the proper key description loaded in the kernel keyring (i.e.: the key description is visible when running "stratis key list":)

# stratis key list
Key Description
testkey1       

# stratis pool start --uuid fb6779af-0bf2-46f2-9f6d-247683e98854 --unlock-method keyring

Additional info:

Comment 4 Filip Suba 2023-01-09 10:00:35 UTC
Created pool using stratis-cli-3.2.0-1.el9, stratisd-3.2.2-1.el9.
# stratis pool create --key-desc testkey pool /dev/loop0
# stratis pool stop pool
# service stratisd stop
Installing stratis-cli-3.4.0-1.el9.noarch, stratisd-3.4.4-1.el9.x86_64   
Upgraded:
  stratis-cli-3.4.0-1.el9.noarch           stratisd-3.4.4-1.el9.x86_64          

Complete!
# service stratisd start
Redirecting to /bin/systemctl start stratisd.service

# stratis pool list --stopped
Name            UUID                                   # Devices   Key Description   Clevis
<UNAVAILABLE>   de388197-ff0d-46b1-849e-53bb6b19e359           1   testkey           N/A   
# stratis pool start --uuid de388197-ff0d-46b1-849e-53bb6b19e359 --unlock-method keyring

Comment 6 errata-xmlrpc 2023-05-09 07:41:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (stratisd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2272