hasura/graphql-engine · error

downloading asset: %w

Error message

downloading asset: %w

What it means

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.

Source

Thrown at cli/update/update.go:74

	arch := runtime.GOARCH

	extension := ""
	if os == "windows" {
		extension = ".exe"
	}

	return fmt.Sprintf(
		"https://github.com/hasura/graphql-engine/releases/download/v%s/cli-hasura-%s-%s%s",
		v, os, arch, extension,
	)
}

func downloadAsset(url, fileName, filePath string) (*os.File, error) {
	var op errors.Op = "update.downloadAsset"

	res, err := http.Get(url)
	if err != nil {
		return nil, errors.E(op, errors.KindNetwork, fmt.Errorf("downloading asset: %w", err))
	}
	defer res.Body.Close()

	if res.StatusCode != http.StatusOK {
		return nil, errors.E(op, errors.E("could not find the release asset"))
	}

	asset, err := os.OpenFile(
		filepath.Join(filePath, fileName),
		os.O_CREATE|os.O_WRONLY|os.O_TRUNC,
		0o755,
	)
	if err != nil {
		return nil, errors.E(op, fmt.Errorf("creating new binary file: %w", err))
	}
	defer asset.Close()

	_, err = io.Copy(asset, res.Body)

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Verify the release host is reachable from the environment (curl -I the asset URL)
  2. Configure HTTP(S)_PROXY for the CLI process if behind a corporate proxy
  3. Download the binary manually and install it, or pin/skip auto-update in restricted environments
  4. Retry later if the failure is transient
Defensive patterns

Strategy: retry

Try / catch

var f *os.File
err := retry(3, time.Second, func() error {
    var e error
    f, e = downloadAsset(url, name, path)
    return e
})
if err != nil { /* fall back to manual install instructions */ }

Prevention

When it happens

Trigger: 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.

Common situations: Air-gapped or CI environments blocking release downloads, corporate proxies, revoked or moved release assets after a provider migration.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/fe73e61181a3f5ca. Report an issue: GitHub.