gh-davidr / NightscoutLoader

A Java application that can synchronize meter/pump data with Nightscout, offers a quick way to modify notes field in treatment data and includes deep trend analysis of this data.
32 stars 40 forks source link

Connectivity test fails because of new(?) mongodb uri #19

Closed starbuck93 closed 2 years ago

starbuck93 commented 3 years ago

When setting up Nightscout Loader for the first time, I'm getting this error:

**************************************************
* Testing connectivity to MongoDB for Nightscout *
**************************************************

Test Nightscout Failed.
Unable to connect to MongoDB

Nightscout Server(mongodb+srv://username:passwd@cluster0.mongodb.net/db_name?retryWrites=true&w=majority) DB Instance(dbname) Received the following error message:

uri needs to start with mongodb://-uri needs to start with mongodb://

My guess is that on these (relatively) new instructions, the uri for a mongodb has changed since the jar of Nightscout Loader was compiled.

Is it possible to let Nightscout Loader use mongodb+srv:// as the prefix?

jyaw commented 3 years ago

I'm having the same issue...

Legacy mlab URI (from NightscoutLoader install instructions): mongodb://my_mongo_user:my_mongo_pass@ds123.mongolab.com:123

Updated Atlas URI: mongodb+srv://nightscout:password@cluster0.xxxxx.mongodb.net/dbname?retryWrites=true&w=majority

Need to update connectivity test to handle new URI

gh-davidr commented 3 years ago

Some months back last year, I messaged out on the Facebook page asking for a kind volunteer to make a test Atlas environment available to me to test changes to Nightscout Loader. My daughter is fully independent now and no longer uses Nightscout at all, so I don't use this application.

I have limited time to update modify & test the Java code, so can only do so with someone with a representative test mongo db I can use.

jyaw commented 3 years ago

@gh-davidr i understand. I've already setup an environment and could perhaps debug? I'm a novice Java person but I imagine it might not be too difficult to see what's happening in the connect methods... if you do have time, you're welcome to test out with my Atlas db though, it's empty for now.

I don't use NS for real time therapy, since moving from openaps to control-iq, so it's not time sensitive for me.

gh-davidr commented 2 years ago

Resolved in latest release.