AdguardTeam/AdGuardHome · warning

sending http request to %s: %w

Error message

sending http request to %s: %w

What it means

VersionInfo's HTTP GET to the version-check URL failed at the transport level (DNS, connection, TLS, timeout); the URL is included.

Source

Thrown at internal/updater/check.go:61

	now := time.Now()
	recheckTime := u.prevCheckTime.Add(versionCheckPeriod)
	if !forceRecheck && now.Before(recheckTime) {
		u.logger.DebugContext(ctx, "version info recheck is not required yet")

		return u.prevCheckResult, u.prevCheckError
	}

	vcu := u.versionCheckURL
	req, err := http.NewRequestWithContext(ctx, http.MethodGet, vcu, nil)
	if err != nil {
		return VersionInfo{}, fmt.Errorf("constructing request to %s: %w", vcu, err)
	}

	u.logger.DebugContext(ctx, "requesting version data", "url", vcu)

	resp, err := u.client.Do(req)
	if err != nil {
		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)

View on GitHub (pinned to b41aefbe51)

Solutions

  1. Verify network/DNS reachability of the URL (curl it)
  2. Configure proxy/trust settings or disable update checks in air-gapped deployments
  3. Increase the client timeout if the endpoint is slow
Defensive patterns

Strategy: retry

Validate before calling

if _, err := net.LookupHost(host(checkURL)); err != nil { return fmt.Errorf("no DNS for update host") }

Try / catch

var info VersionInfo
for i := 0; i < 3; i++ { info, err = u.VersionInfo(ctx); if err == nil || !isTransient(err) { break }; time.Sleep(backoff(i)) }

Prevention

When it happens

Trigger: Calling VersionInfo with no network access, DNS failure for the update host, TLS certificate problems, or a cancelled/expired context.

Common situations: Offline/air-gapped machines, firewalls blocking the update server, proxy misconfiguration, or short timeouts on slow links.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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