{"record":{"id":"fe73e61181a3f5ca","repo":"hasura/graphql-engine","slug":"downloading-asset-w","errorCode":null,"errorMessage":"downloading asset: %w","messagePattern":"downloading asset: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/update/update.go","lineNumber":74,"sourceCode":"\tarch := runtime.GOARCH\n\n\textension := \"\"\n\tif os == \"windows\" {\n\t\textension = \".exe\"\n\t}\n\n\treturn fmt.Sprintf(\n\t\t\"https://github.com/hasura/graphql-engine/releases/download/v%s/cli-hasura-%s-%s%s\",\n\t\tv, os, arch, extension,\n\t)\n}\n\nfunc downloadAsset(url, fileName, filePath string) (*os.File, error) {\n\tvar op errors.Op = \"update.downloadAsset\"\n\n\tres, err := http.Get(url)\n\tif err != nil {\n\t\treturn nil, errors.E(op, errors.KindNetwork, fmt.Errorf(\"downloading asset: %w\", err))\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != http.StatusOK {\n\t\treturn nil, errors.E(op, errors.E(\"could not find the release asset\"))\n\t}\n\n\tasset, err := os.OpenFile(\n\t\tfilepath.Join(filePath, fileName),\n\t\tos.O_CREATE|os.O_WRONLY|os.O_TRUNC,\n\t\t0o755,\n\t)\n\tif err != nil {\n\t\treturn nil, errors.E(op, fmt.Errorf(\"creating new binary file: %w\", err))\n\t}\n\tdefer asset.Close()\n\n\t_, err = io.Copy(asset, res.Body)","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/update/update.go#L56-L92","documentation":"downloadAsset performs an http.Get on the release asset URL; any transport-level failure (DNS, refused connection, timeout, TLS) is wrapped with KindNetwork. This happens during ApplyUpdate when fetching the new CLI binary from the release host.","triggerScenarios":"Calling ApplyUpdate() (usually via 'cli update') when the release download host is unreachable, blocked by a firewall/proxy, or DNS fails; also with invalid/expired asset URLs.","commonSituations":"Air-gapped or CI environments blocking release downloads, corporate proxies, revoked or moved release assets after a provider migration.","solutions":["Verify the release host is reachable from the environment (curl -I the asset URL)","Configure HTTP(S)_PROXY for the CLI process if behind a corporate proxy","Download the binary manually and install it, or pin/skip auto-update in restricted environments","Retry later if the failure is transient"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var f *os.File\nerr := retry(3, time.Second, func() error {\n    var e error\n    f, e = downloadAsset(url, name, path)\n    return e\n})\nif err != nil { /* fall back to manual install instructions */ }","preventionTips":["Retry transient network failures with backoff before surfacing to the user","Provide a manual download fallback in docs/scripts","Whitelist the release host in firewalled environments"],"tags":["network","download","update","hasura-cli"],"backgroundTag":"download-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}