# Bot freezes after running custom action, does not respond

**URL:** <https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409>\
**Category:** Rasa Open Source\
**Created:** [July 3, 2019, 6:38am UTC](https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409 "2019-07-03T06:38:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZwodoPaZ](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zwodopaz/32/2091_2.png) [@ZwodoPaZ](https://forum.rasa.com/u/ZwodoPaZ)\
**Post date:** [July 3, 2019, 6:38am UTC](https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409/1 "2019-07-03T06:38:05Z")

</div>

Hello I’m trying to get the bot to run this very simple custom action,

**from** typing **import** Any, Text, Dict, List

**from** rasa\_sdk **import** Action, Tracker

**from** rasa\_sdk.executor **import** CollectingDispatcher

class Math(Action):

```
def name(self) -> Text:
    return "action_math"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    
    mathVar = (tracker.latest_message)['text']
    mathVar = ''.join(char for char in mathVar if char not in 'abcdefghijklmnopqrstuvwxyz')
    mathVarCalculate = eval(mathVar)
    dispatcher.utter_message(mathVarCalculate)

```

from what i can tell the action itself is executed as i should but when the bot is supposed to say the answer through dispatcher.utter\_message it say nothing keeps working for a while and then gives me this error message,

Task exception was never retrieved

future: \<Task finished coro=\<RestInput.on\_message\_wrapper() done, defined at /Users/filipw/Documents/ConvoAi/anaconda3/lib/python3.7/site-packages/rasa/core/channels/channel.py:386\> exception=AttributeError("‘int’ object has no attribute ‘split’")\>

Does anyone know why?

---

<div class="post-metadata">

**Author:** ![JulianGerhard](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juliangerhard/32/3781_2.png) [@JulianGerhard](https://forum.rasa.com/u/JulianGerhard)\
**Post date:** [July 3, 2019, 6:52am UTC](https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409/2 "2019-07-03T06:52:19Z")

</div>

Hi @ZwodoPaZ

please add:

`return []`

at the end of the run function and see if it works then!

Regards

---

<div class="post-metadata">

**Author:** ![ZwodoPaZ](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zwodopaz/32/2091_2.png) [@ZwodoPaZ](https://forum.rasa.com/u/ZwodoPaZ)\
**Post date:** [July 3, 2019, 8:40am UTC](https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409/3 "2019-07-03T08:40:41Z")

</div>

Thanks! I tried but still the same problem sadly

---

<div class="post-metadata">

**Author:** ![ZwodoPaZ](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zwodopaz/32/2091_2.png) [@ZwodoPaZ](https://forum.rasa.com/u/ZwodoPaZ)\
**Post date:** [July 3, 2019, 7:09pm UTC](https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409/4 "2019-07-03T19:09:06Z")

</div>

If i run the bot in debug mode it seems to believe that it has said something.

Action ‘action\_math’ ended with events ‘[‘BotUttered(text: 13, data: {“elements”: null, “quick\_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, metadata: {})’]’

But it has not said a word.

---

<div class="post-metadata">

**Author:** ![ZwodoPaZ](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zwodopaz/32/2091_2.png) [@ZwodoPaZ](https://forum.rasa.com/u/ZwodoPaZ)\
**Post date:** [July 3, 2019, 7:13pm UTC](https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409/5 "2019-07-03T19:13:17Z")

</div>

I solved it!! The uttered message has to be a string

---

<div class="post-metadata">

**Author:** ![JulianGerhard](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juliangerhard/32/3781_2.png) [@JulianGerhard](https://forum.rasa.com/u/JulianGerhard)\
**Post date:** [July 4, 2019, 5:17am UTC](https://forum.rasa.com/t/bot-freezes-after-running-custom-action-does-not-respond/12409/6 "2019-07-04T05:17:31Z")

</div>

Hi @ZwodoPaZ

of course _sigh_. I should have actually read the error message 😃

Regards
