dashy icon indicating copy to clipboard operation
dashy copied to clipboard

[BUG] Uptime-Kuma Widget Gives JSON Error and Fails to Load

Open awildeone opened this issue 1 year ago • 1 comments

Environment

Self-Hosted (Bare Metal)

System

Proxmox PVE - Based on Debian

Version

3.0.1

Describe the problem

When updating the conf.yml file with widget information to load an Uptime-Kuma dashboard, it fails with

Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

On the page and console, the initial error reports ' An error occurred, see the logs for more info. Unable to fetch data '.

This error only appears when the YAML code for uptime-kuma is present.

I've put the strings in "" and ''. With the clock, the YAML update loads the clock but still fails when adding uptime-kuma widget. So it sounds like something isn't parsing correctly in the uptime-kuma widget? Could very well be wrong.

Code block in conf.yml

  - name: Status
    displayData:
      collapsed: false
    widgets:
    - type: clock
    - type: uptime-kuma
      useProxy: true
      options:
        apiKey: umy_5secret_ARmAPIkeyufeJ9l
        url: http://IPaddress:3001/status/dashy

I've also tried the same port/page as listed in the documentation. Same error.

Doc page: https://dashy.to/docs/widgets/#uptime-kuma

image image

Additional info

  • Issue exists in Chrome and Safari
  • Tried rebuilding app after including API key
  • Removed YAML for problem widget and all errors went away

Please tick the boxes

awildeone avatar May 01 '24 05:05 awildeone

Could be related to https://github.com/Lissy93/dashy/issues/1549

awildeone avatar May 01 '24 05:05 awildeone

Hi, I've just tested this myself and you have to use /metrics url instead of "/status/dashy" which you used. When using /metrics it should work.

But as you already found there currently is an issue with auth-headers, so you will get a 401 error. I will close this issue as duplicate, and we will track progress of the auth-headers in https://github.com/Lissy93/dashy/issues/1549

CrazyWolf13 avatar May 09 '24 23:05 CrazyWolf13

I'm getting an error with uptime kuma as well. I'm using the metrics endpoint but from the logs it looks like dashy is expecting json but uptime kuma just returns text

image image

dubcdr avatar Jun 17 '24 17:06 dubcdr