Slack error with rasa 1.10.0: TypeError: 'NoneType' object is not iterable

Rasa version: Rasa: 1.10.0 Python version: Python 3.7.6 Operating system: Windows 10

Issue: I am testing my bot in slack and I got the following error:

Exception occurred while handling uri: ‘http://xxxx.ngrok.io/webhooks/slack/webhook’ Traceback (most recent call last): File “C:\Users\b.louati\AppData\Roaming\Python\Python37\site-packages\sanic\app.py”, line 976, in handle_request response = await response File “c:\users\b.louati\anaconda33\envs\chatbotvenv\lib\site-packages\rasa\core\channels\slack.py”, line 384, in webhook user_message, metadata[“users”] File “c:\users\b.louati\anaconda33\envs\chatbotvenv\lib\site-packages\rasa\core\channels\slack.py”, line 203, in _sanitize_user_message for uid_to_remove in uids_to_remove: TypeError: ‘NoneType’ object is not iterable Exception occurred while handling uri: ‘http://xxxxx.ngrok.io/webhooks/slack/webhook’ Traceback (most recent call last): File “C:\Users\b.louati\AppData\Roaming\Python\Python37\site-packages\sanic\app.py”, line 976, in handle_request response = await response File “c:\users\b.louati\anaconda33\envs\chatbotvenv\lib\site-packages\rasa\core\channels\slack.py”, line 384, in webhook user_message, metadata[“users”] File “c:\users\b.louati\anaconda33\envs\chatbotvenv\lib\site-packages\rasa\core\channels\slack.py”, line 203, in _sanitize_user_message for uid_to_remove in uids_to_remove: TypeError: ‘NoneType’ object is not iterable

Any help please?

Best regards

1 Like

When does this exception occur?

Hi akelad,

I occur this problem just while typing my first text in slack. The error occurs only with slack. To resume, I tried to test my bot through slack by running actions then the server and finally ngrok server. Once I type my first text in slck I receive the described error.

Regards,

Hi @badi3, this was fixed in Rasa 2.1.0. It resulted due to changes in the Slack API. See the relevant github issue and PR here:

You’ll need to upgrade to fix the problem.

Hi @akelad,

Ok I will upgrade to rasa 2.2 version to try again.

Thanks a lot !

Hello @erohmensing, I had the same issue here with 1.10.0 version of Rasa and slack api. My question is, If i must upgrade the version of Rasa from 1.10.0 to the 2.1.0 , Am I supposed to re-write and change the structure of all my nlu files and stories files so that they match with the newest structure of rasa 2.1 ? Or is there is any other solution to satisfy compatibility of my project files without rebuilding the project ?

Thanks

Unfortunately the fix is only available on 2.1. 2.1 should still load old Markdown stories/nlu files, although they are deprecated – meaning you should spend time to migrate them at some point. But you should be able to upgrade to test it without changing too many things as most data formats/policies were deprecated, not removed. (previously deprecated policies such as Keras were removed, however)

Hi,

thank you for your reply. OK, so the bug is fixed in ONLY rasa 2.1.0 or another one (2.1.x) ?

Regards,

As of 2.1.0 :slight_smile: so any version >= 2.1.0