• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • vault-scm-plugin
    • Jenkins 1.596, Win7-64, Vault SCM Plugin 1.1.1, SourceGear Vault Pro 6.0.1

      A NullPointerException occurs when Jenkins attempts to perform an SCM poll for any job. The stack trace would seem to indicate FilePath exec is null in line 326 of VaultSCM.java.

      A Vault SCM checkout completes successfully when a build is kicked off manually. I tried leaving the 'Path to Vault executable' field blank and using the default value configured but without success.

      Stack trace:
      Jan 19, 2015 8:26:00 AM org.jvnet.hudson.plugins.VaultSCM compareRemoteRevisionWith
      INFO: Last Build Date set to Wed Jan 14 10:19:55 EST 2015
      Jan 19, 2015 8:26:00 AM hudson.triggers.SCMTrigger$Runner runPolling
      SEVERE: Failed to record SCM polling for hudson.model.FreeStyleProject@3ab722[FAB22_FABMain]
      java.lang.NullPointerException
      at org.jvnet.hudson.plugins.VaultSCM.getVaultPath(VaultSCM.java:334)
      at org.jvnet.hudson.plugins.VaultSCM.determineChangeCount(VaultSCM.java:521)
      at org.jvnet.hudson.plugins.VaultSCM.compareRemoteRevisionWith(VaultSCM.java:293)
      at hudson.scm.SCM.poll(SCM.java:397)
      at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1462)
      at hudson.model.AbstractProject._poll(AbstractProject.java:1433)
      at hudson.model.AbstractProject.poll(AbstractProject.java:1344)
      at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:515)
      at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:544)
      at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

          [JENKINS-26487] NPE during SCM polling

          Ken Overly added a comment -

          I have additional info to report. I was able to get the VaultSCM plugin running in a debugger to track down exactly where the NPE occurs.

          It occurs at line 357 in method getVaultPath() in file VaultSCM.java. The Computer object is NULL and I'm trying to identify why.

          VaultSCM.java
              private String getVaultPath(Launcher launcher, TaskListener listener) throws InterruptedException, IOException {
          
                  final String defaultPath = "C:\\Program Files\\SourceGear\\Vault Client\\vault.exe";
                  final String defaultPathX86 = "C:\\Program Files (x86)\\SourceGear\\Vault Client\\vault.exe";
          
                  VaultSCMInstallation installation = getVault();
                  String pathToVault;
          
                  if (installation == null) {
                      // Check the first default location for vault...
                      if (checkVaultPath(defaultPath, launcher, listener)) {
                          pathToVault = defaultPath;
                      } else if (checkVaultPath(defaultPathX86, launcher, listener)) {
                          pathToVault = defaultPathX86;
                      } else {
                          listener.fatalError("Failed find vault client");
                          return null;
                      }
                  } else {
          NPE-->      installation = installation.forNode(Computer.currentComputer().getNode(), listener);
                      pathToVault = installation.getVaultLocation();
                      if (!checkVaultPath(pathToVault, launcher, listener)) {
                          listener.fatalError(pathToVault + " doesn't exist");
                          return null;
                      }
                  }
                  return pathToVault;
              }
          

          Ken Overly added a comment - I have additional info to report. I was able to get the VaultSCM plugin running in a debugger to track down exactly where the NPE occurs. It occurs at line 357 in method getVaultPath() in file VaultSCM.java. The Computer object is NULL and I'm trying to identify why. VaultSCM.java private String getVaultPath(Launcher launcher, TaskListener listener) throws InterruptedException, IOException { final String defaultPath = "C:\\Program Files\\SourceGear\\Vault Client\\vault.exe" ; final String defaultPathX86 = "C:\\Program Files (x86)\\SourceGear\\Vault Client\\vault.exe" ; VaultSCMInstallation installation = getVault(); String pathToVault; if (installation == null ) { // Check the first default location for vault... if (checkVaultPath(defaultPath, launcher, listener)) { pathToVault = defaultPath; } else if (checkVaultPath(defaultPathX86, launcher, listener)) { pathToVault = defaultPathX86; } else { listener.fatalError( "Failed find vault client" ); return null ; } } else { NPE--> installation = installation.forNode(Computer.currentComputer().getNode(), listener); pathToVault = installation.getVaultLocation(); if (!checkVaultPath(pathToVault, launcher, listener)) { listener.fatalError(pathToVault + " doesn't exist" ); return null ; } } return pathToVault; }

          Ken Overly added a comment -

          I've managed to get SCM polling to work by commenting out line 357 (noted in the previous comment with 'NPE--->').

          I'm not sure what the intent was of using forNode(). My first thought was that it allows for the case where a job is running on a slave node. After further consideration I don't think that is accurate as my understanding is that only a master node performs SCM polling.

          Any comments?

          Ken Overly added a comment - I've managed to get SCM polling to work by commenting out line 357 (noted in the previous comment with 'NPE--->'). I'm not sure what the intent was of using forNode(). My first thought was that it allows for the case where a job is running on a slave node. After further consideration I don't think that is accurate as my understanding is that only a master node performs SCM polling. Any comments?

          is this issue got resolved?? I am facing the same issue.

           

          Started on Dec 18, 2017 12:12:57 AM Polling SCM changes on master ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@1762e86[vault-ci-test] java.lang.NullPointerException at org.jvnet.hudson.plugins.VaultSCM.getVaultPath(VaultSCM.java:334) at org.jvnet.hudson.plugins.VaultSCM.determineChangeCount(VaultSCM.java:521) at org.jvnet.hudson.plugins.VaultSCM.compareRemoteRevisionWith(VaultSCM.java:293) at hudson.scm.SCM.poll(SCM.java:408) at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1416) at hudson.model.AbstractProject._poll(AbstractProject.java:1386) at hudson.model.AbstractProject.poll(AbstractProject.java:1297) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:594) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:640) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

           

          Regards,

          Raja

          rajasekaran radhakrishnan added a comment - is this issue got resolved?? I am facing the same issue.   Started on Dec 18, 2017 12:12:57 AM Polling SCM changes on master ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@1762e86 [vault-ci-test] java.lang.NullPointerException at org.jvnet.hudson.plugins.VaultSCM.getVaultPath(VaultSCM.java:334) at org.jvnet.hudson.plugins.VaultSCM.determineChangeCount(VaultSCM.java:521) at org.jvnet.hudson.plugins.VaultSCM.compareRemoteRevisionWith(VaultSCM.java:293) at hudson.scm.SCM.poll(SCM.java:408) at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1416) at hudson.model.AbstractProject._poll(AbstractProject.java:1386) at hudson.model.AbstractProject.poll(AbstractProject.java:1297) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:594) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:640) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)   Regards, Raja

            Unassigned Unassigned
            keno Ken Overly
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: