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

Repeatable intermittent svn update failures due to NPE

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • subversion-plugin
    • None
    • Jenkins 2.73.2 master on Windows 7 64 bit (installed w/ installer), with a Centos 7 64-bit slave using SSH.

      relevant plugins:
      Conditional BuildStep 1.3.6
      SSH Slaves 1.22
      Subversion 2.9

      I have a multi-configuration project set up to build the same code on Windows and Linux. I have only recently added the CentOS 7 machine in attempt to complete the configuration.

      The build is split by using the Conditional BuildStep plugin and assigning a Windows batch command to a build on the Windows node, and a Linux shell command to the build on the Linux node.

      For the moment I have disabled the Windows conditional step. When I trigger the build manually, the Linux slave machine will repeatably fail every other build when it attempts to do an update from the Subversion repository. Connectivity is fine, but there's some null pointer exception happening during the update:

      14:36:54 Updating <removed> at revision '2017-11-01T15:36:42.270 -0500'
      14:36:55 Using sole credentials <removed> in realm <removed>
      14:36:57 At revision 6154
      {{14:36:57 }}
      14:36:58 FATAL: null
      14:36:58 java.lang.NullPointerException
      14:36:58     at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:123)
      14:36:58     at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:730)
      14:36:58     at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:865)
      14:36:58     at hudson.scm.SCM.checkout(SCM.java:495)
      14:36:58     at hudson.model.AbstractProject.checkout(AbstractProject.java:1212)
      14:36:58     at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:566)
      14:36:58     at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      14:36:58     at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:491)
      14:36:58     at hudson.model.Run.execute(Run.java:1737)
      14:36:58     at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
      14:36:58     at hudson.model.ResourceController.execute(ResourceController.java:97)
      14:36:58     at hudson.model.Executor.run(Executor.java:421)

      On the next attempt to run the build, it succeeds without a problem. It does not have any time dependence - I can wait for days to re-run the build and it will succeed or fail based on whether it succeeded or failed previously:

      11:24:56 Updating <removed> at revision '2017-11-06T11:24:24.070 -0600'
      11:24:57 Using sole credentials <removed> in realm <removed>
      11:25:00 At revision 6157
      {{11:25:00 }}
      11:25:00 Run condition [Never] preventing prebuild for step [Execute Windows batch command]
      11:25:00 Run condition [Execution node ] enabling prebuild for step [Execute shell]
      11:25:00 Run condition [Never] preventing perform for step [Execute Windows batch command]
      11:25:00 [Execution node] check if [Centos7-Build] is in [[Centos7-Build]]
      11:25:00 Run condition [Execution node ] enabling perform for step [Execute shell]

      I have the svn update mechanism set to 'Emulate clean checkout' but I have also tried 'always check out a fresh copy.' Both fail in the same way.

          [JENKINS-47844] Repeatable intermittent svn update failures due to NPE

          This appears to be an issue if, and only if, the directory supplied to the SVN plugin as the checkout directory contains characters that would normally need to be escaped. I'm not sure it has anything to do with being a multi-configuration project.

          I.e., if I check out my repo into the directory "blahblah\workspace", this issue occurs. If I change it to check into just "workspace" it does not.

          Philip Mainwaring added a comment - This appears to be an issue if, and only if, the directory supplied to the SVN plugin as the checkout directory contains characters that would normally need to be escaped. I'm not sure it has anything to do with being a multi-configuration project. I.e., if I check out my repo into the directory "blahblah\workspace", this issue occurs. If I change it to check into just "workspace" it does not.

          Vassilena Treneva added a comment - - edited

          We often see the same issue in our environments.

          Running on Jenkins ver. 2.113 and Subversion Plug-in 2.10.5

          java.lang.NullPointerException
          at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:123)
          at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:757)
          at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:892)
          at hudson.scm.SCM.checkout(SCM.java:504)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
          at hudson.model.Run.execute(Run.java:1727)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)

          Vassilena Treneva added a comment - - edited We often see the same issue in our environments. Running on Jenkins ver. 2.113 and Subversion Plug-in 2.10.5 java.lang.NullPointerException at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:123) at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:757) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:892) at hudson.scm.SCM.checkout(SCM.java:504) at hudson.model.AbstractProject.checkout(AbstractProject.java:1208) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1727) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)

          Chris added a comment -

          I realise this one is old but this has been causing us problems today. It seems to be related to externals as checking the 'Ignore Externals' option seems to fix it. Obviously not a workaround if your project relies on externals!

          Running Jenkins 2.277.3 and Subversion 2.14.0

          Chris added a comment - I realise this one is old but this has been causing us problems today. It seems to be related to externals as checking the 'Ignore Externals' option seems to fix it. Obviously not a workaround if your project relies on externals! Running Jenkins 2.277.3 and Subversion 2.14.0

          Tom Hall added a comment - - edited

          I am seeing something very similar, but it isn't fixed by enabling 'ignore externals'. This is the checkout call in our pipeline:

           

          checkout([
              $class: 'SubversionSCM',
              locations: [[
                 cancelProcessOnExternalsFail: true,
                 credentialsId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
                 depthOption: 'infinity',
                 ignoreExternalsOption: true,
                 local: "${path}",
                 remote: "http://our-svn-server/${svnBranch}/${path}"
              ]],
              quietOperation: false,
              workspaceUpdater: [$class: 'NoopUpdater']
           ])

           And this is the output:

          java.lang.NullPointerException
              at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:121)
              at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:766)
              at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:915)
              at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
              at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)
              at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)
              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)

          For some reason it almost consistently fails every other build.

          Running Jenkins 2.303.1, subversion plugin 2.14.5

          Tom Hall added a comment - - edited I am seeing something very similar, but it isn't fixed by enabling 'ignore externals'. This is the checkout call in our pipeline:   checkout([ $class: 'SubversionSCM' , locations: [[ cancelProcessOnExternalsFail: true , credentialsId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' , depthOption: 'infinity' , ignoreExternalsOption: true , local: "${path}" , remote: "http: //our-svn-server/${svnBranch}/${path}" ]], quietOperation: false , workspaceUpdater: [$class: 'NoopUpdater' ] ])  And this is the output: java.lang.NullPointerException at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:121) at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:766) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:915) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84) 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) For some reason it almost consistently fails every other build. Running Jenkins 2.303.1, subversion plugin 2.14.5

          Tom Hall added a comment -

          Problem still exists after upgrading to Jenkins 2.303.2 and subversion plugin 2.15.0

          Tom Hall added a comment - Problem still exists after upgrading to Jenkins 2.303.2 and subversion plugin 2.15.0

            Unassigned Unassigned
            pmainwaring Philip Mainwaring
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: