{"record":{"id":"f3fb0b565b062de9","repo":"kubernetes/kops","slug":"error-doing-http-fetch-of-q-v","errorCode":null,"errorMessage":"error doing HTTP fetch of %q: %v","messagePattern":"error doing HTTP fetch of %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/http.go","lineNumber":154,"sourceCode":"\t}\n\treturn actual, nil\n}\n\n// OpenURL opens a hardened HTTP GET stream for url.\nfunc OpenURL(url string) (io.ReadCloser, error) {\n\thttpClient := newDownloadHTTPClient()\n\n\tctx, cancel := context.WithTimeout(context.Background(), downloadTimeout)\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)\n\tif err != nil {\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"cannot create request: %v\", err)\n\t}\n\n\tresponse, err := httpClient.Do(req)\n\tif err != nil {\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"error doing HTTP fetch of %q: %v\", url, err)\n\t}\n\n\t// http.Client follows 3xx automatically, so anything outside 2xx that reaches us is a bug or a missing Location.\n\tif response.StatusCode < 200 || response.StatusCode > 299 {\n\t\tresponse.Body.Close()\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"unexpected response from %q: HTTP %s\", url, response.Status)\n\t}\n\n\treturn &cancelOnCloseReadCloser{ReadCloser: response.Body, cancel: cancel}, nil\n}\n\nfunc newDownloadHTTPClient() *http.Client {\n\treturn &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t\tDialContext: (&net.Dialer{\n\t\t\t\tTimeout:   30 * time.Second,","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/http.go#L136-L172","documentation":"Thrown by OpenURL when httpClient.Do fails executing the GET: network-level errors — DNS resolution failure, connection refused/timeout, TLS handshake problems, or the overall download timeout elapsing. The request itself was valid; reaching the server is what failed.","triggerScenarios":"Thrown at upup/pkg/fi/http.go:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network/DNS connectivity to the host (curl the URL to reproduce)","For TLS errors, verify certificates or system CA trust on the machine","Retry — transient network failures are common; the download is guarded by a hash check","If behind a proxy, configure HTTPS_PROXY so the client can reach the host"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}