Gueils / whales

:whale: Tool to automatically dockerize your application.
http://www.whales.mx
MIT License
380 stars 18 forks source link

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

Open patrick-mota opened 4 years ago

patrick-mota commented 4 years ago

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:incall' 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:inblock 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:inpost' 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:inping' from /usr/src/app/lib/whales_cli.rb:23:in rescue in tame' from /usr/src/app/lib/whales_cli.rb:20:intame' 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:ininvoke_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:instart' 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 commented 4 years ago

Yes, we can look at it, thanks for reporting

patrick-mota commented 4 years ago

Thank you very much @kurenn

dcnadler commented 4 years ago

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

patrick-mota commented 4 years ago

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 commented 4 years ago

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

OrlandoWhite88 commented 5 months ago

I am having the same issue:

OrlandoWhite88 commented 5 months ago

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