timoschlueter / nightscout-librelink-up

Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout.
MIT License
192 stars 246 forks source link

[error]: {"message":"invalid or expired jwt"} #62

Closed zanfirovidius closed 5 months ago

zanfirovidius commented 2 years ago

Hello,

Dose any of you have this problem?

[error]: {"message":"invalid or expired jwt"} [error]: getting libreLinkUpConnection: Cannot read properties of undefined (reading 'data')

xsen84 commented 2 years ago

got the same issue. last night there was another upgrade of librelink servers:

2022-08-24T05:15:00.398155+00:00 app[worker.1]: [info]: no authTicket.expires 2022-08-24T05:15:00.398295+00:00 app[worker.1]: [info]: renew token 2022-08-24T05:15:06.148526+00:00 app[worker.1]: [info]: Logged in to LibreLink Up 2022-08-24T05:15:06.284205+00:00 app[worker.1]: [error]: {"message":"invalid or expired jwt"} 2022-08-24T05:15:06.284825+00:00 app[worker.1]: [error]: getting libreLinkUpConnection: Cannot read properties of undefined (reading 'data')

svensson90 commented 2 years ago

Same here... Debug Log:

[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 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"} [error]: {"message":"invalid or expired jwt"} [error]: getting libreLinkUpConnection: Cannot read property 'data' of undefined [info]: Logged in to LibreLink Up [error]: Invalid authentication token. Please check your LibreLink Up credentials Cannot read property 'authTicket' of undefined [warn]: no authTicket.token [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 null"}

timoschlueter commented 2 years ago

Is this an ongoing problem? Are you getting data in the LibreLink Up mobile app? I noticed some missed measurements myself, but it worked itself out after the server outage last night had been resolved.

What region are you guys in?

svensson90 commented 2 years ago

DE / Germany ;-) I have tried many restarts. But the error is still there. LibreLink Up App is working.

svensson90 commented 2 years ago

I got it running. In region DE and maybe some others, you have to accept the new "End User Agreement".

  1. Open Libre Link Up Mobile App
  2. Logout
  3. Login again
  4. Accept the "End User Agreement"
  5. nightscout-librelink-up by @timoschlueter will get a new token and starts working

I got the current measurements in nightscout but in the log are still errors

[info]: Found 1 LibreLink Up connection. [info]: -> The following connection will be used: XXXXXXXX (Patient-ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX) [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 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"} [info]: Upload of 1 measurements to NightScout succeeded [info]: Received blood glucose measurement items [info]: Upload of 1 measurements to NightScout succeeded [info]: Upload of 1 measurements to NightScout succeeded [info]: Upload of 1 measurements to NightScout succeeded [info]: Upload of 1 measurements to NightScout succeeded [info]: Logged in to LibreLink Up [error]: Invalid authentication token. Please check your LibreLink Up credentials Cannot read property 'authTicket' of undefined [warn]: no authTicket.token [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 null"} [error]: {"message":"invalid or expired jwt"} [error]: getting libreLinkUpConnection: Cannot read property 'data' of undefined [info]: Logged in to LibreLink Up [error]: Invalid authentication token. Please check your LibreLink Up credentials Cannot read property 'authTicket' of undefined [warn]: no authTicket.token [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 null"} [error]: {"message":"invalid or expired jwt"} [error]: getting libreLinkUpConnection: Cannot read property 'data' of undefined [error]: "<!DOCTYPE html>\n\t<html>\n\t <head>\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t<meta charset=\"utf-8\">\n\t\t<title>Application Error</title>\n\t\t<style media=\"screen\">\n\t\t html,body,iframe {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t }\n\t\t html,body {\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t }\n\t\t iframe {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tborder: 0;\n\t\t }\n\t\t</style>\n\t </head>\n\t <body>\n\t\t<iframe src=\"//www.herokucdn.com/error-pages/application-error.html\"></iframe>\n\t </body>\n\t</html>" [info]: Upload of 0 measurements to NightScout succeeded

zanfirovidius commented 2 years ago

Is this an ongoing problem? Are you getting data in the LibreLink Up mobile app? I noticed some missed measurements myself, but it worked itself out after the server outage last night had been resolved.

What region are you guys in?

So, for the FR region i do receive values in LibreLinkUp app, and with @svensson90 mini hack not it works again (thank you)

xsen84 commented 2 years ago

I confirm too that @svensson90 's trick is working. Thanks

timoschlueter commented 2 years ago

It might be possible to automatically accept the terms from within the app. But this might be problematic. Updated terms and conditions might include parts that you might actually want to read (crazy, right?).

Maybe we should include a way for background acceptance as an opt-in feature via a ENV variable?

hightowe commented 1 year ago

I wanted to mention that I just had this exact problem on US servers today. I am very happy that Google led me to this ticket for a solution! Logging in/out of LibreLink Up mobile app allowed me to accept the new privacy policy and, as soon as I did that, nightscout-librelink-up resumed working properly.