hasura/graphql-engine · warning

decoding update check response: %w

Error message

decoding update check response: %w

What it means

After a successful HTTP response, getLatestVersion decodes the JSON body into updateCheckResponse. This error means the body was not valid JSON for that shape: truncated output, an HTML error page from a proxy, or a changed response schema.

Source

Thrown at cli/update/update.go:41

	Latest     *semver.Version `json:"latest"`
	PreRelease *semver.Version `json:"prerelease"`
}

func getLatestVersion() (*semver.Version, *semver.Version, error) {
	var op errors.Op = "update.getLatestVersion"

	res, err := http.Get(updateCheckURL)
	if err != nil {
		return nil, nil, errors.E(op, fmt.Errorf("update check request: %w", err))
	}

	defer res.Body.Close()

	var response updateCheckResponse

	err = json.NewDecoder(res.Body).Decode(&response)
	if err != nil {
		return nil, nil, errors.E(op, fmt.Errorf("decoding update check response: %w", err))
	}

	if response.Latest == nil && response.PreRelease == nil {
		return nil, nil, errors.E(
			op,
			fmt.Errorf("expected version info not found at %s", updateCheckURL),
		)
	}

	return response.Latest, response.PreRelease, nil
}

func buildAssetURL(v string) string {
	os := runtime.GOOS
	arch := runtime.GOARCH

	extension := ""
	if os == "windows" {

View on GitHub (pinned to 724551b9ae)

Solutions

  1. curl the updateCheckURL from the same environment and inspect the raw body
  2. If a proxy/WAF is mangling the response, whitelist the update domain or disable update checks
  3. Treat update-check failures as non-fatal: log and continue with the current version

Example fix

// before
if _, _, err := update.HasUpdate(); err != nil { return err }

// after
if _, _, err := update.HasUpdate(); err != nil {
    log.Printf("update check failed (continuing): %v", err)
}
Defensive patterns

Strategy: fallback

Try / catch

if _, _, err := update.HasUpdate(); err != nil {
    if strings.Contains(err.Error(), "decoding update check response") {
        // endpoint served unexpected content; skip update flow
    }
}

Prevention

When it happens

Trigger: Calling update.HasUpdate() when the update endpoint returns non-JSON (a captive portal or 403/502 HTML page served by a proxy) or when the response schema changed in a newer server version.

Common situations: Corporate proxies injecting HTML interstitials, CDN/WAF returning error pages, partial responses due to connection resets, or the update service changing its payload format.

Related errors


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