Rasa: Mongo tracker store documentation missing documentation of advanced configuration

Created on 20 Dec 2018  路  5Comments  路  Source: RasaHQ/rasa

Rasa Core version:
0.12.3
Python version:
3.6
Operating system (windows, osx, ...):
developing on Windows, in production on linux docker containers
Issue:
I am trying to use mongodb to record conversations from my chatbot for later use. I have created a mongodb database on Microsoft Azure with the below configuration:

tracker_store:
    store_type: mongod
    url: mongodb://fsdfsdfs.documents.azure.com:10255
    db: rasa_conversations
    username: fsdfsdfsdfdsfasff
    password: fsdifjsdlfjsdlfjasdlfjalsdfj

When I deploy my rasa_core docker container, I get the following timeout error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/app/rasa_core/run.py", line 250, in <module>
    None, _endpoints.tracker_store, _broker)
  File "/app/rasa_core/tracker_store.py", line 48, in find_tracker_store
    **store.kwargs)
  File "/app/rasa_core/tracker_store.py", line 209, in __init__
    self._ensure_indices()
  File "/app/rasa_core/tracker_store.py", line 216, in _ensure_indices
    self.conversations.create_index("sender_id")
  File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 1571, in create_index
    self.__create_index(keys, kwargs)
  File "/usr/local/lib/python3.6/site-packages/pymongo/collection.py", line 1459, in __create_index
    with self._socket_for_writes() as sock_info:
  File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.6/site-packages/pymongo/mongo_client.py", line 868, in _get_socket
    server = self._get_topology().select_server(selector)
  File "/usr/local/lib/python3.6/site-packages/pymongo/topology.py", line 214, in select_server
    address))
  File "/usr/local/lib/python3.6/site-packages/pymongo/topology.py", line 189, in select_servers
    self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: fsdfsdfs.documents.azure.com:10255: timed out

After some investigation, I think the problem is that the mongo tracker store doesn't give an option for ssl. Given many production grade mongo implementations use ssl, are there any plans to include it in Rasa?

Most helpful comment

@wochinge
Changing the url to mongodb://fsdfsdfs.documents.azure.com:10255/?ssl=true worked. (added on a slash at the end).

Perhaps a note should be added to the docs saying that you can add any arbitrary Mongo flag this way?

All 5 comments

@DMPS
Can you try to change the mongo url to mongodb://fsdfsdfs.documents.azure.com:10255?ssl=true (based on the guide here: http://api.mongodb.com/python/current/examples/tls.html#basic-configuration)

@wochinge
Changing the url to mongodb://fsdfsdfs.documents.azure.com:10255/?ssl=true worked. (added on a slash at the end).

Perhaps a note should be added to the docs saying that you can add any arbitrary Mongo flag this way?

@DMPS Yeah, that's a great idea :-)

I have added a simple note to the docs on the mongo tracker. Please review.

Updated documentation has been merged. Closing.

Was this page helpful?
0 / 5 - 0 ratings