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

Null Pointer exception when no default parameter provided

    Details

    • Similar Issues:

      Description

      I see the following error frequently in /var/log/jenkins/jenkins.log

       

      Aug 15, 2017 10:27:06 PM net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition getDefaultParameterValue
      SEVERE: nullUnexpected error!
      java.lang.NullPointerException

      I assume this is occurring because I did not set a default value for the Git Parameter on many jobs. A default value should not be required, or a missing default value should at least be handled better. 

       

      The exception is probably being thrown here:

      https://github.com/jenkinsci/git-parameter-plugin/blob/5b14c821d41e896f1f0b619c4d1daee18f716785/src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java#L150

        Attachments

          Activity

          Hide
          klimas7 Boguslaw Klimas added a comment -

          Hi Matthew Smith,

          Can you add some more information about your environment (versions of: Git client plugin, Git plugin, Git Parameter Plug-In) and more logs (mayby you have full stack trace)

          Default value is not mandatory.

          Please look at this issue JENKINS-44087. Is not this the same thing?

           

          Regards

          Boguslaw

           

          Show
          klimas7 Boguslaw Klimas added a comment - Hi Matthew Smith , Can you add some more information about your environment (versions of: Git client plugin, Git plugin, Git Parameter Plug-In) and more logs (mayby you have full stack trace) Default value is not mandatory. Please look at this issue  JENKINS-44087 . Is not this the same thing?   Regards Boguslaw  
          Hide
          mksmith Matthew Smith added a comment -

          I've updated the environment with more versions. I'm not really sure how to get more of a stack trace, since the Jenkins logs just show the message I posted above (around every 10 minutes). 

          My understanding of 44087 is that the exception would occur if a job was never built. That is a possibility in my case, however I don't know why this would be causing an exception so frequently. And I'm also not sure which build would be causing this (since there are many jobs on our Jenkins server that use the Git Parameter plugin. 

          Show
          mksmith Matthew Smith added a comment - I've updated the environment with more versions. I'm not really sure how to get more of a stack trace, since the Jenkins logs just show the message I posted above (around every 10 minutes).  My understanding of 44087 is that the exception would occur if a job was never built. That is a possibility in my case, however I don't know why this would be causing an exception so frequently. And I'm also not sure which build would be causing this (since there are many jobs on our Jenkins server that use the Git Parameter plugin. 
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Boguslaw Klimas
          Path:
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java
          http://jenkins-ci.org/commit/git-parameter-plugin/e3869b10b05b76f1f78f32ccbf7c539624e3e230
          Log:
          Merge pull request #52 from jenkinsci/bugfix/JENKINS-46216

          Null Pointer exception when no default parameter provided

          Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/d8a0c6f66e0f...e3869b10b05b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Boguslaw Klimas Path: src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java http://jenkins-ci.org/commit/git-parameter-plugin/e3869b10b05b76f1f78f32ccbf7c539624e3e230 Log: Merge pull request #52 from jenkinsci/bugfix/ JENKINS-46216 Null Pointer exception when no default parameter provided Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/d8a0c6f66e0f...e3869b10b05b
          Hide
          klimas7 Boguslaw Klimas added a comment -

          Hi Matthew Smith

          I was change a way to get the job name, this should eliminate 'null' in log.
          In Jenkins log you should have full stacktrace eg.

          maj 04, 2017 10:12:28 PM net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition generateContents 
          SEVERE: [ Learn_github_2 ] Niespodziewany błąd! 
          java.lang.NullPointerException 
                 at hudson.model.Fingerprint.addFor(Fingerprint.java:1023) 
                 at com.cloudbees.plugins.credentials.CredentialsProvider.trackAll(CredentialsProvider.java:1458) 
                 at com.cloudbees.plugins.credentials.CredentialsProvider.track(CredentialsProvider.java:1422) 
                 at hudson.plugins.git.GitSCM.createClient(GitSCM.java:767) 
                 at hudson.plugins.git.GitSCM.createClient(GitSCM.java:743) 
                 at net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.getGitClient(GitParameterDefinition.java:457)
                 ...
          Show
          klimas7 Boguslaw Klimas added a comment - Hi Matthew Smith I was change a way to get the job name, this should eliminate 'null' in log. In Jenkins log you should have full stacktrace eg. maj 04, 2017 10:12:28 PM net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition generateContents SEVERE: [ Learn_github_2 ] Niespodziewany błąd! java.lang.NullPointerException        at hudson.model.Fingerprint.addFor(Fingerprint.java:1023)        at com.cloudbees.plugins.credentials.CredentialsProvider.trackAll(CredentialsProvider.java:1458)        at com.cloudbees.plugins.credentials.CredentialsProvider.track(CredentialsProvider.java:1422)        at hudson.plugins.git.GitSCM.createClient(GitSCM.java:767)        at hudson.plugins.git.GitSCM.createClient(GitSCM.java:743)        at net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.getGitClient(GitParameterDefinition.java:457) ...
          Hide
          klimas7 Boguslaw Klimas added a comment -

          release 0.8.1

          Show
          klimas7 Boguslaw Klimas added a comment - release 0.8.1

            People

            • Assignee:
              klimas7 Boguslaw Klimas
              Reporter:
              mksmith Matthew Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: