Search code examples
dockerjenkinsjenkins-blueoceankitematicgit-webhooks

How to fix "We couldn’t deliver this payload: Couldn't connect to server" in github webhook while setting up a jenkins trigger?


I'm setting up a Web-hook in GitHub to trigger a Jenkins build for every push event. I'm running Jenkins from a Blue Ocean Docker container.

https://i.sstatic.net/10HRD.jpg

I'm able to access jenkins from http://192.168.99.101:32771/ , as specified in the docker container. I have specified the git repository and checked "GitHub hook trigger for GITScm polling" checkbox.

I am able to manually kick off the build process after a commit, but when I setup the webhook in github with the payload url http://192.168.99.101:32771/github-webhook/ and commit something, I get the error "We couldn’t deliver this payload: Couldn't connect to server"

Other solutions I've looked at.

  1. Using ngrok. But I'm not running this on localhost.
  2. I tried using a Personal Access Token and created an automatic webhook from Jenkins to Github. And I got the same error.

What am I missing, or what am I doing wrong?


Solution

  • Github will never reach to your Jenkins Server as your server is only accessible with-in network.

    The error is very clear.

    We couldn’t deliver this payload: Couldn't connect to server

    http://192.168.99.101:32771 this is the same as your local host in term of access it from outside of the network.

    Possible solution.

    • Run jenkins on some remote server with Internet access and give that IP in the webhook of the Github
    • Pass your public IP to Github, maybe you still issue with define port forwarding if there is any issue with access.