MarlBurroW/Streamdeck-Uptime-Kuma

xhr poll error on intranet domain

wortkrieg opened this issue · 8 comments

Hi there,

I tried to spin this up on our uptime kuma. Two things could be the problem:

  • it runs on an intranet resource
  • XHR header missing -> chromium blocking Request due to CORS policy.

When trying to connect to my domain http://uptime.xy.intranet/ in the PI, I get "xhr poll error".

PI-error

Having a look at the debugger I get:
devtools

Let me know if more information required.

Can you test with https://uptime.marlburrow.io (with any credentials)
and tell me if you have the CORS error.

If you don't see xhr poll error, this is probably a server related issue that I need to investigate (CORS header not sent in the response).

Give me the version of your Uptime Kuma (Docker tag of the image used).

And do you use a reverse proxy in front of your kuma ?

Thanks

Hi there,

Updated plugin to 1.1.2, tested it with https://uptime.marlburrow.io, same result: xhr poll error. Should that work? If yes, then it could be me I guess.

I use the latest kuma version, tag is louislam/uptime-kuma:1 - last pulled 6 days ago. No reverse proxy.

Yes it should work, and you should see authentication failed like this:

CleanShot 2023-01-09 at 11 34 10

It's obviously not server related, because you have the same error with my server.
I feel like your internal chromium version is different, what version of the Streamdeck software are you using ?
Here is mine:
CleanShot 2023-01-09 at 11 38 23

Uptime Kuma is using the default CORS policy. I believe @wortkrieg's result is expected.

@MarlBurroW I think you can reproduce by using my instance:
https://status.kuma.pet/

@louislam thank you very much for your reply.

I'm not able to reproduce on your instance, the socket request is allowed without any CORS restrictions like on mine.

I agree this error is expected on an end-user browser, but I think the built-in Chromium instance integrated in the Streamdeck software have less CORS restrictions than classic browsers (probably to give more flexibility to developers)

Some users reported CORS issues on early major 6 of the Streamdeck Software.
See here: https://www.reddit.com/r/StreamDeckSDK/comments/yxm1zb/cors_issue_since_upgrading_to_v6/

So my guess is @wortkrieg hasn't the latest version of the Streamdeck software installed (Hope so).

Ok, updating stream deck software fixed the issue. Now I can connect to any instance without xhr failure. Shame on me for not checking my software version first. Good work, @MarlBurroW digging into reddit and finding this thread.

Thanks again for your report, I'll link this issue in the troubleshooting section (in README.md)

Just an FYI - OSX users using Mojave can't update to Stream Deck 6. Yes Mojave is outdated, initially being released in September 2018, but it's also the latest OSX that users of the also outdated cheesegrater Mac Pro's can upgrade to (without significant hacking). Using 5.3.3 I get the CORS error.