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 1855520 - Improve error handling on partial unlock failure of encrypted pools
Summary: Improve error handling on partial unlock failure of encrypted pools
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: stratis-cli
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: John Baublitz
QA Contact: guazhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-10 04:11 UTC by Dennis Keefe
Modified: 2021-09-06 15:22 UTC (History)
4 users (show)

Fixed In Version: 2.1.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 03:55:54 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4794 0 None None None 2020-11-04 03:56:04 UTC

Description Dennis Keefe 2020-07-10 04:11:55 UTC
Related to https://github.com/stratis-storage/stratis-cli/issues/618

setup

1. Create three key descriptions 
    stratis key set --capture-key fire
    stratis key set --capture-key water
    stratis key set --capture-key earth
2. Create three pools
    stratis pool create --key-desc fire p1 /dev/sdb
    stratis pool create --key-desc water p2 /dev/sdc
    stratis pool create --key-desc earth p3 /dev/sdd
3. reboot
4. Set only one key
    stratis key set --capture-key earth
5. Unlock pool
    stratis pool unlock

The result:
stratis-cli will try to unlock the first pool (p1) and will fail because the key
description is not available then exits without attempting to unlock the rest of
the pools. 

The result should be that stratis-cli should handle this better and continue to 
attempt to unlock the list of encrypted pools.

Comment 3 guazhang@redhat.com 2020-08-06 07:57:43 UTC
Hello

stratis --propagate key set --keyfile-path /tmp/new_key_devsdk test_key_devsdk
stratis --propagate pool create devsdk --key-desc test_key_devsdk /dev/sdk
stratis --propagate key set --keyfile-path /tmp/new_key_devsdl test_key_devsdl


INFO: [2020-08-06 03:31:30] Running: 'stratis pool list'...
Name                      Total Physical   Properties
devsdb   5.46 TiB / 53.77 MiB / 5.46 TiB      ~Ca, Cr
devsdk   5.46 TiB / 53.77 MiB / 5.46 TiB      ~Ca, Cr
devsdl   5.46 TiB / 53.77 MiB / 5.46 TiB      ~Ca, Cr

reboot 


stratis --propagate key set --keyfile-path  /tmp/new_key_devsdl test_key_devsdl

stratis --propagate pool unlock

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/stratis_cli/_main.py", line 43, in the_func
    result.func(result)
  File "/usr/lib/python3.6/site-packages/stratis_cli/_parser/_parser.py", line 87, in wrapped_func
    func(*args)
  File "/usr/lib/python3.6/site-packages/stratis_cli/_actions/_top.py", line 845, in unlock_pools
    raise StratisCliAggregateError("unlock", "pool", errors)
stratis_cli._errors.StratisCliAggregateError: The operation 'unlock' on a resource of type pool failed. The following errors occurred:
Partial action "unlock" failed for pool with UUID 88ca429d746d49a88c63cc7e73ba3385: Cryptsetup error: IO error occurred: Invalid argument (os error 22)
Partial action "unlock" failed for pool with UUID 28539b84cd4549e5b4ee488697ad423f: Cryptsetup error: IO error occurred: Invalid argument (os error 22)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/stratis", line 35, in <module>
    main()
  File "/usr/bin/stratis", line 32, in main
    return run()(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/stratis_cli/_main.py", line 60, in the_func
    raise StratisCliActionError(command_line_args, result) from err
stratis_cli._errors.StratisCliActionError: Action selected by command-line arguments ['--propagate', 'pool', 'unlock'] which were parsed to Namespace(func=<function add_subcommand.<locals>.wrap_func.<locals>.wrapped_func at 0x7f53d74680d0>, propagate=True) failed
devsdl   5.46 TiB / 53.77 MiB / 5.46 TiB      ~Ca, Cr
devsdl      /dev/dm-3          5.46 TiB   Data
[root@storageqe-24 ~]# stratis pool list
Name                      Total Physical   Properties
devsdl   5.46 TiB / 53.77 MiB / 5.46 TiB      ~Ca, Cr
[root@storageqe-24 ~]# stratis key list
Key Description
test_key_devsdl
[root@storageqe-24 ~]# rpm -qa |grep stratis
stratis-cli-2.1.1-6.el8.noarch
stratisd-2.1.0-1.el8.x86_64

cryptsetup-2.3.3-1.el8.x86_64
4.18.0-221.el8.x86_64

please have a look the error ?

Comment 4 John Baublitz 2020-08-06 13:46:02 UTC
Hello, this actually looks like it's doing what it's supposed to be doing. Based on the commands you've provided and the commands provided by Dennis for reproducing the behavior, the pool devsdl should now be unlocked while the other two should still be locked. When only one key is provided for three encrypted pools with different encryption keys, the CLI attempts to unlock each encrypted pool and will print out a message for each pool where the key has not been set in the keyring while successfully unlocking the pool whose key is set in the keyring. The steps Dennis provided would have stopped at the first error in the previous version of stratis-cli, but with the most recent version, it will try to unlock all devices and will report all devices that could not be successfully unlocked while unlocking the ones that can be successfully unlocked. Let me know if you need additional clarification.

Comment 5 guazhang@redhat.com 2020-08-07 01:30:43 UTC
thanks for the explain, so move the bug to verified

Comment 8 errata-xmlrpc 2020-11-04 03:55:54 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 (stratis-cli 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-2020:4794


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