{"record":{"id":"12b7965b1a6663f3","repo":"kubernetes/kops","slug":"downloading-q-w","errorCode":null,"errorMessage":"downloading %q: %w","messagePattern":"downloading %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/assets/assetdata/tools/cmd/generatefileassets/main.go","lineNumber":58,"sourceCode":"\tfilestoreBase := \"\"\n\tprefix := \"\"\n\thashFileURL := \"\"\n\tvar exclude globList\n\n\tflag.StringVar(&filestoreBase, \"base\", filestoreBase, \"base directory\")\n\tflag.StringVar(&prefix, \"prefix\", prefix, \"prefix to fetch\")\n\tflag.StringVar(&hashFileURL, \"sums\", hashFileURL, \"prefix to fetch\")\n\tflag.Var(&exclude, \"exclude\", \"path-globs to exclude from output\")\n\n\tflag.Parse()\n\n\tif hashFileURL == \"\" {\n\t\thashFileURL = filestoreBase + prefix + \"SHA256SUMS\"\n\t}\n\n\thttpResponse, err := http.Get(hashFileURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"downloading %q: %w\", hashFileURL, err)\n\t}\n\tif httpResponse.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"unexpected status getting %q: %v\", hashFileURL, httpResponse.Status)\n\t}\n\tdefer httpResponse.Body.Close()\n\n\tb, err := io.ReadAll(httpResponse.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading body %q: %w\", hashFileURL, err)\n\t}\n\n\tm := &manifest{}\n\tfor _, line := range strings.Split(string(b), \"\\n\") {\n\t\tline = strings.TrimSpace(line)\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif line == \"-----BEGIN PGP SIGNED MESSAGE-----\" {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/assets/assetdata/tools/cmd/generatefileassets/main.go#L40-L76","documentation":"In generatefileassets (a code-generation tool that turns remote SHA256SUMS files into embedded YAML manifests), run() fetches the hash file with http.Get. This error wraps any transport-level failure: DNS resolution, TCP connect, TLS, timeouts, or an invalid URL scheme. It does not cover HTTP error statuses (see 806).","triggerScenarios":"Running the tool with a -base/-prefix/-sums combination producing a URL that fails http.Get — unreachable host, no network, DNS failure, offline CI, or malformed URL (e.g. missing scheme when -sums is given a bare hostname).","commonSituations":"CI runner without internet access; typo'd or stale filestore base; corporate proxy/firewall blocking storage.googleapis.com; passing -sums without http(s):// prefix.","solutions":["Verify the URL (curl the hashFileURL printed in the error) and fix -base/-prefix/-sums flags","Include the scheme in -sums, e.g. -sums https://storage.googleapis.com/.../SHA256SUMS","Check network/proxy: set HTTPS_PROXY or run from a machine with internet access","Retry if transient (DNS blip, rate limit); the tool does no retries itself"],"exampleFix":"// before\nmain -base storage.googleapis.com/kops-ci/bin/ -prefix 1.28.0/\n// after (note scheme)\nmain -base https://storage.googleapis.com/kops-ci/bin/ -prefix 1.28.0/","handlingStrategy":"retry","validationCode":"u, err := url.Parse(hashFileURL)\nif err != nil || (u.Scheme != \"http\" && u.Scheme != \"https\") || u.Host == \"\" {\n\treturn fmt.Errorf(\"invalid hash file URL: %q\", hashFileURL)\n}","typeGuard":null,"tryCatchPattern":"resp, err := http.Get(hashFileURL)\nif err != nil {\n\tvar netErr net.Error\n\tif errors.As(err, &netErr) && netErr.Timeout() {\n\t\t// retry with backoff\n\t}\n\treturn fmt.Errorf(\"downloading %q: %w\", hashFileURL, err)\n}","preventionTips":["Always include an explicit http(s) scheme in -base/-sums","Curl the URL before running the generator in CI","Configure HTTPS_PROXY in restricted networks","Add retry-with-backoff around generator invocations"],"tags":["network","http","code-generation"],"backgroundTag":"http-request-failed","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"}