RASA has problem with Oracle database

Hi

We have build a bot based on RASA 1.2.3.

We try to connect to an Oracle database. When we first time established a connection, we got the following exception:

Traceback (most recent call last):
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\asyncio\coroutines.py", line 126, in send
    return self.gen.send(value)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\socketio\asyncio_server.py", line 430, in _handle_event_internal
    r = await server._trigger_event(data[0], namespace, sid, *data[1:])
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\socketio\asyncio_server.py", line 458, in _trigger_event
    ret = await self.handlers[namespace][event](*args)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\channels\socketio.py", line 182, in handle_message
    await on_new_message(message)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\channels\channel.py", line 81, in handler
    await app.agent.handle_message(*args, **kwargs)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\agent.py", line 488, in handle_message
    return await processor.handle_message(message)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\processor.py", line 80, in handle_message
    tracker = await self.log_message(message)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\processor.py", line 132, in log_message
    tracker = self._get_tracker(message.sender_id)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\processor.py", line 530, in _get_tracker
    return self.tracker_store.get_or_create_tracker(sender_id)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\tracker_store.py", line 76, in get_or_create_tracker
    tracker = self.create_tracker(sender_id)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\tracker_store.py", line 95, in create_tracker
    self.save(tracker)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\rasa\core\tracker_store.py", line 491, in save
    self.session.commit()
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\session.py", line 1027, in commit
    self.transaction.commit()
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\session.py", line 494, in commit
    self._prepare_impl()
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\session.py", line 473, in _prepare_impl
    self.session.flush()
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\session.py", line 2470, in flush
    self._flush(objects)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\session.py", line 2608, in _flush
    transaction.rollback(_capture_exception=True)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\util\langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\util\compat.py", line 153, in reraise
    raise value
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\session.py", line 2568, in _flush
    flush_context.execute()
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 422, in execute
    rec.execute(self)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 589, in execute
    uow,
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\persistence.py", line 245, in save_obj
    insert,
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\orm\persistence.py", line 1137, in _emit_insert_statements
    statement, params
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\engine\base.py", line 982, in execute
    return meth(self, multiparams, params)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\sql\elements.py", line 287, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\engine\base.py", line 1101, in _execute_clauseelement
    distilled_params,
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\engine\base.py", line 1250, in _execute_context
    e, statement, parameters, cursor, context
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\engine\base.py", line 1476, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\util\compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\util\compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\engine\base.py", line 1246, in _execute_context
    cursor, statement, parameters, context
  File "c:\users\301742\appdata\local\continuum\anaconda3\envs\chatbot_de\lib\site-packages\sqlalchemy\engine\default.py", line 581, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (cx_Oracle.IntegrityError) ORA-01400: Einfugen von NULL in ("KI_MODELLE_TEST"."EVENTS"."ID") nicht moglich

Last sentence translated into english: (ORA-01400: cannot insert null)

The exception occurs because RASA auto generates a table with an ID column that has a not null constraint and is used as primary key. RASA tries to insert rows without ID.

We have fixed the problem with an auto incremented ID in the Oracle database. In some cases this works but we now have the problem that the bot occasionally stops. The last message that we receive in the log file is:

2019-12-04 11:29:22 DEBUG rasa.core.agent - Deleted lock for conversation 'b9ba00dd17c649cb90ddf26fe876933e' (unused)´

It seems that the bot is not able to establish a connection to the backend.

Can you please help us?

@Chatbot_Ra I assume you’re trying to connect the tracker store to Oracle? That’s not supported. Only the Rasa X database has compatibility with Oracle

I did not know that. As far as I know there are 2 different versions of Rasa X. One of them is Open Sourced. Are both version of Rasa X compatibile with Oracle or only the one I have to pay for?

I am missing a clear overview of the Rasa X versions and their differences. You have any link for it, please? EDIT: found it → RASA X

But no infos about the pricing… :frowning:

Thank you very much.

@Chatbot_Ra so the Rasa X database is compatible with Oracle, just not the SQLTrackerStore in Rasa Open Source. Also, Rasa X CE is not open source, but it’s free. Rasa Enterprise on the other hand is paid - you can get in touch with our sales team about that if you’re interested :slight_smile: