Received retry #1 request from slack due to http_timeout

I have recently configured my bot for Slack integration. It is working fine for general utter messages like “Hi” and sending a response back to Slack channel. But when there is an action for custom action server, the bot does not send message to slack. Observations -

  1. Intent is recognized correctly.
  2. Custom action is triggered successfully.
  3. The reply can be seen on rasa run debug logs but does not get sent to slack channel.
2021-10-19 12:10:54 DEBUG    rasa.core.processor  - Action 'action_tell_about_xxxxx' ended with events '[BotUttered('Test Successful!', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1634625654.5356448), <rasa.shared.core.events.SlotSet object at 0x000002D841C3C6A0>]'.
2021-10-19 12:10:54 DEBUG    rasa.core.processor  - Current slot values:
        cp_type: xxxxx
        company: client_name
        professional: None
        session_started_metadata: {'out_channel': 'xxxxxxxxxx', 'thread_id': '1634625284.002900', 'users': ['U02HKBCESUV']}
2021-10-19 12:10:54 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'xxxxxxxxx'.
2021-10-19 12:10:55 WARNING  rasa.core.channels.slack  - Received retry #1 request from slack due to http_timeout.

I have already made the action as simple as possible

def run(self, dispatcher, tracker, domain):

        print('tracker -> \n', tracker)
        response = "Test Successful!"
        slot_val = "xxxxxxx"
        dispatcher.utter_message(response)
        return [SlotSet('cp_type', slot_val)]

Even this is failing. @stephens

Hi Ayush,

Can you duplicate the problem in the shell (rasa shell --debug)?

Are there any errors in the action server log?

Greg

Hi Stephen,

Thanks for your response.

No, there are no error on the action server, because it get the request, it executes it properly and returns the response. The same can be seen in questions’ s log. [BotUttered('Test Successful!' Earlier I thought it might be due to DB query execution so i replaced the code to just send a pass through response.

The only problem that i have observed while debugging is - in rasa.core.channels.slack.py when normal requests (one not dependent on custom actions) does not have following flags set - “x-slack-retry-reason”=“1” and “x-slack-retry-num”=“http_timeout”. That is why when it comes to below function it gets stuck to HTTPStatus.CREATED and that’s it.

    async def process_message(
        self,
        request: Request,
        on_new_message: Callable[[UserMessage], Awaitable[Any]],
        text: Text,
        sender_id: Optional[Text],
        metadata: Optional[Dict],
    ) -> Any:
        """Slack retries to post messages up to 3 times based on
        failure conditions defined here:
        https://api.slack.com/events-api#failure_conditions
        """
        retry_reason = request.headers.get(self.retry_reason_header)
        retry_count = request.headers.get(self.retry_num_header)
        logger.info(
                f"Request Header - {request.headers}."
                f"Request Body - {request.body}."
            )
        if retry_count and retry_reason in self.errors_ignore_retry:
            logger.warning(
                f"Received retry #{retry_count} request from slack"
                f" due to {retry_reason}."
            )

            return response.text(
                None, status=HTTPStatus.CREATED, headers={"X-Slack-No-Retry": 1}
            )

I hope it answers your question.

Looking forward to your response. Thanks @stephens !

Adding additional folks for better reach. @akelad

@Tobias_Wochinger

@erohmensing

@Juste

Can you guys please help. I need urgent help with this.

@stephens can you please help out here. I would really appreciate any kind of help. Or please guide to an expert who can help me out.

I haven’t looked at the slack channel formatting in quite a while. What is the debug output show as the payload for a normal utterance. Is the format the same as you show above for your example:

DEBUG    rasa.core.processor  - Action 'action_tell_about_xxxxx' ended with events '[BotUttered('Test Successful!', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1634625654.5356448), <rasa.shared.core.events.SlotSet object at 0x000002D841C3C6A0>]'.

Have you reviewed the slack channel code? send_text_message.

Hi @Ayush_Modi were you able to solve this? I’ve the same issue