Error happened when trying to save conversation tracker to 'SQLTrackerStore'

Hi! I run rasa on server and everything is fine, but when I not contact with bot near 1 - 2 days and then write message - an error occurs. In first message case - rasa works but without slots values. When I send next message - everything is fine. Can someone help me with this? Thanks!

ERROR rasa.core.tracker_store - Error happened when trying to save conversation tracker to ‘SQLTrackerStore’. Falling back to use the ‘InMemoryTrackerStore’. Please investigate the following error: (pymysql.err.OperationalError) (2006, “MySQL server has gone away (BrokenPipeError(32, ‘Broken pipe’))”)\

[SQL: SELECT events.id AS events_id, events.sender_id AS events_sender_id, events.type_name AS events_type_name, events.timestamp AS events_timestamp, events.intent_name AS events_intent_name, events.action_name AS events_action_name, events.data AS events_data\

FROM events WHERE events.sender_id = %(sender_id_1)s ORDER BY events.timestamp] [parameters: {‘sender_id_1’: ‘29:1VsseBqeMjy8JHer1EXM7vE7GElvg1WdXOvA_R7LhCDU42FZ6LmlFdWJ9b0pdTzlTnI6ZI-HdjidgKLYObBTC_w’}] (Background on this error at: http://sqlalche.me/e/e3q8).
DEBUG rasa.core.tracker_store - Tracker with sender_id '29:1VsseBqeMjy8JHer1EXM7vE7GElvg1WdXOvA_R7LhCDU42FZ
DEBUG rasa.nlu.classifiers.keyword_intent_classifier - KeywordClassifier matched keyword ‘progress’ to inte
DEBUG rasa.core.processor - Received user message ‘progress’ with intent '{‘name’: ‘process_listing’, 'conf
DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 2 events
DEBUG rasa.core.policies.memoization - Current tracker state [{‘slot_is_finished_process_listing_1’: 1.0, ’
DEBUG rasa.core.policies.memoization - There is a memorised next action ‘31’
DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core
DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_MemoizationPolicy

1 Like

We are also facing the same issue with MySQL Tracker Store. MySQL wait_timeout closes the connections if there is no activity for the configured timeout period (default 8 hours).

But, this problem should not be occurring if the connection pool is used. Can someone confirm whether the connection pool is being used or not for all the queries with tracker store?

Any help in this regard would be helpful!

We are facing exactly the same issue here with MySQL Tracker Store. Regular exceptions on user input with error broken pipe - hence the sql connection is lost somewhere or the connection timed out. Is there any solution or workaround yet?

Traceback (most recent call last): File “/usr/local/lib/python3.6/dist-packages/pymysql/connections.py”, line 713, in _write_bytes self._sock.sendall(data)

Did anyone solve this?

Having the same problem using postgresql as tracker store.

2020-08-06 18:04:11 ERROR    rasa.core.tracker_store  - Error happened when trying to save conversation tracker to 'SQLTrackerStore'. Falling back to use the 'InMemoryTrackerStore'. Please investigate the following error: sasl_plain_username required for PLAIN sasl.

@KabaninArtem Did you get any solution to this? facing the same issue at my end.

MySQLdb._exceptions.OperationalError: (2006, 'MySQL server has gone away') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 126, in send return self.gen.send(value) File "/usr/local/lib/python3.6/site-packages/socketio/asyncio_server.py", line 438, in _handle_event_internal r = await server._trigger_event(data[0], namespace, sid, *data[1:]) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__ return self.gen.send(None) File "/usr/local/lib/python3.6/site-packages/socketio/asyncio_server.py", line 466, in _trigger_event ret = await self.handlers[namespace][event](*args) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__ return self.gen.send(None) File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/socketio.py", line 190, in handle_message await on_new_message(message) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__ return self.gen.send(None) File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/channel.py", line 81, in handler await app.agent.handle_message(*args, **kwargs) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__ return self.gen.send(None) File "/usr/local/lib/python3.6/site-packages/rasa/core/agent.py", line 471, in handle_message return await processor.handle_message(message) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__ return self.gen.send(None) File "/usr/local/lib/python3.6/site-packages/rasa/core/processor.py", line 80, in handle_message tracker = await self.log_message(message, should_save_tracker=False) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__ return self.gen.send(None) File "/usr/local/lib/python3.6/site-packages/rasa/core/processor.py", line 150, in log_message tracker = self._get_tracker(message.sender_id)

Facing the same problem right now, any new on this matter ?

TIA

@jusce17 What is your current issue can you please elaborate more and what steps you are using?

@nik202 The bot is simply acting weird, either it wont reply or will reply the same message repeatedly

In the logs, I got the following message:

2021-09-21 18:42:30 ERROR rasa.core.tracker_store - Error happened when trying to save conversation tracker to 'SQLTrackerStore'. Falling back to use the 'InMemoryTrackerStore'. Please investigate the following error: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(255)

I must add that this bot (sometimes) deals with more than 1000 people per day

@jusce17 Try install psycopg2-binary and pymysql in your conda environment

pip install psycopg2-binary

pip install PyMySQL

Please even share the endpoints.yml for tracker store.

Or try mention this

tracker_store:
   type: SQL
   dialect: "mysql+pymysql"  # the dialect used to interact with the db
   url: "localhost"  # (optional) host of the sql db, e.g. "localhost"
   db: "rasa"  # path to your db
   username: "root"  # username used for authentication
   password: "root"  # password used for authentication

@nik202 it is not a test env, I am running it in production, on a docker container

@jusce17 add it in requirement.txt file in docker, that you can do it? yes or no?

@jusce17 I guess you update the tracker_store in endpoints? Yes or No?