nightscout / nightscout-connect

Single entry point for bridging cloud resources containing diabetes data to Nightscout.
GNU Affero General Public License v3.0
31 stars 33 forks source link

Glooko: Request failed with status code 432 #39

Open fabkai opened 8 months ago

fabkai commented 8 months ago

Hello everyone,

Since the beginning of December 2023, I no longer see any values from Glooko in Nightscout. Everything worked before, but Glooko seems to have changed something, as retrieving the data fails with an error 432. The login etc. works, only the retrieval of the data seems to have changed:

event: {
type: 'error.platform.phase.Fetching:invocation[0]',
data: AxiosError: Request failed with status code 432
at settle (/node_modules/axios/dist/node/axios.cjs:1913:12)
at IncomingMessage.handleStreamEnd (/node_modules/axios/dist/node/axios.cjs:2995:11)
at IncomingMessage.emit (node:events:526:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ERR_BAD_REQUEST',
config: [Object],
request: [ClientRequest],
response: [Object]
},

Is there anything known here?

Thanks and best regards Fabian

Kaiz3n-M commented 7 months ago

I'm getting the same issue, any updates?

tbender commented 7 months ago

Have the same issue, also starting somewhere in December. Up to now I was not able to find a solution.

botanicz commented 7 months ago

Hello Ben ,

according to your advertise i bought vision last week ! it is a great help but it would be even better if camaps useres can get their insulin data into nightscout . i tried nightscout connect but unfortunately it did not work .

i have copid some code out of my log maybe this helps to find out what is wrong .

FETCHING GAPS INFORMATION GLOOKO FETCHER LOADING /api/v2/pumps/scheduled_basals?patient=eu-central-1-red-xxx&startDate=2024-02-10T12:58:03.637Z&endDate=2024-02-12T12:58:03.637Z GLOOKO FETCHER LOADING /api/v2/pumps/normal_boluses?patient=eu-central-1-red-xxx&startDate=2024-02-10T12:58:03.637Z&endDate=2024-02-12T12:58:03.638Z GLOOKO FETCHER LOADING /api/v2/cgm/readings?patient=eu-central-1-red-xxx&startDate=2024-02-10T12:58:03.637Z&endDate=2024-02-12T12:58:03.638Z FRAME ERROR { context: { retries: 1, duration: 0, session: { cookies: '_logbook-web_session=jxxx%3D; domain=.glooko.com; path=/; secure; HttpOnly', user: [Object] }, last_known: { entries: 2023-11-29T09:12:49.718Z }, diagnostics: {}, started: 1707742683008, startedWaiting: 1707742683374, endedWaiting: 1707742683631, elapsedWaiting: 257 }, event: { type: 'error.platform.phase.Fetching:invocation[0]', data: AxiosError: Request failed with status code 432 at settle (/node_modules/axios/dist/node/axios.cjs:1913:12) at IncomingMessage.handleStreamEnd (/node_modules/axios/dist/node/axios.cjs:2995:11) at IncomingMessage.emit (node:events:526:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'ERR_BAD_REQUEST', config: [Object], request: [ClientRequest], response: [Object] }, toString: [Function (anonymous)] } }

i would really appreciate your help concerning this feature .... Felix

fabkai commented 7 months ago

@bewest Thank you for your hard work on this extension. I would be very happy if we could find a solution to this issue. The connection between Nightscout and Glooko was very useful and helped a lot in everyday life.

afly007 commented 6 months ago

Having the same issue with a new attempt to use this integration. Are there any suggestions on how to resolve this?

fabkai commented 6 months ago

@bewest I don't want to be annoying, but is there any chance that you could look into the problem? I really miss the function to view the values from Glooko in Nightscout.

schorschl commented 4 months ago

I have the exact same error message in the logs as @botanicz and @fabkai mentioned. "AxiosError: Request failed with status code 432"

Authentication works after adjusting the index.js file but now I do not get any data from Glooko.

schorschl commented 4 months ago

I think I found the solution: Look for function fetcher (endpoint) {

in the index.js file and change the 'headers["Host"]' from "eu.api.glooko.com" to "de-fr.api.glooko.com"

The error message is gone and so far I can see "temp basal" rate changes and boluses.

tbender commented 4 months ago

I think I found the solution: Look for function fetcher (endpoint) {

in the index.js file and change the 'headers["Host"]' from "eu.api.glooko.com" to "de-fr.api.glooko.com"

The error message is gone and so far I can see "temp basal" rate changes and boluses.

It works! Thx for sharing!

schorschl commented 4 months ago

It works! Thx for sharing!

...and now it doesn't work any more. It just catches some items but not all the time. Did not have the time yet to check the logs. Maybe it has something to do with the timestamp / timeframe based requests.

zehnBE commented 4 months ago

on our site, the change of hostname in the Headers works: FETCHING GLOOKO passing batch for transforming GLOOKO data transformation complete, returning 143 treatments

Better is to use the var "CONNECT_GLOOKO_SERVER", then it is the same as the User use or?

tbender commented 4 months ago

on our site, the change of hostname in the Headers works: FETCHING GLOOKO passing batch for transforming GLOOKO data transformation complete, returning 143 treatments

Better is to use the var "CONNECT_GLOOKO_SERVER", then it is the same as the User use or?

Completely agree. I took the server from the opts structure:

function fetcher (endpoint) { var headers = default_headers; headers["Cookie"] = session.cookies; headers["Host"] = opts.glookoServer; headers["Sec-Fetch-Dest"] = "empty";