Bug 2241658

Summary: Wrong error message when attempting to upload an image to a PVC that already has disk.img
Product: Container Native Virtualization (CNV) Reporter: Jenia Peimer <jpeimer>
Component: StorageAssignee: Álvaro Romero <alromero>
Status: CLOSED ERRATA QA Contact: Jenia Peimer <jpeimer>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.14.0CC: alitke, dafrank, hmeir
Target Milestone: ---   
Target Release: 4.14.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: v4.14.1.rhel9-22 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-12-07 15:00:47 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 Jenia Peimer 2023-10-01 19:20:57 UTC
Description of problem:
Wrong error message when attempting to upload an image to a PVC that already has disk.img

Version-Release number of selected component (if applicable):
4.14, 4.15

How reproducible:
Always, starting from CNV-v4.14.0.rhel9-1959 (maybe earlier, we only know it worked in the build 1905)

Steps to Reproduce:
1. Upload an image with virtctl - completed successfully / (or import a DV/PVC)

$ virtctl image-upload dv cnv-3729 --image-path=./cirros-0.4.0-x86_64-disk.qcow2 --size=1Gi --storage-class=ocs-storagecluster-ceph-rbd-virtualization --access-mode=ReadWriteMany --insecure --block-volume

2. Run 'virtctl image-upload' command attempting to upload an image to the same PVC

3. See the result:
Unable to get PVC Prime default/cnv-3729

Actual results:
'Unable to get PVC Prime default/cnv-3729'

Expected results:
'PVC cnv-3729 already successfully imported/cloned/updated'

Additional info:
This change happened in the recent builds:
CNV-v4.14.0.rhel9-1905 - Passed (Sep 10)
CNV-v4.14.0.rhel9-1959 - Failed (Sep 16)

Comment 3 Álvaro Romero 2023-11-16 14:02:11 UTC
Still waiting for a somewhat related PR to be merged (https://github.com/kubevirt/containerized-data-importer/pull/2964) but this behavior should already be fixed.

Comment 4 Harel Meir 2023-11-26 14:18:19 UTC
Hi, Im getting this error msg on 4.14 & 4.15:
PVC cnv-3729-hostpath-csi-basic already successfully populated

When running:

virtctl -n cdi-upload-test-upload-virtctl --kubeconfig /tmp/tmpk53zwwus-cnv-tests-kubeconfig/kubeconfig image-upload dv cnv-3729-hostpath-csi-basic --image-path=/tmp/cirros-qcow2.img --size=1Gi --storage-class=hostpath-csi-basic --access-mode=ReadWriteOnce --insecure --no-create


It also happens with ocs,hostpath.

With NFS tho, it producing the correct error message:
PVC cnv-3729 already successfully imported/cloned/updated

Comment 5 Jenia Peimer 2023-11-26 14:34:06 UTC
It looks okay, because our nfs is not a csi storage, so CDI uses the pre-populators flow. But the message is clear in both ways.
We just need to update our tests now.

Thanks Harel for checking,
Thanks Alvaro for fixing!

Comment 6 Jenia Peimer 2023-11-27 10:18:47 UTC
Verified based on Harel's comment.

Comment 14 errata-xmlrpc 2023-12-07 15:00:47 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 (Important: OpenShift Virtualization 4.14.1 security and bug fix 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/RHSA-2023:7704