Unable to use metabot on slack, no response from bot

I’ve integrated metabot with slack and pulses work great. I’ve named the metabot as metabase and added it to a private channel but when I do @metabase help; there is no response from the bot.

Am I missing anything here?

1 Like

I’m on 0.35.2 and have the same problem.

Metabot posts pulses well, but doesn’t reply to any "metabot " commands. Not in private message, not in any public channel.

App console log doesn’t seem to display anything related to Slack integration.

Where would I start debugging this?

@lkraav
So you’re not seeing any errors anywhere (not even in Slack, when you use the metabot command)?
Could it be that your Metabase instance has a firewall (or a WAF like Cloudflare) that is blocking traffic from Slack?
You should see requests in Admin > Troubleshooting > Logs.
It is possible to enable more logging by using DEBUG or TRACE instead of the default values:
https://www.metabase.com/docs/latest/operations-guide/log-configuration.html

1 Like

Indeed, Cloudflare is in play. Thanks for the tips, I’ll post updates when I have new info.

Hi @lkraav - I’m having the same issue in 0.35.3. The pulses seem to send fine, but when I try to interact with the bot in Slack, it doesn’t seem to respond to any commands. Would you be able to share some info on how you resolved? Thanks!

@mbadua Latest release is 0.35.4
So you’re not using Cloudflare or similar services that provide a web-firewall?
Are you using a load-balancer in front of Metabase?
You need to check the server, where Metabase is hosted, to see if there’s any network connections coming from Slack - otherwise the problem is somewhere else.

@flamber I’m working with @mbadua on getting this to work.
We are using the docker container on a aws lightsail instance. I opened the server to all ports and I still don’t see any traffic coming from Slack to our instance. There are no items in the logs.
The pulses are arriving in slack just fine.
We just can’t get metabot to respond when we type metabot list.

@deadbigreddog
Pulses are sent from Metabase to Slack. Metabot are received from Slack to Metabase.

So if you’re not seeing any network traffic on your container from Slack, when trying to use Metabot, then something is blocking - contact AWS support.

Or maybe the Metabot isn’t setup correctly?
https://www.metabase.com/docs/latest/administration-guide/09-setting-up-slack.html

Related: https://github.com/metabase/metabase/issues/5380

Hello @flamber,

This was all super helpful. Do you know what port Metabot uses to communicate back to Metabase from Slack?

@deadbigreddog Metabase connects to Slack and negotiates a port. You should use netstat/wireshark to check connections and transfer.
But if you’re using a load-balancer (or a security WAF like Cloudflare), then that might be blocking or causing the connection to be dropped.

@flamber I have successfully piped my remote tcpdump to my local copy of wireshark. The problem I face is that I have no idea which source packet is the one representing Metabot. Is there a particular Source IP address that identifies Metabot?

@deadbigreddog
Are you saying with 100% (completely fully) certainty that there’s no firewalls, load-balancers, proxies or anything that could be blocking?

If you start recording, then go to Slack and try to use Metabot, wait for error, and stop recording, then there should be less than 1 minutes worth of traffic, which should be fairly easy to filter through the IPs.

I don’t think Slack has a list of their IPs publicly.

Hello @flamber I decided to try a different approach to Metabot.
I am running the most recent jar file from the site on a AWS server and when I try to enable Metabot in the admin section I am getting the following error:
Slack API error: method_deprecated

On my console, I see the following error:
06-12 14:21:37 WARN integrations.slack :: {:message “Slack API error: method_deprecated”,
:response
{:ok false,
:error “method_deprecated”,
:response_metadata
{:messages
["[ERROR] This method is retired and can no longer be used. Please use conversations.list or users.conversations instead. Learn more: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api."]}}}

06-12 14:21:37 DEBUG middleware.log :: PUT /api/slack/settings 400 568.9 ms (0 DB calls)
{:message “Slack API error: method_deprecated”,
:response
{:ok false,
:error “method_deprecated”,
:response_metadata
{:messages
["[ERROR] This method is retired and can no longer be used. Please use conversations.list or users.conversations instead. Learn more: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api."]}}}

@deadbigreddog Things have changed now, so since June 10th 2020, you cannot setup a new Slack - the old ones will continue to work. We’re working on that.
https://github.com/metabase/metabase/issues/12678