AdguardTeam/AdGuardHome · warning

reading response from %s: %w

Error message

reading response from %s: %w

What it means

Reading the version-check response body (limited to maxVersionRespSize via LimitReader) failed; wrapped with the URL.

Source

Thrown at internal/updater/check.go:79

		return VersionInfo{}, fmt.Errorf("sending http request to %s: %w", vcu, err)
	}
	defer func() { err = errors.WithDeferred(err, resp.Body.Close()) }()

	if resp.StatusCode != http.StatusOK {
		return VersionInfo{}, fmt.Errorf(
			"got status code %d, want %d",
			resp.StatusCode,
			http.StatusOK,
		)
	}

	r := ioutil.LimitReader(resp.Body, maxVersionRespSize.Bytes())

	// This use of ReadAll is safe, because we just limited the appropriate
	// ReadCloser.
	body, err := io.ReadAll(r)
	if err != nil {
		return VersionInfo{}, fmt.Errorf("reading response from %s: %w", vcu, err)
	}

	u.prevCheckTime = now
	u.prevCheckResult, u.prevCheckError = u.parseVersionResponse(ctx, body)

	return u.prevCheckResult, u.prevCheckError
}

// parseVersionResponse parses version-related data and unmarshals it into the
// [VersionInfo] structure.
func (u *Updater) parseVersionResponse(
	ctx context.Context,
	data []byte,
) (vi VersionInfo, err error) {
	info := VersionInfo{
		CanAutoUpdate: aghalg.NBFalse,
	}
	versionJSON := map[string]string{

View on GitHub (pinned to b41aefbe51)

Solutions

  1. Retry the version check with backoff
  2. Check for proxies/MTU issues truncating responses
  3. Ensure the caller's context deadline accommodates the full response
Defensive patterns

Strategy: retry

Try / catch

info, err := u.VersionInfo(ctx)
if err != nil && strings.Contains(err.Error(), "reading response") { info, err = u.VersionInfo(ctx) }

Prevention

When it happens

Trigger: VersionInfo where the connection drops mid-response, context is cancelled during read, or the server closes the body prematurely.

Common situations: Flaky networks, proxies resetting long responses, or a caller's context timing out before the body finishes.

Related errors


AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27). Data as JSON: /api/errors/b557ed96498f00e6. Report an issue: GitHub.