Rytiggy / Glance

Mg/dL and mmol/L Fitbit watchface for CGM in the Cloud Group
https://glancewatchface.com
GNU General Public License v3.0
98 stars 68 forks source link

404 and 401 errors #193

Open fmontemorano opened 1 year ago

fmontemorano commented 1 year ago

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 commented 1 year ago

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

fmontemorano commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 ryanmasonjar@gmail.com

bernienightscout commented 1 year ago

is this problem solved now?

im using 10be too

Rytiggy commented 1 year ago

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 commented 1 year ago

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.