whales icon indicating copy to clipboard operation
whales copied to clipboard

Can't see the error because of slack token

Open patrick-mota opened this issue 5 years ago • 7 comments

When using whales I got an error.

/usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier/util/http_client.rb:29:inblock in call': The slack API returned an error: invalid_token (HTTP Code 403) (Slack::Notifier::APIError) Check the "Handling Errors" section on https://api.slack.com/incoming-webhooks for more information from /usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier/util/http_client.rb:27:in tap' from /usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier/util/http_client.rb:27:in call' from /usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier/util/http_client.rb:13:in post' from /usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier.rb:49:in block in post' from /usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier.rb:47:in map' from /usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier.rb:47:in post' from /usr/local/bundle/gems/slack-notifier-2.3.2/lib/slack-notifier.rb:37:in ping' from /usr/src/app/lib/rescuer.rb:11:in ping' from /usr/src/app/lib/whales_cli.rb:23:in rescue in tame' from /usr/src/app/lib/whales_cli.rb:20:in tame' from /usr/local/bundle/gems/thor-0.20.0/lib/thor/command.rb:27:in run' from /usr/local/bundle/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' from /usr/local/bundle/gems/thor-0.20.0/lib/thor.rb:387:in dispatch' from /usr/local/bundle/gems/thor-0.20.0/lib/thor/base.rb:466:in start' from /usr/src/app/bin/whales:9:in <main>'

And the token is indeed invalid.

Could you fix it or at least add an option to display the error instead of sending it to a slack channel ?

patrick-mota avatar Oct 31 '19 08:10 patrick-mota

Yes, we can look at it, thanks for reporting

kurenn avatar Nov 07 '19 23:11 kurenn

Thank you very much @kurenn

patrick-mota avatar Nov 23 '19 10:11 patrick-mota

I received the exact same message for Slack API error. @patrick-mota's suggestion would be very helpful! Thank you!

dcnadler avatar Jan 02 '20 17:01 dcnadler

Hi @dcnadler maybe it's hard to fix so here is a quickfix / workaround.

Get the source code and modify this file https://github.com/Gueils/whales/blob/master/lib/rescuer.rb

line 4

SLACK_WEBHOOK = "https://hooks.slack.com/services/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".freeze

You just need to change the token here... more info about webhooks at:

https://api.slack.com/messaging/webhooks

and you should be good to go.

Happy new year.

patrick-mota avatar Jan 02 '20 20:01 patrick-mota

Thanks @patrick-mota! I will give it a try.

dcnadler avatar Jan 02 '20 22:01 dcnadler

I am having the same issue:

OrlandoWhite88 avatar Mar 26 '24 13:03 OrlandoWhite88

Hi @dcnadler maybe it's hard to fix so here is a quickfix / workaround.

Get the source code and modify this file https://github.com/Gueils/whales/blob/master/lib/rescuer.rb

line 4

SLACK_WEBHOOK = "https://hooks.slack.com/services/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".freeze

You just need to change the token here... more info about webhooks at:

https://api.slack.com/messaging/webhooks

and you should be good to go.

Happy new year.

I did this, added my own webhook, pushed to docker and ran command with my own image but still doesnt work

OrlandoWhite88 avatar Mar 26 '24 15:03 OrlandoWhite88