Jordan Wrong
Jordan Wrong

Reputation: 1245

Mongolite Suddenly Stopped Working On ShinyApps.io But Still Works On Local Disk

I have been hosting 2 applications on shinyapps.io for quite some time. Both applications pull from my mongoDB hosted on atlas.

Today when I tried to log into one of my applications I was greeted with this message: ERROR: An error has occurred. Check your logs or contact the app author for clarification.

Note* The second app that pulls from the same database but different collection is working perfectly.

I checked my logs and found where the error was. Here is the log file along with my code that corresponds to my error.

logs error:

Warning: Error in : No suitable servers found (`serverSelectionTryOnce` set): [socket timeout calling ismaster on 'jordandb-shard-00-00-ykcna.mongodb.net:27017'] [socket timeout calling ismaster on 'jordandb-shard-00-01-ykcna.mongodb.net:27017'] [socket timeout calling ismaster on 'jordandb-shard-00-02-ykcna.mongodb.net:27017']
2019-10-22T22:01:48.025720+00:00 shinyapps[1346681]:   64: mongo_collection_command_simple
2019-10-22T22:01:48.025722+00:00 shinyapps[1346681]:   63: mongo

Below is the code that reads in the data from my mongodb.

urlm = "mongodb://jordan:<mypassword>@jordandb-shard-00-00-ykcna.mongodb.net:27017,jordandb-shard-00-01-ykcna.mongodb.net:27017,jordandb-shard-00-02-ykcna.mongodb.net:27017/test?ssl=true&replicaSet=JordanDB-shard-0&authSource=admin&retryWrites=false"
eecurrent = mongo(collection = "EEcurrent", db = "test", url = urlm, verbose = T)
eehistory = mongo(collection = "EEhistory", db = "test", url = urlm, verbose = T)
passwords = mongo(collection  = "passwords", db = "test", url = urlm, verbose = T)

credentials = passwords$find()

This is what is causing the error. I am not to sure what happened as last night it was working perfectly!

Also on my local disk the app works great. I have tried restarting the application on shinyapps.io and republishing. Nothing seems to be working

Upvotes: 1

Views: 64

Answers (0)

Related Questions