I tried to connect my shiny app to mongodb server. I deployed app on shinyapps.io but got error again and again:
2019-10-22T18:14:14.694520+00:00 shinyapps[1117463]: Listening on http://127.0.0.1:36739
2019-10-22T18:14:36.665309+00:00 shinyapps[1117463]: Warning: Error in : No suitable servers found (`serverSelectionTryOnce` set): [socket timeout calling ismaster on 'seaport-shard-00-01-rysq4.gcp.mongodb.net:27017'] [socket timeout calling ismaster on 'seaport-shard-00-02-rysq4.gcp.mongodb.net:27017'] [socket timeout calling ismaster on 'seaport-shard-00-00-rysq4.gcp.mongodb.net:27017']
2019-10-22T18:14:36.670320+00:00 shinyapps[1117463]: 61: mongo_collection_command_simple
2019-10-22T18:14:36.670321+00:00 shinyapps[1117463]: 60: mongo
2019-10-22T18:14:36.670322+00:00 shinyapps[1117463]: 59: server [/srv/connect/apps/Seaport/app.R#223]
2019-10-22T18:14:36.670413+00:00 shinyapps[1117463]: Error : No suitable servers found (`serverSelectionTryOnce` set): [socket timeout calling ismaster on 'seaport-shard-00-01-rysq4.gcp.mongodb.net:27017'] [socket timeout calling ismaster on 'seaport-shard-00-02-rysq4.gcp.mongodb.net:27017'] [socket timeout calling ismaster on 'seaport-shard-00-00-rysq4.gcp.mongodb.net:27017']
More interesting what this app works great locally on my PC and moreover it worked fine on shinyapps last 2 weeks.
I tried to deploy app with standard connections string:
Data <- mongo(collection = 'Data',
db = 'MaterialSeaport',
url = 'mongodb+srv://<USER>:<PASSWORD>@seaport-rysq4.gcp.mongodb.net/test?retryWrites=true&w=majority')
With adding scram sha option:
Data <- mongo(collection = 'Data',
db = 'MaterialSeaport',
url = 'mongodb+srv://<USER>:<PASSWORD>@seaport-rysq4.gcp.mongodb.net/test?retryWrites=true&w=majority&authMechanism=SCRAM-SHA-1')
And with old connection string:
Data <- mongo(collection = 'Data',
db = 'MaterialSeaport',
url = 'mongodb://<USER>:<PASSWORD>@seaport-shard-00-00-rysq4.gcp.mongodb.net:27017,seaport-shard-00-01-rysq4.gcp.mongodb.net:27017,seaport-shard-00-02-rysq4.gcp.mongodb.net:27017/test?ssl=true&replicaSet=Seaport-shard-0&authSource=admin&retryWrites=true&w=majority')
How I can to connect my app with mongodb without this error?