• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-plugin
    • git plugin 4.4.0

      Jenkins 2.164.3 with Git Plugin 3.9.3

      With the most basic Pipeline job from SCM with "Lightweight checkout" checked, the following NPE trace is the total job output.

      Unchecking "Lightweight checkout" solves the immediate NPE issue and the job completes.

      Started by user <redacted>java.lang.NullPointerException
       at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117)
       at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114)
       at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
       at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
       at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)
       at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
       at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)
       at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353)
       at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198)
       at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
       at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
       at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
       at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE
      

          [JENKINS-57587] Lightweight checkout gives NPE

          Jeff Blaine created issue -

          Mark Waite added a comment - - edited

          I am unable to duplicate the problem you're describing.

          My attempt to duplicate the problem on Jenkins 2.164.3 with git plugin 3.10.0 on Debian 9 with JDK 8:

          1. Create JENKINS-57587 branch in my jenkins-bugs repository
          2. Create a pipeline job
          3. Configure job to get Pipeline script from SCM using Git
          4. Configure git repository https://github.com/MarkEWaite/jenkins-bugs to checkout branch JENKINS-57587
          5. Leave Lightweight checkout enabled in the job definition
          6. Save the job definition
          7. Build now

          Can you provide more details on your configuration and how it is different from the configuration I tried?

          My test job uses a pipeline shared library.

          The source code at the failing location indicates that either the repository was null or the returned ObjectId was null. Neither are expected conditions.

          Mark Waite added a comment - - edited I am unable to duplicate the problem you're describing. My attempt to duplicate the problem on Jenkins 2.164.3 with git plugin 3.10.0 on Debian 9 with JDK 8: Create JENKINS-57587 branch in my jenkins-bugs repository Create a pipeline job Configure job to get Pipeline script from SCM using Git Configure git repository https://github.com/MarkEWaite/jenkins-bugs to checkout branch JENKINS-57587 Leave Lightweight checkout enabled in the job definition Save the job definition Build now Can you provide more details on your configuration and how it is different from the configuration I tried? My test job uses a pipeline shared library . The source code at the failing location indicates that either the repository was null or the returned ObjectId was null. Neither are expected conditions.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Description Original: Jenkins 2.164.3 with Git Plugin 3.9.3

          With the most basic Pipeline job from SCM with "Lightweight checkout" checked, the following NPE trace is the total job output.

          _Unchecking_ "Lightweight checkout" solves the immediate NPE issue and the job completes.

          {{Started by user <redacted>}}{{java.lang.NullPointerException}}
          {{ at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117)}}
          {{ at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114)}}
          {{ at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)}}
          {{ at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)}}
          {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)}}
          {{ at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)}}
          {{ at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)}}
          {{ at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353)}}
          {{ at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198)}}
          {{ at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)}}
          {{ at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)}}
          {{ at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)}}
          {{ at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)}}
          {{ at hudson.model.ResourceController.execute(ResourceController.java:97)}}
          {{ at hudson.model.Executor.run(Executor.java:429)}}
          {{Finished: FAILURE}}
          New: Jenkins 2.164.3 with Git Plugin 3.9.3

          With the most basic Pipeline job from SCM with "Lightweight checkout" checked, the following NPE trace is the total job output.

          _Unchecking_ "Lightweight checkout" solves the immediate NPE issue and the job completes.

          {noformat{
          Started by user <redacted>}}{{java.lang.NullPointerException
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117)
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
           at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
           at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)
           at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
           at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
           at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          {noformat}
          Mark Waite made changes -
          Description Original: Jenkins 2.164.3 with Git Plugin 3.9.3

          With the most basic Pipeline job from SCM with "Lightweight checkout" checked, the following NPE trace is the total job output.

          _Unchecking_ "Lightweight checkout" solves the immediate NPE issue and the job completes.

          {noformat{
          Started by user <redacted>}}{{java.lang.NullPointerException
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117)
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
           at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
           at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)
           at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
           at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
           at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          {noformat}
          New: Jenkins 2.164.3 with Git Plugin 3.9.3

          With the most basic Pipeline job from SCM with "Lightweight checkout" checked, the following NPE trace is the total job output.

          _Unchecking_ "Lightweight checkout" solves the immediate NPE issue and the job completes.

          {noformat}
          Started by user <redacted>}}{{java.lang.NullPointerException
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:117)
           at jenkins.plugins.git.GitSCMFileSystem$1.invoke(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
           at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
           at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)
           at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
           at jenkins.plugins.git.GitSCMFileSystem.<init>(GitSCMFileSystem.java:114)
           at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:353)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198)
           at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
           at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
           at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
           at hudson.model.ResourceController.execute(ResourceController.java:97)
           at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          {noformat}

          Mark Waite added a comment -

          Any further details jblaine?

          Mark Waite added a comment - Any further details jblaine ?

          Jeff Blaine added a comment -

          Mark, I will try to reproduce with Git Plugin 3.10.0. That wasn't available yet when we saw this failure. If it still fails, I will provide more details about our config and the job config but the latter test case is pretty simplistic.

          Jeff Blaine added a comment - Mark, I will try to reproduce with Git Plugin 3.10.0. That wasn't available yet when we saw this failure. If it still fails, I will provide more details about our config and the job config but the latter test case is pretty simplistic.

          Mark Waite added a comment -

          Since 3.10.0 doesn't change anything in this area compared to 3.9.3, I assume you will still be able to duplicate it.

          If you can duplicate it, please upload the config.xml of the job definition so that I can compare it to my test job. Also, please describe any areas where the steps you took were different than the steps I took.

          Mark Waite added a comment - Since 3.10.0 doesn't change anything in this area compared to 3.9.3, I assume you will still be able to duplicate it. If you can duplicate it, please upload the config.xml of the job definition so that I can compare it to my test job . Also, please describe any areas where the steps you took were different than the steps I took.

          Jeff Blaine added a comment -

          Yes, I can still reproduce the same NPE with "Lightweight checkout" enabled using Git Plugin 3.10.0.

          1. Our job definition uses a repo URL of the format ssh://git@bitbucket.our.org/~username/repo.git
          2. Our job definition specifies the appropriate Jenkins creds for that URL

          Maybe that will lead us somewhere?

          Jeff Blaine added a comment - Yes, I can still reproduce the same NPE with "Lightweight checkout" enabled using Git Plugin 3.10.0. Our job definition uses a repo URL of the format ssh://git@bitbucket.our.org/~username/repo.git Our job definition specifies the appropriate Jenkins creds for that URL Maybe that will lead us somewhere?

          Mark Waite added a comment -

          I used an ssh protocol Bitbucket URL (git@bitbucket.org:markewaite/jenkins-bugs.git) to clone the Pipeline with git plugin 3.10.0 and git plugin 4.0 pre-release without seeing an NPE. I also used ssh://git@bitbucket.org/markewaite/jenkins-bugs.git to check with git plugin 3.10.0. I'm using an ed235519 ssh credential with the Bitbucket repository. Unfortunately, I still can't duplicate the problem you're seeing.

          Mark Waite added a comment - I used an ssh protocol Bitbucket URL (git@bitbucket.org:markewaite/jenkins-bugs.git) to clone the Pipeline with git plugin 3.10.0 and git plugin 4.0 pre-release without seeing an NPE. I also used ssh://git@bitbucket.org/markewaite/jenkins-bugs.git to check with git plugin 3.10.0. I'm using an ed235519 ssh credential with the Bitbucket repository. Unfortunately, I still can't duplicate the problem you're seeing.

            Unassigned Unassigned
            jblaine Jeff Blaine
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: