Installation Rasa X

ricwo
(Carlo Baumann) #1

Hi there

First of all, a big thank you to the rasa team. As far you did a great job.

I use rasa for a university project. We “develop” a chat bot for trainees. We started with rasa-nlu, rasa-core and action-server. As soon as you launched rasa 1.0, we also moved to rasa-x as we saw that we can use it for testing and training. Now we wanted to install rasa-x on a ubuntu server. We are struggling with the installation. These are the problems, where we couldn’t find a solution in the docs or in the forum.

  1. After the installation we cannot login via the user interface. “Not all required fields are filled”. We saw that other users had the same problems. A direct login via url /login?username=admin&password=admin12345 works as workaround.
  2. How can we import an existing model from localhost. The curl command doesn’t work.
curl -k -F "model=@20190522-224028.tar.gz" http://86.119.39.164/api/projects/default/models\?api_token\=69e3a8f18abbd42a1c514a2bd704edcef195bdd8
    <h1>Internal Server Error</h1>
    <p>
        The server encountered an internal error and cannot complete
        your request.
    </p>
  1. How can we import existing stories.md and nlu.md?
  2. We also have the problem that the rasa-x bot is not responding. In the logs we retrieve 500.
    rasa-production_1  | [2019-06-03 20:17:57 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://rasa-production:5005/webhooks/rasa/webhook'
    rasa-production_1  | Traceback (most recent call last):
    rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 917, in handle_request
    rasa-production_1  |     response = await response
    rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/channel.py", line 430, in receive
    rasa-production_1  |     sender_id = await self._extract_sender(request)
    rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/rasa_chat.py", line 50, in _extract_sender
    rasa-production_1  |     user = await self._check_token(req.headers.get("Authorization"))
    rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/rasa_chat.py", line 38, in _check_token
    rasa-production_1  |     return await resp.json()
    rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 1027, in json
    rasa-production_1  |     headers=self.headers)
    rasa-production_1  | aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html'
    rasa-x_1           | Failed to send message to Rasa Chat webhook with status 500. Response:
    rasa-x_1           |
    rasa-x_1           |     <h1>Internal Server Error</h1>
    rasa-x_1           |     <p>
    rasa-x_1           |         The server encountered an internal error and cannot complete
    rasa-x_1           |         your request.
    rasa-x_1           |     </p>

Can you help me/us to install and configure rasa-x?

(Jean Yves) #2

Hello @bananenhoschi,

I had the same issues, maybe this can help you :

  1. The username input field is type=“hidden”, you can remove the ‘type’ attribute by editing the HTML to fill the full form. I think, using the URL /login?username=xxxx&password=yyyy is the right thing to do though.
  2. Curl command (when the current directory is the one where is located the model) is working for me. I could send a trained Rasa X model. Maybe a backward compatibility issue ?
  3. For NLU : Go to NLU training page, click on training data page then on the top right corner, click on the arrow facing up. It doesn’t look like there is a way to import stories yet.
  4. Can’t help you for that but I can show you the simple Dockerfile I’m using for testing:

# Base image

FROM python:3.6

# Install Rasa-X

RUN pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple

# Init Rasa

RUN mkdir -p /app/rasa/projects/

WORKDIR /app/rasa/projects/

RUN rasa init --no-prompt

# Expose port

EXPOSE 5002

Then start it with:

$hostOS> docker run -p 5002:5002 -it rasa-local bash

Then start rasa X:

$container> rasa x

(Carlo Baumann) #3

Continuing the discussion from Installation Rasa X:

Oh. Thats sounds nice. Thank you! I will try it and give you feedback. @Rasa is (1.) a known issue?

1 Like
(Carlo Baumann) #4

So far I could import the model (via scp) and import the nlu. As not further documented I think the stories have either to be created manual or maybe via sql-statements.

The only issue I’m struggling with is that bot is not responding.

rasa-production_1  | [2019-06-04 11:31:11 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://rasa-production:5005/webhooks/rasa/webhook'
rasa-production_1  | Traceback (most recent call last):
rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 917, in handle_request
rasa-production_1  |     response = await response
rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/channel.py", line 430, in receive
rasa-production_1  |     sender_id = await self._extract_sender(request)
rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/rasa_chat.py", line 50, in _extract_sender
rasa-production_1  |     user = await self._check_token(req.headers.get("Authorization"))
rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/rasa/core/channels/rasa_chat.py", line 38, in _check_token
rasa-production_1  |     return await resp.json()
rasa-production_1  |   File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 1027, in json
rasa-production_1  |     headers=self.headers)
rasa-production_1  | aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html'
rasa-x_1           | Failed to send message to Rasa Chat webhook with status 500. Response:
rasa-x_1           |
rasa-x_1           |     <h1>Internal Server Error</h1>
rasa-x_1           |     <p>
rasa-x_1           |         The server encountered an internal error and cannot complete
rasa-x_1           |         your request.
rasa-x_1           |     </p>
rasa-x_1           |
rasa-x_1           | [2019-06-04 11:31:11 +0000] - (sanic.access)[INFO][172.18.0.9:38608]: POST http://86.119.39.164/api/chat?environment=production  404 178
(Jean Yves) #5

Looks like your UI cannot reach your production server (http://86.119.39.164/api/chat?environment=production 404). Also there is a problem with your API http://rasa-production:5005/webhooks/rasa/webhook expecting JSON type and receiving HTML instead.

Are you trying to plug a <1.0 version of Rasa Core with Rasa X ?

(Carlo Baumann) #6

I followed the quick-installation guide. So I use the stable version of rasa-x.

(ricwo) #7

This is a known issue and will be fixed in the next release. In the meantime can you please modify your credentials.yml to contain the following:

rasa:
  url: ${RASA_X_HOST}/api

and see if that works? You’ll have to restart Rasa X with sudo docker-compose down && sudo docker-compose up -d