Dispatcher.utter_message wont work if I have a POST request in the action

I have a custom action run() method basically like this:

dispatcher.utter_message(‘I will only take a minute’)

requests.post(‘localhost:6000/example’, data=foo)

# do some operations with files, dictionaries and strings

dispatcher.utter_message(f’The result is {bar}')

If I comment the post request, I get both messages (with hardcoded result, of course). But if I make the post request, I get none of the messages and the log for the rasa run local server is:

  • 2020-04-25 05:05:26 DEBUG rasa.core.processor - Received user message ‘manda ofertas de onix’ with intent ‘{‘name’: ‘ask_sales’, ‘confidence’: 0.9445398449897766}’ and entities ‘
  • 2020-04-25 05:05:26 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 12 events.
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.memoization - Current tracker state [{‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘intent_ask_sales’: 1.0}]
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.memoization - There is no memorised next action
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_TEDPolicy
  • 2020-04-25 05:05:26 DEBUG rasa.core.processor - Predicted next action ‘utter_one_minute’ with confidence 0.94.
  • 2020-04-25 05:05:26 DEBUG rasa.core.processor - Action ‘utter_one_minute’ ended with events ‘[BotUttered(‘Só um minutinho, já estou procurando’, {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, {}, 1587791126.3082902)]’.
  • 2020-04-25 05:05:26 DEBUG slack.web.slack_response - Received the following response: {‘ok’: True, ‘channel’: ‘C012046DL5P’, ‘ts’: ‘1587791126.005300’, ‘message’: {‘bot_id’: ‘B011U8EKCH1’, ‘type’: ‘message’, ‘text’: ‘Só um minutinho, já estou procurando’, ‘user’: ‘U0126LNDQLR’, ‘ts’: ‘1587791126.005300’, ‘team’: ‘T012046DB17’, ‘bot_profile’: {‘id’: ‘B011U8EKCH1’, ‘deleted’: False, ‘name’: 'barbada
  • s-bot’, ‘updated’: 1586886367, ‘app_id’: ‘A012HSY37R6’, ‘icons’: {‘image_36’: ‘https://a.slack-edge.com/80588/img/plugins/app/bot_36.png’, ‘image_48’: ‘https://a.slack-edge.com/80588/img/plugins/app/bot_48.png’, ‘image_72’: ‘https://a.slack-edge.com/80588/img/plugins/app/service_72.png’}, ‘team_id’: ‘T012046DB17’}}}
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.memoization - Current tracker state [{‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘intent_ask_sales’: 1.0}, {‘prev_utter_one_minute’: 1.0, ‘intent_ask_sales’: 1.0}]
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.memoization - There is no memorised next action
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, ‘ask_sales’.
  • 2020-04-25 05:05:26 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_TEDPolicy
  • 2020-04-25 05:05:26 DEBUG rasa.core.processor - Predicted next action ‘action_get_sales’ with confidence 0.93.
  • 2020-04-25 05:05:26 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘action_get_sales’.
  • 2020-04-25 05:05:41 DEBUG rasa.core.processor - Action ‘action_get_sales’ ended with events ‘’.

And the rasa run actions server gives this log, as if everything had gone smooth:

  • 2020-04-25 05:05:12 DEBUG rasa_sdk.utils - Using the default number of Sanic workers (1).
  • 2020-04-25 05:05:26 DEBUG rasa_sdk.executor - Received request to run ‘action_get_sales’
  • 2020-04-25 05:05:27 DEBUG urllib3.connectionpool - Starting new HTTP connection (1): localhost:6800
  • 2020-04-25 05:05:27 DEBUG urllib3.connectionpool - http://localhost:6800 “POST /schedule.json HTTP/1.1” 200 96
  • 2020-04-25 05:05:41 DEBUG rasa_sdk.executor - Finished running ‘action_get_sales’
  • 2020-04-25 05:05:41 DEBUG rasa_sdk.executor - Received request to run ‘action_order_sales’
  • 2020-04-25 05:07:50 DEBUG rasa_sdk.executor - Finished running ‘action_order_sales’

the server I run rasa on gives me this error log:

  • 2020-04-25 05:06:26 Sat Apr 25 05:06:26 2020 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /webhooks/slack/webhook (ip 10.0.0.121) !!!
  • 2020-04-25 05:06:26 Sat Apr 25 05:06:26 2020 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /webhooks/slack/webhook (ip 10.0.0.121) !!!
  • 2020-04-25 05:06:26 Sat Apr 25 05:06:26 2020 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during POST /webhooks/slack/webhook (10.0.0.121)
  • 2020-04-25 05:06:26 Sat Apr 25 05:06:26 2020 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during POST /webhooks/slack/webhook (10.0.0.121)

Is there a workaround for this?

P.S.: The action takes about 1-2 minutes max

1 Like

is this problem solved. we are facing the same problem with rasa 1.9.x

@manmustbecool can you share a snippet of code and screenshot of problem?