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

Data Loss with AndroidAPS-Nightscout via NSCLIENTV3, due to Nightscout starting without database connection #3276

Open
petervanrijt opened this issue Mar 24, 2024 · 0 comments

Comments

@petervanrijt
Copy link

Describe the bug
The AndroidAPS queue is lost when the Nightscout front-end starts without a proper database connection. This issue is observed after updating to AndroidAPS v3.2.0.0+ (currently at AndroidAPS v3.2.0.4) and Nightscout v15.0.2. See screenshots 1 and 2 below.

Expected behavior
AndroidAPS removes uploads from the queue even when there is an error message like 'NOT_FOUND DeviceStatus Error Cannot POST /api/v3/devicestatus'. The expected behavior is for AndroidAPS to only remove an upload from the queue if the upload was successful (see screenshot 3). It appears there is no (yet) control mechanism in AndroidAPS's NSCLIENTV3 that verifies whether an upload was successful before removing it from the queue.

My setup information
I am currently running nightscout/cgm-remote-monitor:15.0.2 on Docker with mongo:4.4.17-rc0, all on a Synology NAS. We use AndroidAPS 3.2.0.4 to upload data to Nightscout using websockets.

To Reproduce

  • Scenario 1 - data loss
    I shut down my Synology and then boot it. It automatically boots the Nightscout container and mongo database container. Most of the time, Nightscout starts up before the MongoDB database, leading to an error on the Nightscout front-end (as shown in screenshot 2). AndroidAPS polls frequently to check whether Nightscout is available and, if it is, starts processing the queue (despite the error on the front-end). The uploads in the queue are lost because AndroidAPS uploads data without being able to save it in the Nightscout database (screenshot 1).

  • Scenario 2 - data queued
    I shut down Synology and then boot it without starting the Nightscout container and mongo database container. AndroidAPS queues uploads until nightscout becomes available. No data is lost.

Screenshot 1
20240324 1640 AndroidAPS - NSCLIENT V3

Screenshot 2
20240324 1640 Nightscout site

Screenshot 3
20240324 2157 AndroidAPS - NSCLIENT V3 OK

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

1 participant