Bug 1999835

Summary: ConsoleCLIDownload | wrong path in virtctl archive URL
Product: Container Native Virtualization (CNV) Reporter: ibesso <ibesso>
Component: InstallationAssignee: Erkan Erol <eerol>
Status: CLOSED ERRATA QA Contact: ibesso <ibesso>
Severity: high Docs Contact:
Priority: high    
Version: 4.9.0CC: cnv-qe-bugs, dollierp, ibesso, stirabos
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hco-bundle-registry-container-v4.9.0-192 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-02 16:00:55 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 ibesso 2021-08-31 19:04:55 UTC
Description of problem:
----------------------
When trying to download virtctl following one of the URLs in ConsoleCLIDownload virtctl-clidownloads-kubevirt-hyperconverged yaml, I get 404 NOT FOUND.


Version-Release number of selected component (if applicable):
------------------------------------------------------------
HCO: 4.9.0-155


How reproducible:
----------------
100%


Steps to Reproduce:
------------------
1. oc get ConsoleCLIDownload virtctl-clidownloads-kubevirt-hyperconverged -ojson |jq '.spec.links'
2. Try to download one of the links.


Actual results:
--------------
HTTP 404 Not Found.


Expected results:
----------------
The archive file should be downloaded successfully.


Additional info:
---------------
Adding "/achives" to the URL path before /amd64 will make the URL valid and the archive file will be downloaded successfully.

Comment 1 Erkan Erol 2021-08-31 19:20:05 UTC
I found the root cause of the bug. It is because of a wrong "COPY" command in the dockerfile of virt-artifacts-server image. A fix will be provided soon. 
.

Comment 4 Simone Tiraboschi 2021-09-02 09:38:07 UTC
*** Bug 1999112 has been marked as a duplicate of this bug. ***

Comment 6 Denis Ollier 2021-09-04 13:41:56 UTC
Hi Erkan,

I think the .gz suffix should be added to the tarball name since it is compressed (i.e: virtctl.tar.gz):

> curl -ksSL https://hyperconverged-cluster-cli-download-openshift-cnv.apps.${cluster_name}.${cluster_domain}/amd64/linux/virtctl.tar \
>   | tar -xf -
> 
> tar: Archive is compressed. Use -z option
> tar: Error is not recoverable: exiting now
> curl: (23) Fail2021-09-04T13:34:58.840396069Z ed writing body (1268 != 12582)

Regards,

Denis

Comment 7 Erkan Erol 2021-09-06 06:59:35 UTC
Hi Denis,

Thanks for reporting this issue. You are right. We should either add ".gz" into the file name or remove "-z" option while creating the tar file.  See https://github.com/kubevirt/hyperconverged-cluster-operator/blob/main/build/Dockerfile.artifacts#L16

I checked how OCP does it. It doesn't compress the file and the file name is "oc.tar"

On the other hand, we gain significant amount of storage when compressing it. 

-rw-rw-r--.  1 eerol eerol  49M Sep  1 17:11 virtctl
-rw-rw-r--.  1 eerol eerol  49M Sep  6 09:53 virtctl.tar
-rw-rw-r--.  1 eerol eerol  19M Sep  6 09:52 virtctl.tar.gz


@stirabos I think we should go with compressed file by adding ".gz" suffix. What do you think?

Comment 8 Simone Tiraboschi 2021-09-07 12:15:10 UTC
(In reply to Erkan Erol from comment #7)
> @stirabos I think we should go with compressed file by adding
> ".gz" suffix. What do you think?

+1

Comment 11 ibesso 2021-09-30 09:30:19 UTC
Verified with the latest 4.9.0 build.
The automation tests passed and all links are downloadable.

Comment 14 errata-xmlrpc 2021-11-02 16:00:55 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 (Moderate: OpenShift Virtualization 4.9.0 Images 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-2021:4104