-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Glances Widget with Basic Auth results in "Request failed with status code 401" #546
Comments
Yeah, this seems like a bug with how the credentials are handled, probably in Glances mixin, or possibly in the widget mixin. dashy/src/mixins/GlancesMixin.js Lines 13 to 22 in 4c19d8c
Sorry about that, will look into it this weekend. |
I went ahead and enabled the cors proxy and got a error error. It works fine without auth enabled. GET https://redacted.tld/cors-proxy 500 tried opening it in the browser and got Cannot GET /cors-proxy |
You shouldn't need the proxy for glances, I was just checking you weren't using it for when I debug this. |
Ah ok thank you for the quick response keep up the good work! |
Hey @arlostt I did notice that (at least in my setup) if Glances auth is enabled, then CORS will block client-side requests unless the domain is explicitly set as allow headers. If you face that issue, and are unable to get headers working on your Glances server, then setting Feel free to reach out if you need anything else :) |
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 ---
--- Dashy Traefik Config ---
--- Glances Traefik Config ---
Please tick the boxes
The text was updated successfully, but these errors were encountered: