pymongo.errors.ServerSelectionTimeoutError

Hello all! My app works locally but fails after I uploaded it. It is https://contentgenienetwork.com/ pymongo.errors.ServerSelectionTimeoutError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app). Traceback: File "/opt/venv/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script exec(code, module.dict) File "/app/content_genie_network.py", line 138, in <module> registration_page() File "/app/content_genie_network.py", line 102, in registration_page result = register_user(email, password, offer) File "/app/content_genie_network.py", line 31, in register_user if users.find_one({"email": email}): File "/opt/venv/lib/python3.8/site-packages/pymongo/collection.py", line 1506, in find_one for result in cursor.limit(-1): File "/opt/venv/lib/python3.8/site-packages/pymongo/cursor.py", line 1264, in next if len(self.data) or self._refresh(): File "/opt/venv/lib/python3.8/site-packages/pymongo/cursor.py", line 1155, in _refresh self.session = self.collection.database.client._ensure_session() File "/opt/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1823, in _ensure_session return self.start_session(True, causal_consistency=False) File "/opt/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1766, in __start_session self._topology._check_implicit_session_support() File "/opt/venv/lib/python3.8/site-packages/pymongo/topology.py", line 573, in _check_implicit_session_support self._check_session_support() File "/opt/venv/lib/python3.8/site-packages/pymongo/topology.py", line 589, in _check_session_support self._select_servers_loop( File "/opt/venv/lib/python3.8/site-packages/pymongo/topology.py", line 259, in _select_servers_loop raise ServerSelectionTimeoutError(
Solution:
have you whitelisted all ips in mongo atlas?
Jump to solution
10 Replies
Percy
Percy10mo ago
Project ID: fc413648-b0c7-4175-ace0-6a2a19a6cc97
wtaylorjr2001
wtaylorjr2001OP10mo ago
project ID fc413648-b0c7-4175-ace0-6a2a19a6cc97
Solution
Brody
Brody10mo ago
have you whitelisted all ips in mongo atlas?
wtaylorjr2001
wtaylorjr2001OP10mo ago
No I didn't.
Brody
Brody10mo ago
please do that
wtaylorjr2001
wtaylorjr2001OP10mo ago
pending ok I got it to work the registration step, it took adding ssl and tds I need to test if it is because of the network change Whitelisting all addresses is not secure right?
Brody
Brody10mo ago
theres not really any other straight forward option, railway doesnt provide static ips yet
wtaylorjr2001
wtaylorjr2001OP10mo ago
Thank you
Want results from more Discord servers?
Add your server