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

git plugin with repo that has empty .gitmodules file NPE during submodule update

    Details

    • Similar Issues:
    • Released As:
      git-4.0.0

      Description

      If a git repository happens to have an empty .gitmodules file, then the git client plugin will assume that the repository has submodules. Then, when the submodule Update code is run, it will crash with what appeared to be a Null Pointer exception.

      (my jenkins instance is having other issues, which prevent me from extracting the exceptions stack trace at the moment, but once I have it, I will update the bug.).

      java.lang.NullPointerException
                      at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:133)
                      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1256)
                      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
                      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:90)
                      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:77)
                      at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
                      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                      at java.lang.Thread.run(Thread.java:748)
      

        Attachments

          Issue Links

            Activity

            jekeller Jacob Keller created issue -
            Hide
            markewaite Mark Waite added a comment - - edited

            Thanks for the report. I'm unable to duplicate the problem with the simple minded test case I attempted.

            See https://github.com/MarkEWaite/jenkins-bugs/blob/JENKINS-56150/Jenkinsfile for my attempt.

            Any other details on the conditions which cause the NPE or the stack trace from the NPE?

            Show
            markewaite Mark Waite added a comment - - edited Thanks for the report. I'm unable to duplicate the problem with the simple minded test case I attempted. See https://github.com/MarkEWaite/jenkins-bugs/blob/JENKINS-56150/Jenkinsfile for my attempt. Any other details on the conditions which cause the NPE or the stack trace from the NPE?
            markewaite Mark Waite made changes -
            Field Original Value New Value
            Assignee Mark Waite [ markewaite ]
            markewaite Mark Waite made changes -
            Description If a git repository happens to have an empty .gitmodules file, then the git client plugin will assume that the repository has submodules. Then, when the submodule Update code is run, it will crash with what appeared to be a Null Pointer exception.

            (my jenkins instance is having other issues, which prevent me from extracting the exceptions stack trace at the moment, but once I have it, I will update the bug.).
            If a git repository happens to have an empty .gitmodules file, then the git client plugin will assume that the repository has submodules. Then, when the submodule Update code is run, it will crash with what appeared to be a Null Pointer exception.

            (my jenkins instance is having other issues, which prevent me from extracting the exceptions stack trace at the moment, but once I have it, I will update the bug.).

            {noformat}
            java.lang.NullPointerException
                            at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:133)
                            at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1256)
                            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
                            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:90)
                            at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:77)
                            at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                            at java.lang.Thread.run(Thread.java:748)
            {noformat}
            Hide
            markewaite Mark Waite added a comment -

            Fixed in git client plugin 3.0.0 once that releases

            Show
            markewaite Mark Waite added a comment - Fixed in git client plugin 3.0.0 once that releases
            markewaite Mark Waite made changes -
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            Resolution Fixed [ 1 ]
            Hide
            renescheibe René Scheibe added a comment -

            Is there any commit/pull request for the fix that can be referenced here?
            The ticket status should then also be set to "Resolved" and the "Released As" info be populated.

            Show
            renescheibe René Scheibe added a comment - Is there any commit/pull request for the fix that can be referenced here? The ticket status should then also be set to "Resolved" and the "Released As" info be populated.
            Hide
            markewaite Mark Waite added a comment -

            Sorry, no pull request to reference. Since there was no response to my request for information, it can either be resolved as "Cannot reproduce" or as "Fixed in 3.0.0". Either is fine with me.

            Show
            markewaite Mark Waite added a comment - Sorry, no pull request to reference. Since there was no response to my request for information, it can either be resolved as "Cannot reproduce" or as "Fixed in 3.0.0". Either is fine with me.
            renescheibe René Scheibe made changes -
            Remote Link This issue links to "git-plugin pr#678 (Web Link)" [ 24205 ]
            renescheibe René Scheibe made changes -
            Component/s git-plugin [ 15543 ]
            Component/s git-client-plugin [ 17423 ]
            Hide
            renescheibe René Scheibe added a comment -

            I found the respective pull request and added a link to the ticket.

            Show
            renescheibe René Scheibe added a comment - I found the respective pull request and added a link to the ticket.
            renescheibe René Scheibe made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
            Released As git-4.0.0
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                jekeller Jacob Keller
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: