Skip to content

[BUG] Glances Widget with Basic Auth results in "Request failed with status code 401" #546

Closed
@cfrstr

Description

Environment

Self-Hosted (Docker)

Version

2.0.4

Describe the problem

The Glances Widgets fail to fetch data due to a 401 error. I've checked with both my browser and postman and I am 100% sure the credentials are correct. Both run on Docker. I had a few issues with cors before getting to this point so it maybe be related to that but I'm unsure, I've attached the Dashy config and console log as well the traefik configs for both to the additional info. Apologizes if this is a simple misconfiguration and not a bug.

Additional info

--- Dashy Console Log ---

CoolConsole.js:18 Stack Trace
Error: Request failed with status code 401
i @ CoolConsole.js:18
l @ ErrorHandler.js:27
error @ WidgetMixin.js:75
(anonymous) @ WidgetMixin.js:122
Promise.catch (async)
(anonymous) @ WidgetMixin.js:121
makeRequest @ WidgetMixin.js:113
fetchData @ GlancesMixin.js:27
update @ WidgetMixin.js:67
(anonymous) @ WidgetMixin.js:71

createError.js:16 Uncaught (in promise) Error: Request failed with status code 401
at e.exports (createError.js:16:15)
at e.exports (settle.js:17:12)
at XMLHttpRequest.x (xhr.js:66:7)

GET https://glances.redacted.tld/api/3/cpu 401
(anonymous) @ xhr.js:210
e.exports @ xhr.js:15
e.exports @ dispatchRequest.js:58
h.request @ Axios.js:112
(anonymous) @ bind.js:9
(anonymous) @ WidgetMixin.js:114
makeRequest @ WidgetMixin.js:113
fetchData @ GlancesMixin.js:27
update @ WidgetMixin.js:67
(anonymous) @ WidgetMixin.js:71

--- Dashy Widget Config ---

widgets:
- type: gl-current-cpu
  options:
    hostname: https://glances.redacted.tld
    username: glances
    password: <password>

--- Dashy Traefik Config ---

  - traefik.enable=true
  - traefik.docker.network=link
  - traefik.http.routers.dashy.rule=Host(`redacted.tld`)
  - traefik.http.routers.dashy.entrypoints=websecure
  - traefik.http.routers.dashy.tls=true
  - traefik.http.routers.dashy.tls.certresolver=letsencrypt
  - traefik.http.routers.dashy.middlewares=hsts@file,authelia@docker

--- Glances Traefik Config ---

  - traefik.enable=true
  - traefik.docker.network=link
  - traefik.http.routers.glances.rule=Host(`glances.redacted.tld`)
  - traefik.http.routers.glances.entrypoints=websecure
  - traefik.http.routers.glances.tls=true
  - traefik.http.routers.glances.tls.certresolver=letsencrypt
  - traefik.http.middlewares.corsglances.headers.accesscontrolallowmethods=GET,OPTIONS,PUT
  - traefik.http.middlewares.corsglances.headers.accesscontrolalloworiginlist=https://redacted.tld
  - traefik.http.middlewares.corsglances.headers.accesscontrolallowheaders=authorization,headers
  - traefik.http.middlewares.corsglances.headers.accesscontrolmaxage=100
  - traefik.http.middlewares.corsglances.headers.accesscontrolallowcredentials=true
  - traefik.http.middlewares.corsglances.headers.addvaryheader=true
  - traefik.http.routers.glances.middlewares=corsglances,hsts@file
  - traefik.http.services.glances.loadbalancer.server.port=61208
  - traefik.http.routers.glances.service=glances

Please tick the boxes

Metadata

Assignees

Labels

🐛 Bug[ISSUE] Ticket describing something that isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions