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

Uploading values to nigtscoutpro fails #96

Closed
ConstantinSchreiber opened this issue Jun 6, 2023 · 3 comments
Closed

Uploading values to nigtscoutpro fails #96

ConstantinSchreiber opened this issue Jun 6, 2023 · 3 comments

Comments

@ConstantinSchreiber
Copy link

Hi @timoschlueter,

first off thanks a lot for open sourcing your sync script! This really seems to be the only viable option out there to get the Libre 3 values synched to Nightscout - really appreciate it.

I've deployed the script on heroku and pulling the values from librelink seems to work but I'm getting an auth error trying to upload to nightscout.

I'm running a hosted nightscout instance on nightscoutpro.com. I've already double checked the credentials and tried disabling HTTPS.

This is the debug log output:

2023-06-06T18:25:00.226203+00:00 app[worker.1]: [info]: renew token 2023-06-06T18:25:00.590834+00:00 app[worker.1]: [info]: Logged in to LibreLink Up 2023-06-06T18:25:00.591059+00:00 app[worker.1]: [debug]: authenticatedHttpHeaders: {"User-Agent":"FreeStyle LibreLink Up NightScout Uploader","Content-Type":"application/json","version":"4.2.2","product":"llu.ios","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Pragma":"no-cache","Cache-Control":"no-cache","Authorization":"REDACTED"} 2023-06-06T18:25:00.697273+00:00 app[worker.1]: [info]: Found 1 LibreLink Up connection. 2023-06-06T18:25:00.697483+00:00 app[worker.1]: [info]: -> The following connection will be used: Constantin Schreiber (Patient-ID: 75f90586-03a0-11ee-a4fb-0aeb61c9dc79) 2023-06-06T18:25:00.697548+00:00 app[worker.1]: [debug]: authenticatedHttpHeaders: {"User-Agent":"FreeStyle LibreLink Up NightScout Uploader","Content-Type":"application/json","version":"4.2.2","product":"llu.ios","Accept-Encoding":"gzip, deflate, br","Connection":"keep-alive","Pragma":"no-cache","Cache-Control":"no-cache","Authorization":"Bearer REDACTED"} 2023-06-06T18:25:00.936048+00:00 app[worker.1]: [error]: {"status":401,"message":"Unauthorized","description":"Invalid/Missing"} 2023-06-06T18:25:00.937174+00:00 app[worker.1]: [info]: Trying to upload 140 glucose measurement items to Nightscout 2023-06-06T18:25:01.027178+00:00 app[worker.1]: [error]: {"status":401,"message":"Unauthorized","description":"Invalid/Missing"} 2023-06-06T18:25:01.027455+00:00 app[worker.1]: [error]: Upload to NightScout failed

Any ideas?

@timoschlueter
Copy link
Owner

Hi @ConstantinSchreiber lets find out what's causing this:

How did you generate the API Token for Nightscout? A lot of users had issues with using the Admin-Token instead of a newly created Nightscout Token for a "subject". Have you created a new subject within Nightscouts Admin Tools and used the generated token in the environment variable?

Could you maybe share your set environment variables? With privacy relevant information redacted of course! :)

@ConstantinSchreiber
Copy link
Author

@timoschlueter you're a legend!

The issue was exactly what you've outlined. After creating a new subject and using the accompanying token everything works like a charm now. Thanks a lot!

@timoschlueter
Copy link
Owner

awesome! Glad I could help :)

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

2 participants