wtfutil/wtf · error
%s
Error message
%s
What it means
fetchStatusData GETs <baseURL>/api/status-page/<slug> and treats any response that is not HTTP 200 as an error, returning the raw resp.Status string. The uptime-kuma status page data is essential to the widget, so failure here fails the refresh.
Source
Thrown at modules/uptimekuma/widget.go:180
fmt.Fprintf(&builder, "[%s]\n Incident [unparsable date]", textColor)
}
}
return builder.String()
}
func (widget *Widget) display() {
widget.Redraw(func() (string, string, bool) {
return widget.CommonSettings().Title, widget.content(), false
})
}
func (*Widget) fetchStatusData(baseURL, slug string) (*StatusPageData, error) {
apiURL := fmt.Sprintf("%s/api/status-page/%s", baseURL, slug)
resp, err := http.Get(apiURL)
if resp != nil && resp.StatusCode != 200 {
return nil, fmt.Errorf("%s", resp.Status)
}
if resp == nil || err != nil {
return nil, err
}
defer func() { _ = resp.Body.Close() }()
var data StatusPageData
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
return nil, err
}
return &data, nil
}
func (*Widget) fetchHeartbeatData(baseURL, slug string) (*HeartbeatData, error) {
apiURL := fmt.Sprintf("%s/api/status-page/heartbeat/%s", baseURL, slug)
resp, err := http.Get(apiURL)View on GitHub (pinned to bb838c1ccb)
Solutions
- Open <baseURL>/api/status-page/<slug> in a browser and fix baseURL/slug to match
- Enable/create the status page in Uptime Kuma (Status Pages settings) and copy its exact slug
- Check reverse proxy/port config if the browser test 404s despite a correct slug
- Confirm Uptime Kuma is running and reachable
Example fix
// before baseURL := "http://localhost:3001" slug := "My Status" // slug is actually "mystatus" // after baseURL := "http://localhost:3001" slug := "mystatus"
Defensive patterns
Strategy: validation
Validate before calling
u := fmt.Sprintf("%s/api/status-page/%s", strings.TrimRight(baseURL, "/"), slug)
resp, err := http.Get(u)
if err == nil && resp.StatusCode == 200 { _ = resp.Body.Close(); /* config OK */ } Try / catch
data, err := fetchStatusData(baseURL, slug)
if err != nil {
log.Printf("uptimekuma status page unreachable (%v); keeping last data", err)
return
} Prevention
- Copy the status-page slug directly from the Uptime Kuma UI
- Trim trailing slashes from baseURL before building endpoint URLs
- Enable the status page in Uptime Kuma before configuring the widget
- Health-check the Uptime Kuma URL at startup and degrade gracefully
When it happens
Trigger: Uptime Kuma returning non-200 on the status-page endpoint: wrong baseURL, wrong/unknown slug, status page disabled or not created in Uptime Kuma, or an auth-protected status page answering 401/403.
Common situations: Status page not enabled in Uptime Kuma settings; slug in config not matching the slug set on the status page; widget pointed at the wrong port or reverse-proxy path; Uptime Kuma down/restarting.
Related errors
- executing request: %w
- unexpected status %d from DEV.to API
- %s
- %s
- yfinance: unexpected status %d for symbol %q
AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03).
Data as JSON: /api/errors/6d5f37445b2a1f58.
Report an issue: GitHub.