# Slack integration - 500 error

**URL:** <https://forum.rasa.com/t/slack-integration-500-error/12318>\
**Category:** Rasa Open Source\
**Created:** [July 1, 2019, 1:22pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318 "2019-07-01T13:22:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![arthur.goujon](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arthur.goujon/32/3590_2.png) [@arthur.goujon](https://forum.rasa.com/u/arthur.goujon)\
**Post date:** [July 1, 2019, 1:22pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/1 "2019-07-01T13:22:45Z")

</div>

Hi Rasa people!

I am struggling with the integration of my bot to Slack. Could you please check whether I have correctly captured the steps below:

RASA & NGROK

- install Rasa with: pip install rasa-x --extra-index-url [https://pypi.rasa.com/simple](https://pypi.rasa.com/simple)
- start a new project with: rasa init
- change the credendials.yml file with the Slack chat bot OAuth token and Slack channel ID
- start rasa with: rasa run. It seems like to start on port 5005
- Start NGROK on port 5005

SLACK

- create a workspace, a channel, an app and a bot.
- add the app to “scope”: channels:read, channels:write, chat:write:bot, chat:write:user (do you know which scopes I need?)
- re-install the app
- turn Event subscription ON. Subscribe to workspace events: `message.channel` , `message.groups` , `message.im` and `message.mpim`)
- add a request url as such: [http://8f34ea92.ngork.io/webhooks/slack/webhook](http://8f34ea92.ngork.io/webhooks/slack/webhook)

I get an error 500: " Your URL didn’t respond with the value of the `challenge` parameter."

Do you know what I am missing? Do I need to change anything in the enpoints.yml file? Do I need to change the rasa api url in the credentials.yml file? Do I need to start an action server? Is this not done automatically by the command rasa run? If so, how to start it and on which port should I start the action server? 5005 or 5055? Do I need to change this in the endpoints.yml file?

I really appreciate the help, All the best!

Arthur

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [July 4, 2019, 9:32am UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/2 "2019-07-04T09:32:14Z")

</div>

Did you make sure that the token in your credentials is the bot token (starts with `xoxob`)?

---

<div class="post-metadata">

**Author:** ![arthur.goujon](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arthur.goujon/32/3590_2.png) [@arthur.goujon](https://forum.rasa.com/u/arthur.goujon)\
**Post date:** [July 4, 2019, 12:32pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/3 "2019-07-04T12:32:25Z")

</div>

Hi Ella, thank you for your answer! I think i am using the right token, but it starts with xoxb.

> **[Access tokens](https://api.slack.com/authentication/token-types)**
>
> Connect, simplify, and automate your work with Slack platform.

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [July 4, 2019, 12:39pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/4 "2019-07-04T12:39:44Z")

</div>

Do you only have one credential set up in your credentials.yml? It’s possible it’s loading a different one – can you try running with `rasa run --connector slack`?

---

<div class="post-metadata">

**Author:** ![arthur.goujon](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arthur.goujon/32/3590_2.png) [@arthur.goujon](https://forum.rasa.com/u/arthur.goujon)\
**Post date:** [July 8, 2019, 8:21pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/5 "2019-07-08T20:21:30Z")

</div>

> [@erohmensing](#):
>
> `rasa run --connector slack` ?

Hi! thanks a lot for your reply. I tried and got the following message. I am not sure what to make of it. My credentials are set up in credentials/yml

C:\Users\hp\Documents\rasa3\>rasa run --connector slack Traceback (most recent call last): File “c:\users\hp\anaconda3\lib\runpy.py”, line 193, in \_run\_module\_as\_main “ **main** ”, mod\_spec) File “c:\users\hp\anaconda3\lib\runpy.py”, line 85, in _run\_code exec(code, run\_globals) File "C:\Users\hp\Anaconda3\Scripts\rasa.exe\_main_.py", line 9, in

File “c:\users\hp\anaconda3\lib\site-packages\rasa\__main_\_.py”, line 70, in m ain cmdline\_arguments.func(cmdline\_arguments) File “c:\users\hp\anaconda3\lib\site-packages\rasa\cli\run.py”, line 101, in r un rasa.run(\*\*vars(args)) File “c:\users\hp\anaconda3\lib\site-packages\rasa\run.py”, line 59, in run \*\*kwargs File “c:\users\hp\anaconda3\lib\site-packages\rasa\core\run.py”, line 139, in serve\_application input\_channels = create\_http\_input\_channels(channel, credentials) File “c:\users\hp\anaconda3\lib\site-packages\rasa\core\run.py”, line 36, in c reate\_http\_input\_channels return [\_create\_single\_channel(channel, all\_credentials.get(channel))] File “c:\users\hp\anaconda3\lib\site-packages\rasa\core\run.py”, line 45, in \_ create\_single\_channel return BUILTIN\_CHANNELS[channel].from\_credentials(credentials) File “c:\users\hp\anaconda3\lib\site-packages\rasa\core\channels\slack.py”, li ne 123, in from\_credentials cls.raise\_missing\_credentials\_exception() File “c:\users\hp\anaconda3\lib\site-packages\rasa\core\channels\channel.py”, line 151, in raise\_missing\_credentials\_exception cls.name(), cls.name(), DOCS\_BASE\_URL Exception: To use the slack input channel, you need to pass a credentials file u sing ‘–credentials’. The argument should be a file path pointing to a yml file containing the slack authentication information. Details in the docs: [https://ra](https://ra)[sa.com/docs/rasa/user-guide/messaging-and-voice-channels/](http://sa.com/docs/rasa/user-guide/messaging-and-voice-channels/)

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [July 9, 2019, 7:47am UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/6 "2019-07-09T07:47:58Z")

</div>

Ah okay I have an idea of what it could be – can you copy and paste your credentials.yml (you can just put in xxxx… for the bot token

Also this is probably just a typo, but it should be in `credentials.yml`, not `credentials/yml`

---

<div class="post-metadata">

**Author:** ![arthur.goujon](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arthur.goujon/32/3590_2.png) [@arthur.goujon](https://forum.rasa.com/u/arthur.goujon)\
**Post date:** [July 9, 2019, 10:10am UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/8 "2019-07-09T10:10:37Z")

</div>

Thanks a lot. Here you go!

* * *

```auto
# This file contains the credentials for the voice & chat platforms
# which your bot is using.
# https://rasa.com/docs/rasa/user-guide/messaging-and-voice-channels/

rest:
# # you don't need to provide anything here - this channel doesn't
# # require any credentials

#facebook:
# verify: "<verify>"
# secret: "<your secret>"
# page-access-token: "<your page access token>"

#slack:
  slack_token: "xoxb-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  slack_channel: "CL31GLA5D"

#socketio:
# user_message_evt: <event name for user message>
# bot_message_evt: <event name for but messages>
# session_persistence: <true/false>

rasa:
  url: "http://localhost:5002/api"

```

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [July 17, 2019, 4:53pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/9 "2019-07-17T16:53:41Z")

</div>

Sorry I just saw this! From what you sent here it looks like `slack:` is commented out which is probably causing problems. Then you can run with `rasa run --connector slack`

---

<div class="post-metadata">

**Author:** ![Abdelkrim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/abdelkrim/32/6547_2.png) [@Abdelkrim](https://forum.rasa.com/u/Abdelkrim)\
**Post date:** [January 6, 2020, 10:54pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/10 "2020-01-06T22:54:05Z")

</div>

to be precise :

1. setup the credentials for slack (you did it already)

2. run ngrok and copy/paste the URL of the tunnel inside `credentials.yml`

3. save the file `credentials.yml`

4. run `rasa run actions -vv` to handle the actions

5. run `rasa run -vv` to start rasa and ALL the connectors

6. eventually set the URLs from ngrok inside the slack admin console : [https://api.slack.com/apps/YOUR\_APP\_ID](https://api.slack.com/apps/YOUR_APP_ID)

7. open slack and the channel running your bot

8. start conversing with your bot 🙂

Now it should work!

---

<div class="post-metadata">

**Author:** ![mia.le0711](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mia.le0711/32/11297_2.png) [@mia.le0711](https://forum.rasa.com/u/mia.le0711)\
**Post date:** [March 2, 2020, 2:03pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/11 "2020-03-02T14:03:19Z")

</div>

Hi Ella!

I am having the same problem and even though everything is the same as you and the thread’s owner stated here, I still cannot run `rasa run --connector slack`.

This is what I got:

```auto
    2020-03-02 14:57:55 INFO root - Connecting to channel 'slack' which was specified by the '--connector' argument. Any other channels will be ignored. To connect to all given channels, omit the '--connector' argument.Traceback (most recent call last): File "/Users/mac/venv/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/ __main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/cli/run.py", line 114, in run
    rasa.run(**vars(args))
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/run.py", line 56, in run
    **kwargs,
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/core/run.py", line 162, in serve_application
    input_channels = create_http_input_channels(channel, credentials)
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/core/run.py", line 47, in create_http_input_channels
    return [_create_single_channel(channel, all_credentials.get(channel))]
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/core/run.py", line 56, in _create_single_channel
    return BUILTIN_CHANNELS[channel].from_credentials(credentials)
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 123, in from_credentials
    cls.raise_missing_credentials_exception()
  File "/Users/mac/venv/lib/python3.7/site-packages/rasa/core/channels/channel.py", line 126, in raise_missing_credentials_exception
    cls.name(), cls.name(), DOCS_BASE_URL
Exception: To use the slack input channel, you need to pass a credentials file using '--credentials'. The argument should be a file path pointing to a yml file containing the slack authentication information. Details in the docs: https://rasa.com/docs/rasa/user-guide/messaging-and-voice-channels/

```

Am I still missing something?

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [March 2, 2020, 5:34pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/12 "2020-03-02T17:34:07Z")

</div>

@mia.le0711 did you configure the credentials (with `slack:` **not** commented out)?

---

<div class="post-metadata">

**Author:** ![mia.le0711](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mia.le0711/32/11297_2.png) [@mia.le0711](https://forum.rasa.com/u/mia.le0711)\
**Post date:** [March 3, 2020, 7:20am UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/13 "2020-03-03T07:20:38Z")

</div>

I changed the last command in credentials.yml to rasa: url: “[http://localhost:5005/webhook](http://localhost:5005/webhook)”

And it works! 🙂

---

<div class="post-metadata">

**Author:** ![jfrank94](https://avatars.discourse-cdn.com/v4/letter/j/90db22/32.png) [@jfrank94](https://forum.rasa.com/u/jfrank94)\
**Post date:** [March 5, 2020, 12:47am UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/14 "2020-03-05T00:47:10Z")

</div>

@erohmensing So, I’m having the same issue as well. When I have the --debug flag up when connecting to Slack, the bot actually recognizes my responses, but there it’s not responding on the actual Slack workspace. My credentials.yml file only has the token as well as the rasa url webhook. My endpoints file have the action\_endpoint set to localhost:5005. My ngrok server is also on 5005.

On the Slack API site, I have my ngrok link set up in the Event Subscriptions page. Like I said, the bot on Slack is actually recognizing my inputs, but it’s not responding. In the debug logs only, it is responding. Please let me know if you have a solution ASAP.

---

<div class="post-metadata">

**Author:** ![robynbitner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/robynbitner/32/10988_2.png) [@robynbitner](https://forum.rasa.com/u/robynbitner)\
**Post date:** [February 1, 2021, 5:54pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/15 "2021-02-01T17:54:34Z")

</div>

I’m also having troubles connecting to Slack using Rasa X and docker-compose

```
RASA_X_VERSION=0.33.1
RASA_VERSION=2.0.2

```

I have done all the configurations as in the documentation but unfortunately I’m not able to send and receive messages successfully.

I have already implemented my bot to use Google Chat, Microsoft Teams, Telegram, socketio and Facebook Messenger, so I know that my webhook is working. However, Slack won’t seem to work.

Here is the log from the running container _rasa\_nginx\_1_:

```
3.85.169.219 - - [01/Feb/2021:17:45:06 +0000] "POST /webhooks/slack/webhook HTTP/1.1" 500 250 "-" "Slackbot 1.0 (+https://api.slack.com/robots)"

```

Here is the error message from _rasa\_rasa-production\_1_:

```
    [2021-02-01 17:45:06 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://<dns>/webhooks/slack/webhook'
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 973, in handle_request
    response = await response
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 422, in webhook
    user_message, metadata["users"]
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 230, in _sanitize_user_message
    for uid_to_remove in uids_to_remove:
TypeError: 'NoneType' object is not iterable
[2021-02-01 17:45:06 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://<dns>/webhooks/slack/webhook'
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 973, in handle_request
    response = await response
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 422, in webhook
    user_message, metadata["users"]
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 230, in _sanitize_user_message
    for uid_to_remove in uids_to_remove:
TypeError: 'NoneType' object is not iterable
[2021-02-01 17:46:07 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://<dns>/webhooks/slack/webhook'
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 973, in handle_request
    response = await response
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 422, in webhook
    user_message, metadata["users"]
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 230, in _sanitize_user_message
    for uid_to_remove in uids_to_remove:
TypeError: 'NoneType' object is not iterable
[2021-02-01 17:51:07 +0000] [1] [ERROR] Exception occurred while handling uri: 'http://<dns>/webhooks/slack/webhook'
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/sanic/app.py", line 973, in handle_request
    response = await response
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 422, in webhook
    user_message, metadata["users"]
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 230, in _sanitize_user_message
    for uid_to_remove in uids_to_remove:
TypeError: 'NoneType' object is not iterable

```

I have replaced my dns with _\<dns\>_

Here is the file _credentials.yml_:

```
rest:
# you don't need to provide anything here - this channel doesn't
# require any credentials

rasa:
  url: ${RASA_X_HOST}/api

telegram:
  access_token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  verify: "xxxxxxxxxxxxx"
  webhook_url: "https://<dns>/webhooks/telegram/webhook"

hangouts:

facebook:
  verify: "xxxxxxxxxxxxx"
  secret: "xxxxxxxxxxxxxxxxxxxxxxx"
  page-access-token: "xxxxxxxxxxxxxxxxxxxxxxxxx"

botframework:
  app_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  app_password: "xxxxxxxxxxxxxxxxxxxxxxxxxx"

slack:
  slack_token: "xoxb-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
  slack_channel: "C01KK9E6VAP"
  slack_signing_secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true/false

```

Any tips to fix this?

Best regards, Robyn

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [February 8, 2021, 12:22pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/16 "2021-02-08T12:22:21Z")

</div>

Hi Robyn, this issue was pointed out here: [Update Slack Connector to new Slack Events API · Issue #6961 · RasaHQ/rasa · GitHub](https://github.com/RasaHQ/rasa/issues/6961)

It was fixed in version 2.1.0, so updating to that version or newer (and a compatible Rasa X version) should fix it.

---

<div class="post-metadata">

**Author:** ![robynbitner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/robynbitner/32/10988_2.png) [@robynbitner](https://forum.rasa.com/u/robynbitner)\
**Post date:** [February 8, 2021, 12:51pm UTC](https://forum.rasa.com/t/slack-integration-500-error/12318/17 "2021-02-08T12:51:36Z")

</div>

Thank you very much! I’ll try that out
