Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRC Setup is failing with "unable to get verified hash for default bundle" #3686

Closed
RamySabry opened this issue May 30, 2023 · 7 comments · Fixed by #3693
Closed

CRC Setup is failing with "unable to get verified hash for default bundle" #3686

RamySabry opened this issue May 30, 2023 · 7 comments · Fixed by #3693

Comments

@RamySabry
Copy link

RamySabry commented May 30, 2023

Trying to setup a fresh CRC "crc setup" with the below environment but its failing with the mentioned error below

Error
"unable to get verified hash for default bundle: Get "https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/bundles/openshift/4.12.13/sha256sum.txt.sig": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"

CR Version : crc-linux-2.19.0-amd64
Operating System : CentOS-Stream-9-x86_64
Over VMware 16.1.0 build-17198959

Logs are attached "Setup Debug Logs.txt"

(Setup Debug Logs.txt)

@jsliacan
Copy link
Contributor

We've just seen this issue on M1 with pre-release bits (2.20.0) with microshfit preset. But on 2nd try it went away and we couldn't replicate. cc: @adrianriobo

@cfergeau
Copy link
Contributor

Maybe this timeout which is too short?

client := &http.Client{
Timeout: 5 * time.Second,
Transport: network.HTTPTransport(),
}

@anjannath
Copy link
Member

anjannath commented May 30, 2023

Maybe this timeout which is too short?

client := &http.Client{
Timeout: 5 * time.Second,
Transport: network.HTTPTransport(),
}

we have to increase this timeout duration, i reused the timeout from the call to check for new version, but the bundle signature file is bigger in size then the version-info.json (they are of same size)

it could also be related to delayed respose from dns, @RamySabry could you share what dns setup you are using

@anjannath
Copy link
Member

as @jsliacan mentioned, work-arond is to run crc setup again.

anjannath added a commit to anjannath/crc that referenced this issue May 31, 2023
the current timeout of 5 seconds seems to be not enough and users
are getting an error as a result of this during `crc setup`

while increasing the time this error seems to go away, also the 5
sec timeout for release-info.json seems to be working but the sha
sum file is bigger (919 bytes vs 532 bytes)

fixes crc-org#3686
@cfergeau
Copy link
Contributor

i reused the timeout from the call to check for new version

Might be useful to introduce a helper to get an io.Reader from an http URL instead of duplicating this code twice. Seems easy to do using the current code, but the go package we use in our download package also provides https://github.com/cavaliergopher/grab/blob/e06b719a377d74a18bdff0d0ffb9abf4a4afdbac/v3/response.go#L191-L204

@anjannath
Copy link
Member

yeah, good idea, we can create a wrapper function to create a grab.Request that'd download in memory and then use the resp.Open for getting the content

anjannath added a commit to anjannath/crc that referenced this issue Jun 7, 2023
as a result of using the helper the User-Agent for the http request
is `crc/<version>`

this was not the case before, but since we were setting the user-agent
for downloading the `release-info.json` file it makes sense to use the
same User-Agent for downloading the file `sha256sum.txt.sig`

this also fixes crc-org#3686
anjannath added a commit to anjannath/crc that referenced this issue Jun 8, 2023
as a result of using the helper the User-Agent for the http request
is `crc/<version>`

this was not the case before, but since we were setting the user-agent
for downloading the `release-info.json` file it makes sense to use the
same User-Agent for downloading the file `sha256sum.txt.sig`

this also fixes crc-org#3686
praveenkumar pushed a commit that referenced this issue Jun 9, 2023
as a result of using the helper the User-Agent for the http request
is `crc/<version>`

this was not the case before, but since we were setting the user-agent
for downloading the `release-info.json` file it makes sense to use the
same User-Agent for downloading the file `sha256sum.txt.sig`

this also fixes #3686
@Matrejeur
Copy link

I downloaded the bundle as stated on the error link i.e https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/ on my browser.
Copied it to my the cache directory inside the .crc directory i.e /home/nago/.crc/cache.
Ran the command: crc setup -b {The downloaded bundle} i.e
crc setup -b crc_libvirt_4.13.0_amd64.crcbundle

@anjannath anjannath unpinned this issue Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants