Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44955

Pipeline: Github push event does not trigger jenkins build job

      I did search in the previous bug reports about this topic and the various documentations available on the Internet.

      Pls excuse me for re-posting the issue as the above references did not either solve the problem or the use-case scenarios were quite different.

      I've created a small pipeline that uses basic steps to print messages on stdout, list files in dir. This job is working fine when triggered manually. The job's pipeline script is hosted in a public github repo which is hosted in our internal github enterprise server. 

      Github webhook was setup in such a way as to accept any event that arrives at this repo and send the event to the jenkins master. Though the push event reaches the Jenkins master, build job is not triggered.

      I have attached the screenshot of the jenkins log where the push event is noticed.

      Am I missing something here? 

      Any help would be appreciated.

      /Ram

          [JENKINS-44955] Pipeline: Github push event does not trigger jenkins build job

          Mark Waite added a comment -

          I don't have any insights to offer. I'm very glad you searched other issues. That's a very good step.

          You may get better results by asking your question on the Jenkins user mailing list. There are far more users monitoring that list than monitor bug reports for specific plugins.

          Mark Waite added a comment - I don't have any insights to offer. I'm very glad you searched other issues. That's a very good step. You may get better results by asking your question on the Jenkins user mailing list. There are far more users monitoring that list than monitor bug reports for specific plugins.

          Ramanathan M added a comment -

          For the benefit of those who may come across similar issue, let me share some details of how this was fixed.
           
          Internal Setup:
          ============
          Jenkins instance is in cloud, from the cloud we have no direct connectivity to enterprise github server which is in a data center.
          And, requests from Jenkins to github was routed via proxy in cloud.
           
          Given this setup, we opted to go for AWS SNS + AWS Lambda solution.
           
          Event Flow:
          ==========
          In Github repo, SNS topic is added and the payload of Github event is sent to Lambda which subscribes to SNS topic.
          Lambda processes the payload and relays it to appropriate Jenkins master (multiple masters in cloud).
           
          Problem:
          =======
          However, PUSH event that reaches the master (correctly) was not triggering the job (both freestyle and pipeline).
          It turned out be that github URL that reaches the master was not matching with URL set in the job config.
           
          Recall from the setup section, Jenkins' communicates with the github server via the proxy.
          It was this URL (pointing to the proxy) that was in the job but the event payload sent from github had different URL.
           
          So, in the Lambda, we changed the URL to match with that of the proxy before relaying to Jenkins master.
          Eventually, this did the trick and PUSH event was followed by poking of the job that resulted in triggering a fresh build of that job.

          Ramanathan M added a comment - For the benefit of those who may come across similar issue, let me share some details of how this was fixed.   Internal Setup: ============ Jenkins instance is in cloud, from the cloud we have no direct connectivity to enterprise github server which is in a data center. And, requests from Jenkins to github was routed via proxy in cloud.   Given this setup, we opted to go for AWS SNS + AWS Lambda solution.   Event Flow: ========== In Github repo, SNS topic is added and the payload of Github event is sent to Lambda which subscribes to SNS topic. Lambda processes the payload and relays it to appropriate Jenkins master (multiple masters in cloud).   Problem: ======= However, PUSH event that reaches the master (correctly) was not triggering the job (both freestyle and pipeline). It turned out be that github URL that reaches the master was not matching with URL set in the job config.   Recall from the setup section, Jenkins' communicates with the github server via the proxy. It was this URL (pointing to the proxy) that was in the job but the event payload sent from github had different URL.   So, in the Lambda, we changed the URL to match with that of the proxy before relaying to Jenkins master. Eventually, this did the trick and PUSH event was followed by poking of the job that resulted in triggering a fresh build of that job.

            Unassigned Unassigned
            mramanathan Ramanathan M
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: