Disconnection from RASA database tracker

Hello community,

We are facing disconnection issues from Tracker sending an SQL Alchemy Exception and the chatbot stop working. The main issue is that we have to reset the services manually each time.

We have got the following log from the system:

***2020-05-11 18:07:18,445 [ERROR]  An exception occured while handling user message 'hola'.***

***Traceback (most recent call last):***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\engine\result.py", line 724, in _getter***

***    getter = self._metadata._getter***

***AttributeError: 'NoneType' object has no attribute '_getter'***

***During handling of the above exception, another exception occurred:***

***Traceback (most recent call last):***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\channels\channel.py", line 459, in receive***

***    text, collector, sender_id, input_channel=input_channel***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\channels\channel.py", line 81, in handler***

***    await app.agent.handle_message(*args, **kwargs)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\agent.py", line 471, in handle_message***

***    return await processor.handle_message(message)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\processor.py", line 80, in handle_message***

***    tracker = await self.log_message(message, should_save_tracker=False)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\processor.py", line 150, in log_message***

***    tracker = self._get_tracker(message.sender_id)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\processor.py", line 552, in _get_tracker***

***    return self.tracker_store.get_or_create_tracker(sender_id)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\tracker_store.py", line 79, in get_or_create_tracker***

***    tracker = self.retrieve(sender_id)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\rasa\core\tracker_store.py", line 525, in retrieve***

***    .order_by(self.SQLEvent.timestamp)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\orm\query.py", line 3178, in all***

***    return list(self)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\orm\loading.py", line 105, in instances***

***    util.raise_from_cause(err)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\util\compat.py", line 398, in raise_from_cause***

***    reraise(type(exception), exception, tb=exc_tb, cause=cause)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\util\compat.py", line 153, in reraise***

***    raise value***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\orm\loading.py", line 65, in instances***

***    for query_entity in query._entities***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\orm\loading.py", line 65, in <listcomp>***

***    for query_entity in query._entities***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\orm\query.py", line 4199, in row_processor***

***    polymorphic_discriminator=self._polymorphic_discriminator,***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\orm\loading.py", line 405, in _instance_processor***

***    getter = result._getter(col, False)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\engine\result.py", line 726, in _getter***

***    return self._non_result(None)***

***  File "c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\site-packages\sqlalchemy\engine\result.py", line 1168, in _non_result***

***    "This result object does not return rows. "***

***sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically.***

---- O ----

There is any way to reconnect automatically to Tracker, or even better, there is any way to avoid this problem?

Thanks in advance,

hi @ClaudioArce, how is your tracker store set up, and which version are you running? as of 1.6 it should automatically fall back to the InMemoryTrackerStore if there is something wrong with your tracker store.

Hello @erohmensing I will check what you ask and I will answer you as soon as possible… thanks a lot.

Best, Claudio

Hello @erohmensing,

We have the 1.3.6 version of Rasa, is it possible update RASA without impact on our trained chatbot?, on the other hand, is it possible to fixed this issue without change the version ( I mean, keeping our current version of RASA)?

Our Tracker store set up is on Microsoft SQL Server 2016.

Hello @erohmensing,

Could you had a look at our question?

There is anything more that you need from our side in order to help us with this issue with Rasa?

Best regards, Claudio

@ClaudioArce Seems the database connection closed the connection. Are there any logs in the database, why this happened?