question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate messages in Slack channel

See original GitHub issue

Rasa version: 1.1.4

Python version: 3.6.8

Operating system (windows, osx, …): Windows + ngrok

Issue: When I send message to Slack channel, bot answering to me multiple times: Here was an issue with same problem: https://github.com/RasaHQ/rasa/issues/2120

At ngrok logs I see, what User-Agent: Slackbot 1.0 keeps POST me messages with headers:

X-Slack-Retry-Num: 1
X-Slack-Retry-Reason: http_timeout
X-Slack-Retry-Num: 2
X-Slack-Retry-Reason: http_timeout

As I see in slack.py, here is something like workaround for my problem: https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/slack.py#L148

I’ve tried to modify credentials.yml:

slack:
  slack_token: "xoxb-****"
  errors_ignore_retry: "http_timeout"

But it doesn’t work. (same problem on production server with docker)

Summarizing:

  1. Slack duplicate messages to bot with reason of http_timeout even when no custom_actions executed (just utter from domain.yml)
  2. Bot replies to every retry attempt
  3. I can’t bypass http_timeout with errors_ignore_retry

Could you advice please?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:24 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
cuongndacommented, Jul 10, 2019

Hi, I’m facing very similar issue. After checking the source code, there is code for handle retry case but I spot this: https://github.com/RasaHQ/rasa/blob/e002d095134d52afbd4474a77738739957263db6/rasa/core/channels/slack.py#L256

retry_reason = request.headers.get("HTTP_X_SLACK_RETRY_REASON")
retry_count = request.headers.get("HTTP_X_SLACK_RETRY_NUM")

When I read the request from slack, it turn out that slack sending the request with different headers (“x-slack-retry-reason” and “x-slack-retry-num”) so I changed the code to:

retry_reason = request.headers.get("x-slack-retry-reason")
retry_count = request.headers.get("x-slack-retry-num")

And now it is working as expected. I’m not sure if we can set this text as variable instead of hardcoded string?

1reaction
cuongndacommented, Jul 23, 2019

Hi, I’ve created PR here, please take a look: https://github.com/RasaHQ/rasa/pull/4081

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detect duplicate messages and send a message on Slack ...
Detect duplicate messages and send a message on Slack channel · 1. When a new message is posted to channel in Slack ·...
Read more >
Duplicate messages on Slack when creating tickets
In the morning it was posting just one message to Slack then midday is inexplicably started double posting on ticket create. Any new...
Read more >
A new way to share messages across channels — using ...
The Reacji Channeler lets you route messages to other channels with a quick click ... copy a message from one channel (or multiple...
Read more >
Here's why your Slack messages are double-posting. ...
Users of Slack, the hugely popular messaging platform, are reporting a weird glitch that's resulting in messages being duplicated multiple ...
Read more >
3 Ways to Send Slack Messages to multiple channels or ...
While they do not solve the issue of having specific information only sent to certain channels, if you want to make sure that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found