Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

slash command "dispatch_failed"

I have went through creating the custom slash command configuration via slack and installed it on workspace. However when I run it I get this /testing failed with the error "dispatch_failed"

I tried multiple workspaces but same issue. Anyone experienced this?

enter image description here

like image 505
Asim Zaidi Avatar asked Aug 31 '20 05:08

Asim Zaidi


3 Answers

So after a few tests, I found out that this is just a generic message of anything that fails at slack at this point. I have first my endpoint that was unreachable. So it was returning this message. I fixed that, used ngrok for tunnel so that I could debug and that is how I found this issue.

Also, this error can occur due to the following reasons as well.

  • Errors in code
  • Unreachable backend or Invalidly configured slash command in the app
like image 124
Asim Zaidi Avatar answered Oct 23 '22 11:10

Asim Zaidi


While the documentation tells you:

"use the Request URL is your base server link + "/slashcommand" after it"

This is incorrect. The request URL should be: "/slack/events"

Of course the command needs to match whats in the 'edit command' window and in the method '.command' in your app.js:

app.command('/flash-card', async ({ ack, body, client })

like image 37
Majnuel Avatar answered Oct 23 '22 12:10

Majnuel


If you're using ngrok http <port> to test in your localhost, be aware that a new ngrok public URL is created every time you run this command. So in https://api.slack.com/apps, in your app's Features, you may have to update your Slash Command' request URL with the current ngrok URL generated for you.

like image 2
rafaelportela Avatar answered Oct 23 '22 13:10

rafaelportela