Closed dove-young closed 3 years ago
I'm facing the same issue too.
i'm facing the same issue with freestyle project.
i have changed the IP of jenkins to public ip in webhook url and it worked.
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.
Looks like we need a FAQ for this one.
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!
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.
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.
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.
Thank you for your response , i updated in the same way , however still getting the same issue. Not sure it is because the github enabled with SSO .
Try to use application/x-www-form-urlencoded
not application/json
content type.
I'm seeing the same issue for our GHE. We too have SSO enabled but we are using a token so that shouldn't be an issue. Changing to the ip of the loadbalancer in front of our jenkins doesn't help
I'm facing the same issue by the looks of it. Has anyone managed to find the solution?
any updates on this?
Having same issue ,Please kindly post/share how to fix this issue .
Any luck about this issue. Even though i have used the public ip in the webhook url, but no changes
@vamsilella , if you can check
@himanshush13 can you provide more details like webhook url / payload is SSO enabled? is your jenkins hosted on any container? or is it on ec2? This would help debugging the issue.
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 .
step 4 to update the github webhook URL .
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 ?
you can use the above ip http://193.57.249.2:8082/ to access jenkins dashboard within your company using VPN. But github needs an IP ( public ) which can be accessible through internet so your payload should be
http://publicip:8082/github-webhook/
and using http://frparvm-blkchn:8082 as it's not a public domain its just the hostname so github doesn't know what it is... as github is not hosted in your company network ;) just kidding.
@vamsilella I am also facing same issue and i am also in company network. But i am not sure how can i get public IP for a machine in private network. I tried ngrok but that is not working. i found smee and smee-client topic but i am not sure how to configure smee-client on my windows machine. will you please help me in triggering jenkins using webhook. Thanks in advance!!!
@shyamshinde008 its the IT job to assign a static IP to the server where your Jenkins master is running and hostname should be set in that server (get a sub domain from IT) and they have to whitelist either bitbucket/github for ingress. thats it.
I have the same issue. In my case, my Jenkins is running on an EC2 in AWS and it does have a public IP address. I have opened up port 8080 for HTTP traffic from github.com. When I pasted the payload URL directly to a browser I got this java error: java.lang.Exception: Method POST required. This at least indicates the URL hit the Jenkins server.
So I really have no idea why the payload could not be delivered.
Any help is appreciated.
Install GitHub Integration plugin and check.
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 .
This actually worked for me. I am working locally on my machine. Don't know how big companies work this issue out. Thanks a lot. Just that the I downloaded the ngrok and unzipped the file. Opened the command window from the folder the ngrok.exe was stored and executed command 'ngrok http 8080' as stated earlier and had to wait. I got 2 addresses(names) - one with 'http' and the other with 'https'. I used the 'https://......ngrok.io/github-webhook/' address for webhook in github and it worked.
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.
I don't think this is an issue anymore. Can we close 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.
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"
]
Yes. That is right.
Ngrok will be temporary solution right because after the session ends, we will further have to get it configured from the beginning. I am working on my company's VM which is in private network. My doubt is that I have configured Jenkins on localhost in the vm that is in private network. As we know that localhost generally runs on http. So if I want my Jenkins to have https, so what will be the approach for that ?? When I will get a static IP assigned to the VM and when the IT dept will give me a sub-domain, then will it be http or https ?
@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.
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.
Could you please state this more clearly? Is this operation happening in Jenkins, is it happening in Github? Please specify the exact steps
Try to use
application/x-www-form-urlencoded
notapplication/json
content type.
Thanks mate! this saved my lot of time!!!
I have updated the IP with the current public IP of the server. It works like a charm.
Cloud server often gets the new public IP and it happens that webhook has an old IP and updating it to current public IP will solve the issue,
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://jenkins-x.io/community.
/lifecycle stale
I ran into this issue when using CloudFlare in Proxy mode.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://jenkins-x.io/community.
/lifecycle rotten
Are you using HTTPS?? If so, try to use without it, just http.
So, instead of using: https://yourdomain.com:8099/github-webhook/, use
http://yourdomain.com:8099/github-webhook/
and you can use application/json as CONTENT TYPE.. it will work.
Good luck!
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Provide feedback via https://jenkins-x.io/community.
/close
@jenkins-x-bot: Closing this issue.
ngrok solution worked for me... very cool!! Thanks all
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.
Im using like that but im facing the same issue
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 .
You're the best, bro. Worked for me! (When you run ngrok in the terminal, keep it there, don't close it, so it can "introspected tunnels to localhost") Not sure if this is the original repo: https://github.com/inconshreveable/ngrok But you can see the diagram there to make sense out of this, if you're a beginner like me
you can use the above ip http://193.57.249.2:8082/ to access jenkins dashboard within your company using VPN. But github needs an IP ( public ) which can be accessible through internet so your payload should be
http://publicip:8082/github-webhook/
and using http://frparvm-blkchn:8082 as it's not a public domain its just the hostname so github doesn't know what it is... as github is not hosted in your company network ;) just kidding.
@vamsilella how to find the public ip of jenkins hosted on an azure vm. I can access jenkins using http://ip:8080, if this ip is not a public ip then how can I get it?
Actually am using in virtual box centos.jenkins is running but it shows connection failed to the host.please give a solution.am using the inet ip ipv4
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 .
This works for testing purposes
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:Jenkins type
Kubernetes cluster
IBM Cloud Private 3.2.0
Operating system / Environment
RHEL 7.6
And also there is no place to debugging.
print logs from pod
hook-5b79bdd4cb-658t8
andtekton-pipelines-webhook-76c6bd5b6-29cpl
do not help debugging.