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 2005110 - Stratisd fails to add data devices after clevis bind command to a tang server with --trust-url
Summary: Stratisd fails to add data devices after clevis bind command to a tang server...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: stratisd
Version: 9.1
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 9.1
Assignee: Bryan Gurney
QA Contact: Filip Suba
Kristina Slaveykova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-16 19:41 UTC by Bryan Gurney
Modified: 2022-11-15 11:26 UTC (History)
6 users (show)

Fixed In Version: stratisd-3.1.0-2.el9
Doc Type: Bug Fix
Doc Text:
.Resolved errors when adding new data devices to the encrypted pool Previously, whenever the user initialized an encrypted pool with encrypted data devices, using a Clevis bind command on a tang server, specified with the `--trust-url` option, `stratisd` did not include the thumbprint part of the Clevis tang configuration in the internal data structures. Consequently, a failure occurred when attempting to add new data devices to the pool. With this update, the internal data structures of `stratisd` now include the thumbprint part of the Clevis tang configuration.
Clone Of:
Environment:
Last Closed: 2022-11-15 10:24:49 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-97580 0 None None None 2021-09-18 10:26:11 UTC
Red Hat Product Errata RHBA-2022:8124 0 None None None 2022-11-15 10:24:59 UTC

Description Bryan Gurney 2021-09-16 19:41:40 UTC
Description of problem:
When trying to add a data device to an encrypted stratis pool that has been created using the "stratis pool bind ... --trust-url" command, the command to add the data device fails.

Version-Release number of selected component (if applicable):
stratisd-2.4.2-3.el9.x86_64
stratis-cli-2.4.3-2.el9.noarch

How reproducible:
Appears to be 100% when reproduction steps are used; however, the problem only appears when the "--trust-url" option is used in the "stratis pool bind ..." command.


Steps to Reproduce:
On a test system with spare block devices /dev/nvme0n1p2 and /dev/nvme0n1p3,
and with stratisd, stratis-cli, and tang installed:
1. Execute "systemctl enable tangd.socket stratisd --now"
2. Create a keyfile, and run "stratis key set --keyfile-path <keyfile> key1"
3. Create a test pool called "spool1" via the following command:
   "stratis pool create spool1 /dev/nvme0n1p2 --key-desc key1"
4. Bind the pool to the local tang server instance:
   "stratis pool bind tang spool1 http://<local IP> --trust-url"
5. Attempt to add a second block device to the test pool:
   "stratis pool add-data spool1 /dev/nvme0n1p3"

Actual results:
Execution failed:
stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: ERROR: Error: Command failed: cmd: "/usr/bin/clevis" "luks" "bind" "-d" "<devnode>" "-k" "/run/stratisd/keyfiles/<tempdir>/key1" "-t" "2" "tang" "{\"url\":\"<url>\"}", exit reason: 1 stdout:  stderr: ...
The advertisement contains the following signing keys:

<SIGNING KEYS>
/usr/bin/clevis-encrypt-tang: line 120: /dev/tty: No such device or address
Invalid input!
Usage: jose jwe fmt -i JWE [-I CT] [-o JWE] [-O CT] [-c]

Converts a JWE between serialization formats

  -i JSON --input=JSON     Parse JWE from JSON
  -i FILE --input=FILE     Read JWE from FILE
  -i -    --input=-        Read JWE from standard input

  -I FILE --detached=FILE  Read decoded ciphertext from FILE
  -I -    --detached=-     Read decoded ciphertext from standard input

  -o JSON --output=JSON    Parse JWE from JSON
  -o FILE --output=FILE    Read JWE from FILE
  -o -    --output=-       Read JWE from standard input
                           Default: "-"

  -O JSON --detach=JSON    Parse JWE from JSON
  -O FILE --detach=FILE    Read JWE from FILE
  -O -    --detach=-       Read JWE from standard input

  -c      --compact        Output JWE using compact serialization

Failed to import token from file.
Error saving metadata to LUKS2 header in device <devnode>
Unable to update metadata; operation cancelled
Error adding new binding to <devnode>
.

Expected results:
The "stratis pool add-data..." command successfully adds the second block device.

Additional info:
As a possible workaround, the block device can be added by running "stratis pool unbind clevis <poolname>", and re-binding via providing the thumbprint:

1. Run the following command to obtain the thumbprint from the tang server:

curl -s localhost/adv | jq -r .payload | base64 -d | jose jwk use -i- -r -u verify -o- | jose jwk thp -i-

2. Run the "stratis pool bind" command using the "--thumbprint" option, and the thumbprint provided from step 1:

   stratis pool bind tang spool1 http://<local IP> --thumbprint <THUMBPRINT>

Comment 1 mulhern 2021-09-16 19:57:51 UTC
Upstream issue: https://github.com/stratis-storage/stratisd/issues/2776
Fix will be present in stratisd 3.0.0.

Comment 6 Filip Suba 2022-06-20 12:57:16 UTC
Verified with stratisd-3.1.0-2.el9.

# stratis pool create --key-desc test_key pool1 /dev/sdb
# stratis pool bind tang --trust-url pool1 http://<local IP>
# stratis pool add-data pool1 /dev/sdc
# stratis pool
Name                  Total / Used / Free    Properties                                   UUID   Alerts
pool   18.19 TiB / 523.96 MiB / 18.19 TiB   ~Ca, Cr, Op   129a7ff0-299a-4145-94a0-06a47efcb567

Comment 10 errata-xmlrpc 2022-11-15 10:24:49 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-2022:8124


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