nightscout / AndroidAPS

Opensource automated insulin delivery system (closed loop)
https://wiki.aaps.app
GNU Affero General Public License v3.0
713 stars 1.74k forks source link

[AAPS3.0_beta2] NSClient - io.socket.engineio.client.EngineIOException:xhr poll error - Seems to also have broken Nightscout #807

Closed old-square-eyes closed 2 years ago

old-square-eyes commented 2 years ago

Just installed beta 2 of NSClient 3.0. To get the build to work on my Mac M1, I had to add a new version of "Room" to the gradle build file.. Not sure if that's relevant.

NSClient opens on my S20 fine (had to uninstall prev version for it to install). I completed the wizard. Lots of errors in the logs.

Now my NS site has gone down, so this seems pretty nasty.

image image
old-square-eyes commented 2 years ago

Phew. I uninstalled NSClient, and reloaded the Nightscout Heroku Dynos and Nightscout came back.

old-square-eyes commented 2 years ago

Reinstalled NSClient and completed Wizard without NS creds. Then manually entered, and this time it started syncing status/BG. But eventually crashed the NS site again. Perhaps it's a internal server error at NS because it can't keep up with the sync?

old-square-eyes commented 2 years ago

Finally seems to be syncing. I turned off my two OpenAPS rigs and the NS API was able to keep up.

I see data in the history viewer. But not in the main graph. I'll see if there is more syncing. But I also can't select a Profile per https://github.com/nightscout/AndroidAPS/issues/808

old-square-eyes commented 2 years ago

I gave up. No plot on main graph. I went back to the old 2.X version and the plot immediately appeared.

MilosKozak commented 2 years ago

this is not enough info to be able help you

MilosKozak commented 2 years ago

where do you host NS?

old-square-eyes commented 2 years ago

Heroku / Atlas Mongo - Free. THis is probably the most common configuration so would need to be supported. I get this error with all my other clients disabled, so the load is 100% NSClient on the NS API. Might need some exponential pullback or manual rate limiting.

old-square-eyes commented 2 years ago

@MilosKozak would you consider enabling local BG collection from xDrip? It's something I have wanted anyway to keep the watch face and NSclient plot from NS lag.

savek-cc commented 2 years ago

@old-square-eyes did the event happen when adjusting the phone time for daylight savings time? (I saw the same errors but thought it might be due to altering time and timezone in anticipation for the time rewinding 1h (combo pump).

old-square-eyes commented 2 years ago

@savek-cc, I wasn't adjusting TZ, no. It's almost certainly a Heroku instance /dyno size thing. The API gets exhausted. I can only complete the sync by turning off all other clients and constantly restarting dynos and NSclient.

betees82 commented 2 years ago

I faced the same problem. Finally downgraded to NS client 2.8 and works ok. I'm not sure, but it might been related with profile switch. image

MilosKozak commented 2 years ago

i added option to slow down NS upload https://github.com/nightscout/AndroidAPS/commit/ae399f0bf5b40d81905dac979aba1153baede364

old-square-eyes commented 2 years ago

@MilosKozak is this in beta 3? I see no such option and a fresh install of beta 3 and I'm still getting the error. Also you mention NS upload. I'm pretty sure this is for data download. Sorry if I am stating the obvious.

under-control commented 2 years ago

same problem here, it worked like charm till yesterday, restarting does not help and I'm using build for MedLink (instead of RileyLink)

Screenshot_2021-11-06-10-26-26-741_info nightscout androidaps

under-control commented 2 years ago

Turns out it is caused by internet connection.

When connected to WiFi errors occurs, but then when switched to mobile Internet it connects right away and sends the data to NSClient.

old-square-eyes commented 2 years ago

That's interesting. I wonder if mobile data naturally has a slower request speed so NS doesn't get exhausted. I'll test. My WiFi is quite fast.

old-square-eyes commented 2 years ago

Fresh install / mobile data. It ran OK for a few minutes then same error for me.

old-square-eyes commented 2 years ago

Still having the no profile error too.

MilosKozak commented 2 years ago

OAPS doesn't support effective profile switches. you cannot make it working

old-square-eyes commented 2 years ago

@MilosKozak I think you may have misunderstood. I'm just trying to get NSclient working. Nothing to do with OpenAPS

MilosKozak commented 2 years ago

to activate profile you need data from AAPS at least until there will be effective profie switch support in NS

MilosKozak commented 2 years ago

NSClient cannot create effective profile switch but pumpcontrol could

old-square-eyes commented 2 years ago

@MilosKozak, I see. Well maybe I am mistaken. I assumed that my inability to select or otherwise apply a profile was the reason for no BG plot / NSClient IOB etc. Perhaps the issue is something else. Why then do I have no plot on the main screen? Per my screenshot and video in #808?

under-control commented 2 years ago

I think I found the source of problem and it's not just WiFi itself.

It was xiaomi setting that I turned off to not to restrict data usage, but it has to be ticked to work connect properly with NS.

image

old-square-eyes commented 2 years ago

@under-control I'm on samsung and have the issue with WiFi and mobile data. I'm 99% sure it's a rate limit / server error due to too many requests. Whatever setting you're using must simply be attenuating the rate or coincidentally working for some other reason.

old-square-eyes commented 2 years ago

Confirming this seems fixed in beta 5. Rate limit seems to be doing its thing.

paulosnsilva commented 2 years ago

I'm having this issue. I'm using AAPS v. 3.0.0.1 with NS v.14.2.5 hosted on 10be.de. On AAPS I have the "slowdown uploads" options active. I've tried several restarts on NS and on my phone too. I use NS to gather data and create medical reports for my doctor.

paulosnsilva commented 2 years ago

I've updated my AAPS to latest 3.1.0.3, but the issue persists. Error: ERROR: io.socket.engineio.client.EngineIOException: xhr poll error. I have 74896 pending records to submit. Maybe that is too much ? How do I reset it?

paulosnsilva commented 2 years ago

Just for future record, I got it to work again by resetting my NS db, and deleting all my data from AAPS, After clean install, it started to work as expected. Maybe my queue got a bit too fat.