Hello,
I have setup rasa-x on aws using docker compose, the container is working fine. I can connect to rasa-x from my browser.
I want to connect to the instance from chat widget, example: https://github.com/JiteshGaikwad/Chatbot-Widget
The widget uses http:host:5005
However the rasa-x setup on aws does not seem to have http port working. Above url returned nothing.
on looking on docker ps on aws:
ubuntu@i/etc/rasa$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
692fb330ff1b nginx:1.19 "/docker-entrypoint.…" 6 weeks ago Up 13 minutes 80/tcp, 0.0.0.0:80->8080/tcp, :::80->8080/tcp, 0.0.0.0:443->8443/tcp, :::443->8443/tcp rasa_nginx_1
51aaf03831a0 rasa/rasa-sdk:latest "./entrypoint.sh sta…" 6 weeks ago Up 13 minutes 5055/tcp rasa_app_1
e87ee9e4fee4 rasa/rasa:2.8.11-full "rasa x --no-prompt …" 6 weeks ago Up 13 minutes 5005/tcp rasa_rasa-worker_1
6fde7df15ac5 rasa/rasa:2.8.11-full "rasa x --no-prompt …" 6 weeks ago Up 13 minutes 5005/tcp rasa_rasa-production_1
48d1d2610657 rasa/rasa-x:0.42.4 "python -m rasax.com…" 6 weeks ago Up 13 minutes (healthy) 8000/tcp rasa_db-migration_1
61eff649cb74 rasa/rasa-x:0.42.4 "/tini -g -- sh -c '…" 6 weeks ago Up 13 minutes 5002/tcp rasa_rasa-x_1
227b66faf14a bitnami/postgresql:11.11.0 "/opt/bitnami/script…" 6 weeks ago Up 13 minutes 5432/tcp rasa_db_1
a5d45fdfe626 bitnami/rabbitmq:3.8.17 "/opt/bitnami/script…" 6 weeks ago Up 13 minutes 4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp rasa_rabbit_1
05b666f9c8f5 rasa/duckling:0.1.6.5-r2 "duckling-example-ex…" 6 weeks ago Up 13 minutes 8000/tcp rasa_duckling_1
f0727118c0ba bitnami/redis:6.2.4 "/opt/bitnami/script…" 6 weeks ago Up 13 minutes 6379/tcp rasa_redis_1
In case of my local setup, if I do http://localhost:5005 I get response from Rasa.
What do I need to do in the docker-compose setup to expose http port to integrate it with chatbot widget.
Hi, thanks for your reply.
8000 did not work.
I tried http://host_ip:8000
received:
Firefox can’t establish a connection to the server at 54.71.76.226:8000.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If I use http://host_ip:80
This connects to rasa-X
The connection to **https://26f3-52-12-70-138.ngrok.io** was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address **[localhost:8000](http://localhost:8000)**.
On the ngrok client, got
502 Bad Gateway
I believe the problem is in my rasa setup. Do I need to do anything in the config file?
in my credential.yml
rasa:
url: ${RASA_X_HOST}/api
rest:
Seems like some issue in my setup, is there any otherway we can check locally if the rest port is ready on vm
on ubuntu the listening ports:
Please make the necessary changes and spin the docker. I guess this time you will be able to see the bot on your website. Please let me know your progress and wish you and your family happy new year 2022. Good Luck!
@nik202
Happy new year to you too
I have setup rasa locally, but without docker-compose.
In my local rasa, I have only
rasa:
url: "http://localhost:5002/api"
rest:
In my local machine, I run rasa as rasa --enable-api --cors "*", this open listen port
rasa 1419618 abhishek 15u IPv4 16851007 0t0 TCP *:5005 (LISTEN)
I don’t think I need socketio, I need somehow to tell rasa to open in --enable-api model. this will probably open listen port too for 5005. I do not need socketio to connect to the aforementioned chatbot widget to the rasa. When we start Rasa, (I think) it opens up 5005 default port, that’s why I was expecting it to connect to 5005.
@nik202
First of all, thanks for all your replies.
“ngrok http 5005” does not help. I think ngrok can only help I guess, when 5005 is exposed out of docker containers. At present, no listen port is open on the host for 5005, so ngrok will not be able to help.
on the shell of AWS instance:
ubuntu@:~$ curl https://localhost:5005
curl: (7) Failed to connect to localhost port 5005: Connection refused
# Same for HTTP
I looked at sudo docker ps
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
692fb330ff1b nginx:1.19 "/docker-entrypoint.…" 7 weeks ago Up 2 hours 80/tcp, 0.0.0.0:80->8080/tcp, :::80->8080/tcp, 0.0.0.0:443->8443/tcp, :::443->8443/tcp rasa_nginx_1
51aaf03831a0 rasa/rasa-sdk:latest "./entrypoint.sh sta…" 7 weeks ago Up 2 hours 5055/tcp rasa_app_1
e87ee9e4fee4 rasa/rasa:2.8.11-full "rasa x --no-prompt …" 7 weeks ago Up 2 hours 5005/tcp rasa_rasa-worker_1
6fde7df15ac5 rasa/rasa:2.8.11-full "rasa x --no-prompt …" 7 weeks ago Up 2 hours 5005/tcp rasa_rasa-production_1
----- More containers ---
Clearly nginx is not mapping every ports, I tried to change docker-compose.yml so that it can expose 5005 port as well.
Did docker stop and docker start, but that did not change on list of ports in ‘docker ps’ for nginx container… any thought on it. Do I need to do any other changes?
@nik202 thanks for helping in reaching to the solution
No need to make any change to Nginx.
In the AWS VM, run ngrok HTTP 5005
which gives something like:
ngrok by @inconshreveable (Ctrl+C to quit)
Session Status online
Session Expires 1 hour, 44 minutes
Version 2.3.40
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://xxxx-xx-xx-xx-xxx.ngrok.io -> http://localhost:5005
Forwarding https://xxxx-xx-xx-xx-xxx.ngrok.io -> http://localhost:5005
Connections ttl opn rt1 rt5 p50 p90
4 0 0.00 0.00 0.00 0.00
in the chatbot widget->chat.js
in Action trigger:
replace http://localhost by https://xxxx-xx-xx-xx-xxx.ngrok.io
Observation: the chatbot works even if I used http
After this, if open index.html, I could connect to the rasa on AWS instance.
However, I still have a problem in connection to the action server.
I tried to do the same with 5055 port
ran ngrok HTTP 5055 and used the https link in place of localhost in customActionTrigger in the chatbot widget->chat.js, but that did not help.
I guess you are using docker for the rasa x installation, you can directly pull the action server image from the docker registry and use in docker-compose.overide.yml file
We had run the ngrok on port 80 and it was giving us the result then why you need to expose 5005? as you are using docker and rasa x? For local ROS we expose the 5005 and for server side we expose port 80.
Note: I guess you need to update some files in the endpoints.yml for the actions server to spin or we can discuss more.
If you have any further doubt please feel free to share with me. Good Luck!