jx: webhook on Github always fails We couldn’t deliver this payload: Failure when receiving data from the peer

Summary

webhook on Github always fails. Error msg said We couldn’t deliver this payload: Failure when receiving data from the peer

Steps to reproduce the behavior

Expected behavior

webhook should works well

Actual behavior

webhook on Github always fails. Error msg said We couldn’t deliver this payload: Failure when receiving data from the peer

Jx version

The output of jx version is:

NAME               VERSION
jx                 2.0.758
jenkins x platform 2.0.1247
Kubernetes cluster v1.13.5+icp-ee
kubectl            v1.13.5+icp-ee
helm client        Client: v2.12.3+geecf22f
git                2.23.0
Operating System   Red Hat Enterprise Linux Server release 7.6 (Maipo)


verifying packages

Jenkins type

  • Serverless Jenkins X Pipelines (Tekton + Prow)
  • Classic Jenkins

Kubernetes cluster

IBM Cloud Private 3.2.0

Operating system / Environment

RHEL 7.6

kubectl get svc,ep
NAME                                  TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/deck                          ClusterIP   10.0.201.214   <none>        80/TCP     44m
service/heapster                      ClusterIP   10.0.5.104     <none>        8082/TCP   40m
service/hook                          ClusterIP   10.0.223.151   <none>        80/TCP     44m
service/jenkins-x-chartmuseum         ClusterIP   10.0.220.196   <none>        8080/TCP   40m
service/nexus                         ClusterIP   10.0.128.133   <none>        80/TCP     40m
service/pipelinerunner                ClusterIP   10.0.145.181   <none>        80/TCP     44m
service/tekton-pipelines-controller   ClusterIP   10.0.212.128   <none>        9090/TCP   44m
service/tekton-pipelines-webhook      ClusterIP   10.0.134.175   <none>        443/TCP    44m
service/tide                          ClusterIP   10.0.1.131     <none>        80/TCP     44m

NAME                                    ENDPOINTS                            AGE
endpoints/deck                          10.1.127.199:8080,10.1.212.72:8080   44m
endpoints/heapster                      10.1.94.195:8082                     40m
endpoints/hook                          10.1.212.73:8888,10.1.229.8:8888     44m
endpoints/jenkins-x-chartmuseum         10.1.77.139:8080                     40m
endpoints/nexus                         10.1.48.139:8081                     40m
endpoints/pipelinerunner                10.1.94.196:8080                     44m
endpoints/tekton-pipelines-controller   10.1.77.137:9090                     44m
endpoints/tekton-pipelines-webhook      10.1.229.9:8443                      44m
endpoints/tide                          10.1.127.202:8888                    44m

kubectl get ing
NAME          HOSTS                               ADDRESS       PORTS   AGE
chartmuseum   chartmuseum.jx.<my-ip-addr>.nip.io   <my-ip-addr>   80      40m
deck          deck.jx.<my-ip-addr>.nip.io          <my-ip-addr>   80      40m
hook          hook.jx.<my-ip-addr>.nip.io          <my-ip-addr>   80      53s
nexus         nexus.jx.<my-ip-addr>.nip.io         <my-ip-addr>   80      40m
tide          tide.jx.<my-ip-addr>.nip.io          <my-ip-addr>   80      109s

And also there is no place to debugging.

print logs from pod hook-5b79bdd4cb-658t8 and tekton-pipelines-webhook-76c6bd5b6-29cpl do not help debugging.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 48 (5 by maintainers)

Most upvoted comments

i have changed the IP of jenkins to public ip in webhook url and it worked.

Please follow the below steps to fix the “Jenkins+Github: We couldn’t deliver this payload: Couldn’t connect to server” Github won’t be able to communicate with Jenkins which is running local /private IP address . You need to specify an IP address GitHub can contact over the internet not the actual IP address . Steps: 1.Download the https://ngrok.com/download server where it is running with Jenkins . 2…/ngrok http 8080 ,it will give one http URL …wait for some time …some time taking 2 to 3 mins . 3.http://<…>ngrok.io eg http://3b2db437.ngrok.io 4.http://<…>/github-webhook/ eg http://3b2db437.ngrok.io/github-webhook/ … ====>Don’t give port 8080 as we already passed /ngrok http 8080 5.Final test the github webhook status .

Try to use application/x-www-form-urlencoded not application/json content type.

i have changed the IP of jenkins to public ip in webhook url and it worked.

That works. Use the public IP of your server in the url instead of IP provided under Git in Configure Settings section of Jenkins.

Actually I was able to make it work. The issue I had before was because I was using the wrong IP address. Later I found out that github webhook has its own IP addresses. I was using the IP of the github.com. Once I added the three IP addresses of Github webook to my AWS security group, the payload works like a charm. Thanks.

Those can be found https://api.github.com/meta

"hooks": [
"192.30.252.0/22",
"185.199.108.0/22",
"140.82.112.0/20"
]

Jenkins is not on any container, it is working on a linux vm independently. I tried giving the github credentials to jenkins configuration.

this is the url, I am using http://frparvm-blkchn:8082/github-webhook/ I also used this url http://193.57.249.2:8082/github-webhook/

I followed this blog– https://oncomputingwell.princeton.edu/2018/01/triggering-a-jenkins-build-every-time-changes-are-pushed-to-a-git-branch-on-github/

is it an issue because, we are in our company network ?

to public ip in webhook url and it worked.

Looks a nice solution, thanks! Could you share a little bit more about how can we do the same? Thanks!

Use the public IP of your server in the url instead of IP provided under Git in Configure Settings section of Jenkins.

@sittuanand007 Ngrok is just for POC not permanent solution. you have to make your Jenkins server public if you are in private network (company network) so that git is able to connect and deliver webhook payload to your system. Check with your network team they might help you in this.

Actually I was able to make it work. The issue I had before was because I was using the wrong IP address. Later I found out that github webhook has its own IP addresses. I was using the IP of the github.com. Once I added the three IP addresses of Github webook to my AWS security group, the payload works like a charm. Thanks.

Any luck about this issue. Even though i have used the public ip in the webhook url, but no changes

Hi , I would really appreciate if anyone could share me the syntax of the payload with public IP address. I am also getting the error message “We couldn’t deliver this payload: Failure when receiving data from the peer” , even after provided public ip of jenkins server.

Use the address in the following format: http://104.211.218.105:8080/github-webhook/

Replace the ip with the public ip of your jenkins server and the port on which your jenkins is running which is by default 8080.

Hi , I would really appreciate if anyone could share me the syntax of the payload with public IP address. I am also getting the error message “We couldn’t deliver this payload: Failure when receiving data from the peer” , even after provided public ip of jenkins server.