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

Cannot upload treatments from xDrip+ after upgrading to v15 #8120

Closed
IndrekHaav opened this issue Oct 20, 2023 · 11 comments
Closed

Cannot upload treatments from xDrip+ after upgrading to v15 #8120

IndrekHaav opened this issue Oct 20, 2023 · 11 comments

Comments

@IndrekHaav
Copy link

Describe the bug
After upgrading Nightscout to v15.0.0, treatments entered in xDrip+ no longer appear in Nightscout. The following error shows up in system logs:

Oct 20 07:32:32 nightscout node[15154]: TypeError: api(...).save is not a function
Oct 20 07:32:32 nightscout node[15154]:     at Function.save (/opt/nightscout/lib/server/treatments.js:163:11)
Oct 20 07:32:32 nightscout node[15154]:     at /opt/nightscout/lib/api/treatments/index.js:196:22
Oct 20 07:32:32 nightscout node[15154]:     at Layer.handle [as handle_request] (/opt/nightscout/node_modules/express/lib/router/layer.js:95:5)
Oct 20 07:32:32 nightscout node[15154]:     at next (/opt/nightscout/node_modules/express/lib/router/route.js:137:13)
Oct 20 07:32:32 nightscout node[15154]:     at check (/opt/nightscout/lib/authorization/index.js:268:9)
Oct 20 07:32:32 nightscout node[15154]:     at runMicrotasks (<anonymous>)
Oct 20 07:32:32 nightscout node[15154]:     at processTicksAndRejections (node:internal/process/task_queues:96:5)

Other data like BG readings get uploaded without issue.

To Reproduce
Steps to reproduce the behavior:

  1. Enter new treatment in xDrip+
  2. Wait for it to show up in Nightscout
  3. Observe that it does not show up

Expected behavior
Treatments are uploaded to Nightscout and visible in the web UI as in previous versions.

Your setup information

  • Nightscout v15.0.0
  • Dexcom One, connected to Samsung phone running xDrip+, which is connected to Nightscout
  • Issue is not browser-specific
@WesSec
Copy link

WesSec commented Oct 20, 2023

Rollback to 14.2.6 seemed to work for me without any issues/loss of data. After the rollback i did a backfill (under advanced settings in the nightscout settings in xdrip+)

@sulkaharo
Copy link
Member

How are you hosting Nightscout? Curious if you made a full redeploy of the dependencies.

@WesSec
Copy link

WesSec commented Oct 20, 2023

I'm selfhosting via the docker container, so currently on nightscout/cgm-remote-monitor:14.2.6 . My mongo uses the :latest tag and i did not change anything there.

@sulkaharo
Copy link
Member

sulkaharo commented Oct 20, 2023

Right. You need to figure out how to update the node dependencies inside the container. That error basically implies the Mongo driver Nightscout is trying to load doesn't match the expected version.

@IndrekHaav
Copy link
Author

IndrekHaav commented Oct 20, 2023

How are you hosting Nightscout? Curious if you made a full redeploy of the dependencies.

I have Nightscout running in a Debian 12 LXC container. I also updated Node.js to v16, MongoDB is at v4.4. I did run npm install after pulling the v15.0.0 code from Github.

Edit: just to be safe, I nuked the node_modules directory and re-ran npm install. Still the same error when uploading treatments.

@bewest
Copy link
Member

bewest commented Oct 20, 2023

Duplicate? #8114

@IndrekHaav
Copy link
Author

Not sure. I did update to v15.0.1 but that didn't solve my issue. Editing profiles seemed to work, but I didn't try it on v15.0.0 before updating.

@bewest
Copy link
Member

bewest commented Oct 20, 2023

To investigate potential issues, I've deleted package-lock.json and node_modules/ and issued npm install. The difference in package-lock doesn't indicate any differences in the mongo dependency chain. Not sure what the issue is here, but I'm confident we removed the troublesome patches from 15.0.0 in 15.0.1, and it should behave identical to the dev branch before the merge of #8026. I recently tested on node 14, 16, and 18.

@IndrekHaav
Copy link
Author

I may have spoken too soon. Some treatments did show up after I manually sent older data from xDrip+ (as @WesSec mentioned in their first comment), perhaps I just didn't wait long enough.

I'll see how it behaves during normal use.

@IndrekHaav
Copy link
Author

Okay, looks like it's working with v15.0.1 after all. Sorry for the confusion.

@thedewi
Copy link

thedewi commented Apr 8, 2024

This is still an issue because:

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

5 participants