timoschlueter / nightscout-librelink-up

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

"failed to get last entry" Error #159

Closed patel8786 closed 3 months ago

patel8786 commented 3 months ago

Please can you assist with this error, I have only recently tried to use this but have not yet gotten past this error.

What I know so far is that if I use the wrong region it gives me the correct response. It also gets the correct patient but cannot get past this error. My daughter uses a Libre2 bluetooth version

XXX@cloudshell:~ (ns-librelinkup)$ docker run -e LINK_UP_USERNAME="XXX@gmail.com" -e LINK_UP_PASSWORD="XXX" -e LINK_UP_TIME_INTERVAL="1" -e LINK_UP_REGION="EU" -e NIGHTSCOUT_URL= "https://ns.XXX.eu" -e NIGHTSCOUT_API_TOKEN=$(echo -n "librelinku-XXX" | sha1sum | cut -d ' ' -f 1) -e LOG_LEVEL="info" timoschlueter/nightscout-librelink-up

nightscout-librelink-up@2.7.0 start-heroku node dist/index.js

[info]: Starting cron schedule: /1 * [info]: renew token [info]: Logged in to LibreLink Up [info]: Found 1 LibreLink Up connection. [info]: -> The following connection will be used: XXX XXX (Patient-ID: c1e75630-af85-11ed-XXX) [error]: getaddrinfo ENOTFOUND https /usr/src/app/dist/nightscout/apiv1.js:25 throw Error(failed to get last entry: ${resp.statusText}); ^

Error: failed to get last entry: undefined at Client.lastEntry (/usr/src/app/dist/nightscout/apiv1.js:25:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async createFormattedMeasurements (/usr/src/app/dist/index.js:236:47) at async uploadToNightScout (/usr/src/app/dist/index.js:257:35) at async main (/usr/src/app/dist/index.js:129:5)

timoschlueter commented 3 months ago

In your NIGHTSCOUT_URL variable, remove the "https://". That should resolve the issue :)

patel8786 commented 3 months ago

thank you so much!