{"record":{"id":"6d5f37445b2a1f58","repo":"wtfutil/wtf","slug":"s-6d5f37","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/uptimekuma/widget.go","lineNumber":180,"sourceCode":"\t\t\tfmt.Fprintf(&builder, \"[%s]\\n Incident [unparsable date]\", textColor)\n\t\t}\n\t}\n\n\treturn builder.String()\n}\n\nfunc (widget *Widget) display() {\n\twidget.Redraw(func() (string, string, bool) {\n\t\treturn widget.CommonSettings().Title, widget.content(), false\n\t})\n}\n\nfunc (*Widget) fetchStatusData(baseURL, slug string) (*StatusPageData, error) {\n\tapiURL := fmt.Sprintf(\"%s/api/status-page/%s\", baseURL, slug)\n\n\tresp, err := http.Get(apiURL)\n\tif resp != nil && resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"%s\", resp.Status)\n\t}\n\tif resp == nil || err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\n\tvar data StatusPageData\n\tif err := json.NewDecoder(resp.Body).Decode(&data); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &data, nil\n}\n\nfunc (*Widget) fetchHeartbeatData(baseURL, slug string) (*HeartbeatData, error) {\n\tapiURL := fmt.Sprintf(\"%s/api/status-page/heartbeat/%s\", baseURL, slug)\n\n\tresp, err := http.Get(apiURL)","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/uptimekuma/widget.go#L162-L198","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nbaseURL := \"http://localhost:3001\"\nslug := \"My Status\" // slug is actually \"mystatus\"\n// after\nbaseURL := \"http://localhost:3001\"\nslug := \"mystatus\"","handlingStrategy":"validation","validationCode":"u := fmt.Sprintf(\"%s/api/status-page/%s\", strings.TrimRight(baseURL, \"/\"), slug)\nresp, err := http.Get(u)\nif err == nil && resp.StatusCode == 200 { _ = resp.Body.Close(); /* config OK */ }","typeGuard":null,"tryCatchPattern":"data, err := fetchStatusData(baseURL, slug)\nif err != nil {\n    log.Printf(\"uptimekuma status page unreachable (%v); keeping last data\", err)\n    return\n}","preventionTips":["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"],"tags":["http","uptime-kuma","network","go"],"backgroundTag":"http-non-200-response","analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}