I’m very new to rasa so please excuse potential beginner mistakes. So I have a problem communicating with my fresh installed rasa instance in my GCP VM. I’ve tried multiple things and don’t know where I’m wrong so I’m gonna explain everything I’ve done.
I created a new ubuntu 16.04 LTS VM on GCP matching the minimum requirements for rasa x and installed docker and docker-compose.
Then I ran sudo docker run --user root -v $(pwd):/app rasa/rasa init --no-prompt to create the base project and train the first model.
I have to do everything with root otherwise I’m having problems with permissions.
I checked all the files and folders in the project directory. Specifically that credentials.yml contains “rest:”.
Then I created docker-compose.yml :
version: '2.0' // Didn't work with 3.0
services:
rasa:
image: rasa/rasa
ports:
- 5005:5005
volumes:
- ./:/app
command:
- run
Then I ran sudo docker-compose up -d and checked that everything works with sudo docker container ls output of that is:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc1677b364a9 rasa/rasa "rasa run" 2 minutes ago Up 7 seconds 0.0.0.0:5005->5005/tcp rasa_rasa_1
To me that looks good but when I run
curl --location --request POST 'http://localhost:5005/webhooks/rest/webhook?sender=Rasa&message=Hi,%20there%21
I only get:
<h1>Internal Server Error</h1>
<p>
The server encountered an internal error and cannot complete
your request.
</p>
And to even get this far took me ages. Previously it just refused the connection. Whenever I try to send the same message from a different network via curl --location --request POST 'http://GcpExternalIP:5005/webhooks/rest/webhook?sender=Rasa&message=Hi,%20there%21
it just times out after a few seconds. I’ve tried Postman on mac, rested (similar to Postman used it before I knew of Postman) and terminal.
I’ve tried installing rasa x on the same instance after that and that worked flawlessly. I just followed the tutorial from the rasa masterclass and I could connect to rasa x via firefox but when I compare the running docker containers I couldn’t find a difference in connected networks. But how is it that rasa x is exposed but rasa running on port 5005 isn’t??
Any help is greatly appreciated I don’t know what else to try.
Thanks in advance!
But things change a lot when you deploy on GCP, Before you use it you have to get an bearer access token by following method:
Your endpoint is :
http://<your_ip>/api/auth
with Json Body as POST request:
{
"username": "your usename, usually its me",
"password": "your password"
}
It will return something like this:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1c2VybmFtZSI6Im1lIiwiZXhwIjoxNTg2MTE1MDMxLCJ1c2VyIjp7InVzZXJuYW1lIjoibWUiLCJyb2xlcyI6WyJhZG1pbiJdLCJkYXRhIjpudWxsLCJhcGlfdG9rZW4iOiI2MjkzYWU5MDcxMmIyYjEwNzJjNTBmNmFkNTE2YjJlMmUzNTc1ZjE4In0sInNjb3BlcyI6WyJhY3R
---really long access token
pb25QcmVkaWN0aW9uOmNyZWF0ZSIsImFjdGlvblByZWRpY3Rpb246Z2V0IiwiYWN0aW9uczpjcmVhdGUiLCJhY3Rpb25zOmRlbGV0ZSIsImFjdGlvbnM6Z2V0IiwiYWN0aW9uczp1cGRhdGUiLCJhbGxFd
9tWCLbQtPGe8jDfxExLwLdcxvkF7s5DQail8gtt_60mLPAlNRKbWeR3zpJ8RFf_KOAqxXDcg9rrZO-g_hXRng1ePOFOyrOFlQLMp0IN4YwRgHhdbqIlypdw"
}
@athenasaurav can you help me in deploying my Rasa Chatbot in GCP. As I have no Idea about docker and GCP. My chatbot is ready and I am not getting exact way how to deploy it. I’m searching from 1 month.
Thank you very much for that detailed guide, really appreciate it. The first post requests asking for an access token worked flawlessly, but I couldn’t send any messages. I pasted the access token I got from the request into the other post request, but with the same message “hi” I’m just getting empty brackets like so []
Okay so I got it to work now. Thanks for the great help. I actually just copied over your curl request. In the end I got it to work with postman, I didn’t know I could put in the access token in the authorisation panel, but this is much cleaner and easier than a curl request…
I think my whole docker-setup had some issues so I did a clean install and added the rest input channel to credential.yml, as that got removed somehow.
Then my communication worked. In postman it said status 200, but I still only got the empty square brackets. The issue this time was on rasa’s side. I couldn’t activate a model because I had none, but I also couldn’t train, because it would only say nothing has changed. So I changed a few lines, pushed to git and could train and load the model.
@athenasaurav i am facing similar issue in the deployment. Can you elaborate on the provided solution. My actions work fine if not containerized. But when containerized im unable to make HTTP request
Can you please elobrate your issues and the method which you used? Are you deploying on some VM instance or on localhost? Are you using rasa x or rasa open source for deployment? Also please share your credentials.yml file
@athenasaurav sure. I’m using rasa open source. Im containerizing the package to deploy in kubernetes. There is a rest api call which is failing to execute when i use docker-compose up but works fine if not using docker.
The error message is Internal Server Error. The server encountered an internal error and cannot complete your request.
cred.txt (1.1 KB)
I’m using rasa open source. Im containerizing the package to deploy in kubernetes. There is a rest api call which is failing to execute when i use docker-compose up but works fine if not using docker.
The error message is Internal Server Error. The server encountered an internal error and cannot complete your request
credential.yml cred.txt (1.1 KB)
adding my dockerfile as well for your reference. Thanks in advance
docker-compose.yaml (589 Bytes)