etsy / 411

An Alert Management Web Application
https://demo.fouroneone.io
MIT License
971 stars 112 forks source link

Webhook/slack is giving a Target webhook/slack: Remote server returned 0 #36

Closed ghost closed 7 years ago

ghost commented 8 years ago

Hi,

I am trying to use the webhook capability but keep getting Target webhook: Remote server returned 0 on a slack webhook

kiwiz commented 8 years ago

Possibly related to #30. To confirm: You're using the Slack target and not the WebHook target?

ghost commented 8 years ago

I tried Both with the same result. Maybe i am using the wrong slack url. I used the slack incoming webhook. Btw, it does Work when i dont have a proxy in between

kiwiz commented 8 years ago

Interesting. How's this proxy set up?

ghost commented 8 years ago

Hmm, problem exists between keyboard and chair (my fault). I had made a docker container which runs your great project but only set the proxy on buildtime and forgot to set the proxy settings on runtime.

so got the slack working webhook still giving the same error though.

kiwiz commented 8 years ago

It might be that curl isn't using the proxy settings.

Can you try adding those settings to https://github.com/etsy/411/blob/master/phplib/Target/Slack.php to test this? Example here: https://github.com/php-curl-class/php-curl-class/blob/master/examples/proxy.php

kiwiz commented 8 years ago

@ChristiaanDouma Both of those use the similar Curl logic. If this is still a problem, can you investigate what err curl is returning?

ghost commented 7 years ago

@kiwiz i got it solved. I having this problem in a docker container setup and set the http(s) proxy settings as environment settings.

ghost commented 7 years ago

hm, in cron couldnt get it working only by adding your suggested curl options

kiwiz commented 7 years ago

¯_(ツ)_/¯ Does the ENV setting still work? If so, that's good enough. Hopefully a standard way to do it will come from #26!

ghost commented 7 years ago

I added the curl logic to Curl.php Also had to add verifyhost, verifypeer and no_proxy.

Furthermore had to alter the crontab with . ~/.profile && ....

In the profile I also put the proxy settings

Now it works.

Maybe add these properties to the Config.php?

Grtz

kiwiz commented 7 years ago

@ChristiaanDouma What did you specify for the no_proxy opt?

Edit: Actually, can you open a PR with the modified Curl.php?

ghost commented 7 years ago

I had to opt out our own interval servers.

kiwiz commented 7 years ago

Closing this for now. Tracking docker related things in #26