stakater / GitWebhookProxy

A proxy to let webhooks reach running services behind a firewall – [✩Star] if you're using it!
https://stakater.com
Apache License 2.0
188 stars 52 forks source link

Does not work with Jenkins Github Plugin #76

Closed rlopez4 closed 4 years ago

rlopez4 commented 5 years ago

image

When attempting to override the Web hook url for the Github plugin a 400 response is returned. The gitwebhookproxy logs show that this is because of missing headers. The Github plugin is trying to validate the endpoint by sending a request with a test header: https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github/config/GitHubPluginConfig.java#L214-L241

rasheedamir commented 4 years ago

@rlopez4 our apologies for late response; somehow missed it. Were you able to find a work around or still stuck?

davidkarlsen commented 4 years ago

also did you try to change payload from urlencoded to json in github?

rlopez4 commented 4 years ago

Hey guys, I ended up just managing webhooks manually.

MateuszKuchniak-TomTom commented 4 years ago

Facing same issue, switching from urlencoded to json in github is not solving. Also disabling the authentication does not help.

Unfortunately I am unable to get it working when deploying on k8s cluster. With authentication the webhooks do not work returning 400 without authentication they go through when using urlencoded but the job is not triggered due to the problem on the webproxy:

Error Redirecting '/github-webhook' to upstream', Upstream Redirect Status: 405 Method Not Allowed

So not much of a use so far for me.

PatTheSilent commented 4 years ago

Error Redirecting '/github-webhook' to upstream', Upstream Redirect Status: 405 Method Not Allowed

Check that the webhook you configured in Jenkins has a trailing /. That bit wasted 2 days of my life.

gcwiak commented 4 years ago

Error Redirecting '/github-webhook' to upstream', Upstream Redirect Status: 405 Method Not Allowed

Check that the webhook you configured in Jenkins has a trailing /. That bit wasted 2 days of my life.

@PatTheSilent Thanks for saving me 2 days of life! :D

hazim1093 commented 4 years ago

Thanks for helping @PatTheSilent, I have added this in the troubleshooting sections of the readme for people who face this issue in the future.

https://github.com/stakater/GitWebhookProxy/blob/master/README.md#troubleshooting

smaroof commented 2 years ago

I am using / in the end , still the problem persists

MorteAAA commented 1 year ago

Even with / at the end did not work, make sure the url match in GitWebhookProxy upstreamURL and Jenkins setting "Override Hook URL 'Specify another hook URL for GitHub configuration' " in our case the 's' in https was missing.