I’m new to data science and using streamlit. I wrote my script and it worked fine in localhost streamlit. Unfortunately, when I deployed to streamlit web, it there is an error. I tried to look for solutions but no success.
here is the error
Traceback (most recent call last):
File “/home/appuser/venv/lib/python3.7/site-packages/streamlit/scriptrunner/script_runner.py”, line 443, in _run_script
exec(code, module.__dict__)
File “/app/mongostreamapp/agazi.py”, line 123, in
list_cursor = list(all_records)
File “/home/appuser/venv/lib/python3.7/site-packages/pymongo/cursor.py”, line 1248, in next
if len(self.__data) or self._refresh():
File “/home/appuser/venv/lib/python3.7/site-packages/pymongo/cursor.py”, line 1139, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File “/home/appuser/venv/lib/python3.7/site-packages/pymongo/mongo_client.py”, line 1663, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File “/home/appuser/venv/lib/python3.7/site-packages/pymongo/mongo_client.py”, line 1608, in __start_session
self._topology._check_implicit_session_support()
File “/home/appuser/venv/lib/python3.7/site-packages/pymongo/topology.py”, line 519, in _check_implicit_session_support
self._check_session_support()
File “/home/appuser/venv/lib/python3.7/site-packages/pymongo/topology.py”, line 536, in _check_session_support
readable_server_selector, self._settings.server_selection_timeout, None
File “/home/appuser/venv/lib/python3.7/site-packages/pymongo/topology.py”, line 229, in _select_servers_loop
% (self._error_message(selector), timeout, self.description)
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 62739111470fd455e99343de, topology_type: Unknown, servers: [<ServerDescription (‘localhost’, 27017) server_type: Unknown, rtt: None, error=AutoReconnect(‘localhost:27017: [Errno 111] Connection refused’)>]>
I appreciate your kind help.
Thanks,
Tess