Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't see the error because of slack token #38

Open
patrick-mota opened this issue Oct 31, 2019 · 7 comments
Open

Can't see the error because of slack token #38

patrick-mota opened this issue Oct 31, 2019 · 7 comments

Comments

@patrick-mota
Copy link

patrick-mota commented Oct 31, 2019

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 ?

@kurenn
Copy link
Contributor

kurenn commented Nov 7, 2019

Yes, we can look at it, thanks for reporting

@patrick-mota
Copy link
Author

Thank you very much @kurenn

@dcnadler
Copy link

dcnadler commented Jan 2, 2020

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

@patrick-mota
Copy link
Author

patrick-mota commented Jan 2, 2020

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.

@dcnadler
Copy link

dcnadler commented Jan 2, 2020

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

@OrlandoWhite88
Copy link

OrlandoWhite88 commented Mar 26, 2024

I am having the same issue:

@OrlandoWhite88
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants