wtfutil/wtf · error
failed to retrieve version from Pi-hole server http status
Error message
failed to retrieve version from Pi-hole server http status code: %d
What it means
Raised in getStatus when the Pi-hole server responds with an HTTP status >= 400 (Bad Request or worse) to the summary API request. The request reached the server but was rejected — e.g. wrong API path, blocked endpoint, or server-side error.
Source
Thrown at modules/pihole/client.go:68
url.RawQuery = query.Encode()
if req, err = http.NewRequest("GET", url.String(), http.NoBody); err != nil {
return status, fmt.Errorf(" failed to create request\n %s", parseError(err))
}
var resp *http.Response
if resp, err = c.Do(req); err != nil || resp == nil {
return status, fmt.Errorf(" failed to connect to Pi-hole server\n %s", parseError(err))
}
defer func() {
if closeErr := resp.Body.Close(); closeErr != nil {
return
}
}()
if resp.StatusCode >= http.StatusBadRequest {
return status, fmt.Errorf(" failed to retrieve version from Pi-hole server\n http status code: %d",
resp.StatusCode)
}
var rBody []byte
if rBody, err = io.ReadAll(resp.Body); err != nil {
return status, fmt.Errorf(" failed to read status response")
}
if err = json.Unmarshal(rBody, &status); err != nil {
return status, fmt.Errorf(" failed to retrieve status: check provided api URL and token\n %s",
parseError(err))
}
return status, err
}
type FlexInt intView on GitHub (pinned to bb838c1ccb)
Solutions
- Check the apiUrl points to the correct Pi-hole API endpoint (usually .../admin/api.php)
- Verify any required auth (webpassword) is configured correctly
- Inspect the configured URL path for typos causing 404s
- Check Pi-hole server logs for the rejected request
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at modules/pihole/client.go:68 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03).
Data as JSON: /api/errors/c2d93243314467a3.
Report an issue: GitHub.