Bug 2213325

Summary: "stratis pool list --stopped" results in ValueError exception raised if encryption information for a pool is inconsistent
Product: Red Hat Enterprise Linux 9 Reporter: Bryan Gurney <bgurney>
Component: stratis-cliAssignee: Bryan Gurney <bgurney>
Status: VERIFIED --- QA Contact: Filip Suba <fsuba>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.2CC: amulhern, cwei, dkeefe
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: stratis-cli-3.5.3-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 2023-06-07 20:11:02 UTC
Description of problem:
When displaying stopped pools, the encryption information
in the StoppedPools D-Bus property is unpacked in a manner that
unconditionally expects the structure that the value representing the
pools encryption status has if the
encryption information on the pool is consistent. This unpacking fails
with a ValueError and resulting stack trace if the encryption
information on the pool is inconsistent, as the structure  of the
value being unpacked in that
case is different.

Version-Release number of selected component (if applicable):
stratis-cli-3.5.2-1.el9

How reproducible:
100%

Steps to Reproduce:
1. Create a situation where encryption information on devices in a
single stopped Stratis pool is not consistent.

2. List the stopped pools: stratis pool list --stopped

3. Observe resulting stack trace with ValueError


Actual results:
Stack trace when listing stopped pools.

Expected results:
No stack trace when listing stopped pools.

Additional info:
There are various ways to generate the inconsistent encryption
information on devices within a stopped Stratis pool. Deterministic
techniques require using cryptsetup outside of Stratis to modify the
LUKS header on a device in a Stratis pool.

Comment 1 Bryan Gurney 2023-06-08 19:17:19 UTC
Posted CentOS Stream merge request:
https://gitlab.com/redhat/centos-stream/rpms/stratis-cli/-/merge_requests/17

Comment 5 Filip Suba 2023-07-03 08:25:07 UTC
Verified with stratis-cli-3.5.3-1.el9.