Rasa slack bot issue again

Hello again everyone.

In march i put this Rasa slack integration issue Rasa Slack Bot Integration which i was able to solve, Steps are mention in the link itself. At that time i used not only ngrok but also GCP to deploy mood bot on GCP and connect to slack.

Now i have a similar new issue. I have deployed a bot on GCP using custom actions which i have build using this link : Installation Guide and also created the custom image using docker from here : https://rasa.com/docs/rasa/user-guide/docker/deploying-in-docker-compose/#building-an-action-server-image

My Dockerfile looks like this

# Extend the official Rasa SDK image
FROM rasa/rasa-sdk:1.10.0
# Use subdirectory as working directory
WORKDIR /app
# Copy any additional custom requirements, if necessary (uncomment next line)
COPY actions/requirements-actions.txt ./
# Change back to root user to install dependencies
USER root
# Install extra requirements for actions code, if necessary (uncomment next line)
RUN pip install -r requirements-actions.txt
# Copy actions folder to working directory
COPY ./actions /app/actions
COPY creds.json /app
# By best practices, don't run the code with root user
USER 1001
CMD ["start", "--actions", "actions.actions"]

my docker-compose.override.yml file looks like this:

GNU nano 2.5.3 File: docker-compose.override.yml

version: '3.4'
services:
  rasa:
    image: 'rasa/rasa-sdk:latest'
    ports:
      - 5005:5005
    volumes:
      - './actions:/app/actions'
    command:
      - run
  app:
    image: "athenasaurav/zyllu:rasa1"
    expose:
      - '5055'

My bot is working fine on rasa x from GCP, properly understanding the intent and working with custom actions also getting triggered.

No then i edited the credentials.yml file to connect the rasa to slack channel:

rasa:
  url: ${RASA_X_HOST}/api
slack:
  slack_token: ""
  slack_channel: ""

since i have just created this channel i dont have bot token scope. Although i have another slack app running using ngrok, so even tried to update its credentials in credentials.yml file and then restart the server then also i have this issue.

i have read the rasa docs for Slack integration.

http://<host>:<port>/webhooks/slack/webhook

i tried various ports also but i wasnt lucky enough to solve this issue.

Can anyone tell what "port " i should use to solve this issue.

While using ngrok i figured out that the blank mention of the slack and the slack token works.

My docker logs for container rasa/nginx:0.23.3 shows this error whenever i try to connect to slack app:

54.224.246.185 - - [14/May/2020:15:49:44 +0000] "POST /webhooks/slack/webhook HTTP/1.1" 200 1574 "-" "Slackbot 1.0 (+https://api.slack.com/robots)"

Thank You

@erohmensing @wabi @Juste @mehdiHadji

please look into this issue

Can anyone please help?

Hi @athenasaurav i have the same issue. I dont have any custom dependency in deployment. Its a simple chitchat bot. No backend and custom dependency. But i cant connect my GCP instance to slack, facebook, telegram or website. Are you able to find out the solution.

@amn41

Hi @event-wala,

Sadly no i don’t have a solution yet. If i found one i will let you know.

Hello Everyone the problem is solved now.

I really wish that rasa should do the documentations more correctly.

According to documentations of rasa here Slack

The Rasa request URL should be

http://<host>:<port>/webhooks/slack/webhook

which is wrong.

The request url should be

http://<host>/core/webhooks/slack/webhook

Please update this to Rasa docs please.

@erohmensing @amn41 @stephens @event-wala @juste_petr

1 Like

Thank @athenasaurav. It worked for me too

This is dependent on your Rasa X version. It should work without the /core/ for any version >= 0.27.0: https://rasa.com/docs/rasa-x/changelog/rasa-x-changelog/#id105

Thanks for update

Hi, everyone, I met this problem too, my Rasa X is the newest version, 0.31.0. I am using AWS EC2 to deploy my Rasa X, it is running well. However, I failed to connect my Rasa X with slack. And the solution here didn’t work for me any more as I am using the newest version of Rasa X. I tried different url, and I am stuck with this for one week.

Hi @Yiqun, your url there looks like it’s missing /webhooks. It should look like http://<ip>/webhooks/slack/webhook.

In addition, you’ll need to make sure to add the slack credentials to your rasa x deployment for it to correctly respond with the challenge parameter!

2 Likes

@erohmensing Thank you so much, it works well now, and I have another problem, the buttons didn’t work in slack. Is this caused by the actions server? Do I need to add some codes in actions.py file to make buttons work in slack? The tutorial indicates I need add codes in actions.py, but the actions.py is empty in my local file. Then how can I make buttons work in slack? It is connected with Rasa X now.

I think there is a bug with buttons actually :frowning: you can keep up to date with the fix here: https://github.com/RasaHQ/rasa/pull/6020

@erohmensing I know Rasa open source have a file named slack.py, and the error can be fixed by editing this file. I am wondering where can I find this file in Rasa x? I am running my Rasa x using ubuntu in AWS, I failed to find it in any folder, and some folders are missing or hidden.

Any answer for this?