How to get webchat working in docker?

I got my 5 rasa chatbots running in different docker containers but when I try use webchat it fails. I can run rasa with webchat in normal linux server.

I don’t get error messages, just no webchat chat window.

Here is command I run

docker run --name=rasa1 --user 1000 -v $(pwd):/app rasa/rasa:1.10.11-full run -m models --enable-api --cors “*” --debug

Here is my environment
Ubuntu 18.04
Docker 19.03.12

@InnoOmnia For WebChat you must be using socket.io. Have you enabled socket.io in credentials.yml?

Thanks,

also correction, I get error message:
“Unable to connect
Firefox can’t establish a connection to the server at localhost:5005.”

Here are my files
credentials.yml

socketio:
user_message_evt: user_uttered
bot_message_evt: bot_uttered
session_persistence: true

and index.html

<!doctype html>

// you can add a version tag if you need, e.g for version 0.11.5 https://cdn.jsdelivr.net/npm/rasa-webchat@0.11.5/lib/index.min.js

Hello @InnoOmnio and @a-anand-91119

First day in RasaX. It’s working,

I have logged in. +1

I am testing locally with:

docker-compose up

and I also added socketio to credentials.yml as @InnoOmnia did.

I am getting this Error in app_1 container:

INFO:sanic.root:Goin' Fast @ http://0.0.0.0:5055
INFO:sanic.root:Starting worker [1]
ERROR:sanic.root:Exception occurred while handling uri:
  'http://172.24.0.9:5055/socket.io/?EIO=3&transport=polling&t=NHHz8Jc'
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 940, in handle_request
    handler, args, kwargs, uri, name = self.router.get(request)
  File "/opt/venv/lib/python3.7/site-packages/sanic/router.py", line 411, in get
    return self._get(request.path, request.method, "")
  File "/opt/venv/lib/python3.7/site-packages/sanic/router.py", line 475, in _get
    raise NotFound("Requested URL {} not found".format(url))
sanic.exceptions.NotFound: Requested URL /socket.io/ not found

and

rasa_rasa-worker_1 exited with code 132
rasa_rasa-production_1 exited with code 132

How can I pass those params to the docker-compose to the specific container?

-m models --enable-api --cors “*” --debug

I am a little lost, don’t know where to start to tackle this issue.

Should I ask another question? Related to the error.

Regards.

I’m using Rasa open source, not Rasa X and if you are using Rasa X then you don’t need that command chain. If you use Rasa open source then why you need docker-compose then?

Umm, Maybe I should just work with Rasa.

Although, it would be great if I could solve this to prove it.

which docker do you use? this?

https://hub.docker.com/r/rasa/rasa-sdk

Thanks in advance @InnoOmnio

Please cross check the webchat code with the one below.

<script src="https://cdn.jsdelivr.net/npm/rasa-webchat/lib/index.min.js"></script>
    <script>
        WebChat.default.init({
            selector: "#webchat",
            initPayload: "/get_started",
            customData: {
                "language": "en"
            },
            socketUrl: "http://localhost:5005",
            socketPath: "/socket.io/",
            inputTextFieldHint: "Type your message",
            showFullScreenButton: true,
            displayUnreadCount: true,
            showMessageDate: true,
            params: {
                "storage": "session"
            }
        });
    </script>

And also check whether the socketio end point is available

Could you elaborate on this statement? If your question was on how to pass arguments to rasa server from Docker, then use the below command in your Dockerfile

CMD [ "run","-m","/models","--enable-api","--cors","*","--debug" ]

SocketIO doesn’t need any params to be specified to the rasa server. Just provide the config in credentials.yml file and you can connect using the /socket.io endpoint.

@a-anand-91119 thanks.

I am following this doc instructions and my docker-compose.yml doesn’t have rasa_server.

I think these are all the images I am pulling.

2020-09-03_10:50:22_

And I forgot this error:

rasa-x_1 | WARNING:rasax.community.services.model_service:Could not run model discovery.

@a-anand-91119

what instructions did you follow?

to check the docker-compose.yml.

I forgot to mention: Ubuntu 20.04

python3 --version && docker -v && docker-compose -v
Python 3.8.2
Docker version 19.03.12, build 48a66213fe
docker-compose version 1.26.0, build d4451659

I’m not using Rasa-X. I wrote a docker-compose my self for rasa server, actions, nginx, and a node app for webchat. The image I’ve shared is from that setup.

I have one server setup with Rasa-X and its working properly. These are the steps I’ve used. Could you try them?

sudo apt update && sudo apt upgrade
curl -sSL -o install.sh https://storage.googleapis.com/rasa-x-releases/0.32.0/install.sh
sudo bash ./install.sh
cd /etc/rasa
sudo docker-compose up -d
sudo python3 rasa_x_commands.py create --update admin me <ADMIN_PASSWORD>

For Rasa Actions Server execute the following steps from /etc/rasa

sudo mkdir actions
sudo touch actions/__init__.py
sudo nano actions/actions.py
    COPY actions.py code to this file
sudo nano docker-compose.override.yml

Contents of docker-compose.override file

version: '3.4'
services:
  app:
    image: 'rasa/rasa-sdk:latest'
    volumes:
      - './actions:/app/actions'
    expose:
      - '5055'
    depends_on:
      - rasa-production

And start the containers

sudo docker-compose up -d

Yes @a-anand-91119, I did it. It works, I can log in, but I am having the errors uploaded.

I have tested the @InnoOmnia command an this (below)

a little simpler and get Exited (132) in both case.

docker run --name=rasa12 --user 1001 rasa/rasa:1.10.12-full run --enable-api --cors “*” --debug
Exited (132) 7 seconds ago

It is wierd.

Can you share the full traceback?

It could have something to do with the CPU and AVX Instructions.The default Tensorflow build might not be able to run on old CPUs that does not support AVX instructions. See docs.

Please see this article too.

Can you verify this?

I guess we have a Mystery solved. That’s the problem.

2020-09-03_23:20:40_

Thanks @a-anand-91119

1 Like