Bug 2162093 - [RBD] Image encryption - RFE - Error message improvement needed as we see the same error message for incorrect encryption format/passphrase
Summary: [RBD] Image encryption - RFE - Error message improvement needed as we see the...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RBD
Version: 6.0
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: 7.1
Assignee: Ilya Dryomov
QA Contact: Preethi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-18 18:49 UTC by Preethi
Modified: 2023-07-10 19:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCEPH-6980 0 None None None 2023-07-10 19:56:58 UTC

Description Preethi 2023-01-18 18:49:02 UTC
Description of problem:[RBD] Image encryption - RFE - Error message improvement needed as we see the same error message for incorrect encryption format/passphrase

Ceph version-
ceph version 17.2.5-58.el9cp (16442de8e6d5a0e3579858f2df1407d21043bc4b) quincy (stable)


How reproducible:


Steps to Reproduce:
1)Create RBD image1 
2)Apply encryption format LUKS1/LUKS2 to the RBD image1 [root@magna021 ubuntu]# rbd encryption format mypool/myimage6 luks2 passphrase.bin

3)load encryption

4) create file system and mount the device 
5)Run IOs

6) Create a clone  i.e RBD image2, from the snapshot of RBD image1 

7) Encrypt the image with LUKS2 and different passphrase -In this steps Pass incorrect formats and passphrase keys

Actual result-  below output when incorrect format is provided for
example LUKS1 instead of LUKS2 to the clone and image vice versa insted we expect the error message to tell us that format given to the clone/image is incorrect so that users can easily identify the mistake

[root@magna021 ubuntu]# rbd device map -t nbd -o encryption-format=luks2,encryption-passphrase-file=passphrase.bin mypool/myclone2
rbd-nbd: failed to load encryption: 2023-01-17T05:43:05.233+0000 7fe5077fe640 -1 librbd::crypto::LoadRequest: 0x56393dcd5980 handle_load: failed to load encryption. image name: myclone2
(22) Invalid argument
rbd: rbd-nbd failed with error: /usr/bin/rbd-nbd: exit status: 1


when incorrect passphrase supplied to the clone image we get the below error- we expect the error message to throw if clone or image of the passphrase is incorrect  
here, below i have provided passphrase only for the image but not passing for clone image - there was no error message to tell us that we should pass clone format and encryption prior to the image format and passphrase 

[root@magna021 ubuntu]# rbd device map -t nbd -o encryption-format=luks1,encryption-passphrase-file=passphrase.bin mypool/myclone2
rbd-nbd: failed to load encryption: 2023-01-17T05:43:17.380+0000 7f04daffd640 -1 librbd::crypto::LoadRequest: 0x56504bcb5e50 handle_load: failed to load encryption. image name: myclone2
(1) Operation not permitted
rbd: rbd-nbd failed with error: /usr/bin/rbd-nbd: exit status: 1
[root@magna021 ubuntu]#  
 




Actual results:


Expected results:


Additional info:


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