Skip to content
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

404 and 401 errors #193

Open
fmontemorano opened this issue Dec 16, 2022 · 9 comments
Open

404 and 401 errors #193

fmontemorano opened this issue Dec 16, 2022 · 9 comments

Comments

@fmontemorano
Copy link

The Glance watch face has been working great for over a year! I have been connecting my Versa 2 through a Heroku app.

But when I swtiched to a non-Heroku app, Glance started giving me a 404 error. I switched to Custom Data Source and now I can't seem to get data to flow.

This gives me a 404 error
https://MYSITE

This gives me a 401 error
https://MYSITE/pebble

This gives me a 401 error
https://MYSITE/pebble?token=readable-TOKEN

This gives me no error but also doesn't display data
https://MYSITE/api/v2/properties/

@ddellspe
Copy link
Contributor

You need to use:
https://MYSITE/api/v1/entries/sgv.json

@fmontemorano
Copy link
Author

fmontemorano commented Dec 16, 2022

Hmmm. This gives me a 401 error
https://MYSITE/api/v1/entries/sgv.json

For reference, I followed these steps: https://navid200.github.io/xDrip/docs/Nightscout/GoogleCloud.html

Previously I had tried railway.app but it gave me the same errors as mentioned above.

@ddellspe
Copy link
Contributor

ddellspe commented Dec 16, 2022

You might need to use:
https://ThisIsMyPassword@MYSITE/api/v1/entries/sgv.json

It seems the default configuration via google is completely password protected which is set up that way due to the AUTH_DEFAULT_ROLES being set to denied

@Rytiggy
Copy link
Owner

Rytiggy commented Dec 16, 2022

Hey! In your browser if you navigate to https://MYSITE/pebble what does the data look like? Could you send me it?

I know that there is an issue currently with some / all nightscout sites hosted on https://ns.10be.de where the modified version that they have isn't returning the bgs key on the json object which is what Glance uses.

@fmontemorano
Copy link
Author

Hey, @Rytiggy,

this https://MYSITE/pebble returns {"status":401,"message":"Unauthorized","description":"Invalid/Missing"}
this https://ACCESS_TOKEN@MYSITE/pebble returns "This site can’t be reached"
this https://API_SECRET@MYSITE/pebble returns "This site can’t be reached"

Would you like me to send you the MYSITE and ACCESS_TOKEN to your gmail so you can try it out?

Hey, @ddellspe

this https://ACCESS_TOKEN@MYSITE/api/v1/entries/sgv.json returns "This site can’t be reached"
this https://API_SECRET@MYSITE/api/v1/entries/sgv.json returns "This site can’t be reached"

@Rytiggy
Copy link
Owner

Rytiggy commented Dec 16, 2022

Sure but but please do not send me the access token you use. create a new one so you can kick me out after: https://nightscout.github.io/nightscout/security/#create-a-token

My email is [email protected]

@bernienightscout
Copy link

is this problem solved now?

im using 10be too

@Rytiggy
Copy link
Owner

Rytiggy commented Mar 8, 2023

I am not currently using nightscout, please report back if its working for you guys and if 10be has fixed the issue on their end.

@Stevio54
Copy link

Stevio54 commented Oct 6, 2023

So, for those looking at this, the problem is in the settings. If nightscout is set to "private" and requires a token for access, it would normally do this with something like this: https://mysite/pebble?token=MYTOKEN

This will not work here, because in the custom endpoint settings, it will add queryParams to the URL you provide it, and by default it adds "?count=47" which would create a URL like this:

https://mysite/pebble?token=MYTOKEN?count=47 which is a malformed url, it should be:

[https](https://mysite/pebble?token=MYTOKEN&count=47

emphasis on the ampersand there.

The quick workaround is to make your nightscout site public, if your comfortable with that and not require a token in the URL.

If I find some time I will try and build a pull request to fix this going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants