When I deploy the app using Streamlit Cloud I get an error for MongoDB database connection.
I setted the secret with the format
[mongo]
host = "xxx.mongodb.net"
port = 27017
username = "xxx"
password = "xxx"
And i’m trying to make the connection with:
client = pymongo.MongoClient(**st.secrets["mongo"])
I’ve added the IP 0.0.0.0/0 at the MongoDB network access but when i want to connect with the database i’m getting this error:
ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: neurochat.0snevsl.mongodb.net:27017: [Errno -5] No address associated with hostname (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 65df6d327d89f05c1d2bd82b, topology_type: Unknown, servers: [<ServerDescription ('neurochat.0snevsl.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('neurochat.0snevsl.mongodb.net:27017: [Errno -5] No address associated with hostname (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]>