Hi Team,

      We are facing issue with Azure Devops Service Hook Trigger Git Build when we are pushing the changes the Jenkins build is not starting, we are getting HTTP 500 server error.

      Please find the below response & request for the same.

      Request:

      Method: GET
      URI: https://<Jenkins URL>/git/notifyCommit?url=https:%2F%2Ffabrikam-fiber-inc.visualstudio.com%2FDefaultCollection%2F_git%2FFabrikam-Fiber-Git&sha1=fnrfnifniedidbedediqeodxjqosjiew&branches=master
      HTTP Version: 1.1
      Headers:

      {   X-VSS-ActivityId: fienfifiwnind-fnrdivcuibuiescv-cujhsbc   X-VSS-SubscriptionId: recdcic-fnreci-veicikdnci   User-Agent: VSServices/16.205.33618.1   User-Agent: (w3wp.exe)   Authorization: Basic ******** }

       

      Response:

      Status Code: 500
      Reason Phrase: Server Error
      HTTP Version: 1.1
      Headers:

      {   X-Jenkins-Session: 5ec30227   X-Instance-Identity:    Cross-Origin-Opener-Policy: same-origin   X-Hudson-Theme: default   X-Content-Type-Options: nosniff   Connection: close   X-Hudson: 1.395   X-Frame-Options: sameorigin   Referrer-Policy: same-origin   X-Jenkins: 2.426.2   Cache-Control: no-store, must-revalidate, no-cache   Date: Tue, 02 Jan 2024 05:49:18 GMT   Set-Cookie:   Server: Jetty(10.0.18)   Content-Length: 9869   Content-Type: text/html; charset=utf-8   Expires: Thu, 01 Jan 1970 00:00:00 GMT }

      We have also checked the Jenkins Master logs and we see below error in the logs.

      2024-01-04 07:28:42.536+0000 [id=288646465]  WARNING h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID firnfirn-c4jrnb1-4vrve11-avesef352-13vr445893b10bc
      java.lang.NullPointerException: Cannot invoke "hudson.scm.SCM.getKey()" because "scm" is null

       

      Can someone please help us to resolve this issue.

          [JENKINS-72519] Jenkins Trigger Git NotifyCommit Issue

          Mark Waite added a comment -

          I am unable to duplicate the issue based on your description. You'll need to provide more details, including the specific plugin versions you are using and a sample configuration that others can use to duplicate the issue. The log entries containing the unhandled exception may also be helpful in the diagnosis, since they will likely have a stack trace for the null pointer exception.

          The sample command that I used was:

          curl -s 'http://localhost:8080/git/notifyCommit?url=https://github.com/MarkEWaite/git-client-plugin&token=mytoken-inserted-here&branches=master&sha1=deadbeef'
          

          I did not URL encode the '/' characters as is done in your case, so that might be one difference. I provide a notifyCommit token. that might be another difference. The plugin versions that I'm using are documented in my plugins.txt file.

          Mark Waite added a comment - I am unable to duplicate the issue based on your description. You'll need to provide more details, including the specific plugin versions you are using and a sample configuration that others can use to duplicate the issue. The log entries containing the unhandled exception may also be helpful in the diagnosis, since they will likely have a stack trace for the null pointer exception. The sample command that I used was: curl -s 'http: //localhost:8080/git/notifyCommit?url=https://github.com/MarkEWaite/git-client-plugin&token=mytoken-inserted-here&branches=master&sha1=deadbeef' I did not URL encode the '/' characters as is done in your case, so that might be one difference. I provide a notifyCommit token. that might be another difference. The plugin versions that I'm using are documented in my plugins.txt file .

          Hi markewaite

          We have tried to do a curl request to check if the build is running or not but we received following HTML logs.

           Oops!</span></h1><div id="error-description"><h2 style="text-align: center">A problem occurred while processing the request.</h2><p style="text-align: center">Logging ID=</div></div></div><footer class="page-footer jenkins-mobile-hide"><div class="page-footer_flex-row"><div class="page-footerfooter-id-placeholder" id="footer"></div><div class="page-footer_links"><a class="jenkins-button jenkins-button-tertiary rest-api" href="api/">REST API</a><button type="button" class="jenkins-button jenkins-button-tertiary jenkins_ver" data-dropdown="true">

          Also we have tried to setup a new jenkins with same plugins from this one and on that new Jenkins it is working without any issue but for out Prod Jenkins we are facing this issue.

          Can you help us here to fix this issue.

          Ashutosh Satpute added a comment - Hi markewaite We have tried to do a curl request to check if the build is running or not but we received following HTML logs.  Oops!</span></h1><div id="error-description"><h2 style="text-align: center">A problem occurred while processing the request.</h2><p style="text-align: center">Logging ID=</div></div></div><footer class="page-footer jenkins-mobile-hide"><div class="page-footer_ flex-row"><div class="page-footer footer-id-placeholder" id="footer"></div><div class="page-footer _links"><a class="jenkins-button jenkins-button- tertiary rest-api" href="api/">REST API</a><button type="button" class="jenkins-button jenkins-button -tertiary jenkins_ver" data-dropdown="true"> Also we have tried to setup a new jenkins with same plugins from this one and on that new Jenkins it is working without any issue but for out Prod Jenkins we are facing this issue. Can you help us here to fix this issue.

          Mark Waite added a comment -

          Can you help us here to fix this issue.

          I can't really help you fix the issue because you've not described the environment well enough to allow others to duplicate the issue. "How to report an issue" provides a detailed list of the types of information needed in a bug report. It includes a script that will list the plugins that are installed and their exact versions. You can run the same script on your working server and compare the installed plugins and their versions. If there is a difference between the plugins on the working server and the plugins on the non-working server, you can fix that by installing the working versions.

          If enough information is not provided so that others can duplicate the issue, I'll close this issue as "Cannot reproduce".

          Mark Waite added a comment - Can you help us here to fix this issue. I can't really help you fix the issue because you've not described the environment well enough to allow others to duplicate the issue. "How to report an issue" provides a detailed list of the types of information needed in a bug report. It includes a script that will list the plugins that are installed and their exact versions. You can run the same script on your working server and compare the installed plugins and their versions. If there is a difference between the plugins on the working server and the plugins on the non-working server, you can fix that by installing the working versions. If enough information is not provided so that others can duplicate the issue, I'll close this issue as "Cannot reproduce".

            Unassigned Unassigned
            ashutosh30 Ashutosh Satpute
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: