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

java.lang.ArrayIndexOutOfBoundsException after AccuRev Plugin upgrade

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • accurev-plugin
    • None
    • Jenkins 2.41
      AccuRev Plugin which works is 0.7.6
      AccuRev Plugin which fails is 0.7.8
      Windows 8.1 Enterprise (64-bit)
      Accurev 6.2.3

    Description

      This Jenkins server is running on my laptop (not in Tomcat). It is configured with master and one local slave agent (on my laptop). After upgrading the AccuRev Plugin from version 0.7.6 to 0.7.8, a build failed with a java.lang.ArrayIndexOutOfBoundsException when it ran in the slave. It is successful if it runs in master.

      Build Console Output:

      12:37:36 Started by user anonymous
      12:37:36 [EnvInject] - Loading node environment variables.
      12:37:36 Building remotely on W1559922 in workspace C:/JenkinsSlave/workspace/AccuRev hdx-xall-dev Monitor
      12:37:36 [WS-CLEANUP] Deleting project workspace...
      12:37:36 [WS-CLEANUP] Done
      12:37:36 Authenticating with Accurev server...
      12:37:36 FATAL: 0
      12:37:36 java.lang.ArrayIndexOutOfBoundsException: 0
      12:37:36 	at java.lang.ProcessBuilder.start(Unknown Source)
      12:37:36 	at hudson.Proc$LocalProc.<init>(Proc.java:245)
      12:37:36 	at hudson.Proc$LocalProc.<init>(Proc.java:214)
      12:37:36 	at hudson.Launcher$LocalLauncher.launch(Launcher.java:846)
      12:37:36 	at hudson.Launcher$ProcStarter.start(Launcher.java:384)
      12:37:36 	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1195)
      12:37:36 	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1160)
      12:37:36 	at hudson.remoting.UserRequest.perform(UserRequest.java:152)
      12:37:36 	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      12:37:36 	at hudson.remoting.Request$2.run(Request.java:332)
      12:37:36 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      12:37:36 	at java.util.concurrent.FutureTask.run(Unknown Source)
      12:37:36 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      12:37:36 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      12:37:36 	at hudson.remoting.Engine$1$1.run(Engine.java:85)
      12:37:36 	at java.lang.Thread.run(Unknown Source)
      12:37:36 	at ......remote call to Channel to /10.150.141.150(Native Method)
      12:37:36 	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1537)
      12:37:36 	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      12:37:36 	at hudson.remoting.Channel.call(Channel.java:822)
      12:37:36 	at hudson.Launcher$RemoteLauncher.launch(Launcher.java:959)
      12:37:36 	at hudson.Launcher$ProcStarter.start(Launcher.java:384)
      12:37:36 	at hudson.Launcher$ProcStarter.join(Launcher.java:395)
      12:37:36 	at hudson.plugins.accurev.AccurevLauncher.justAccurev(AccurevLauncher.java:456)
      12:37:36 	at hudson.plugins.accurev.AccurevLauncher.findAccurevExe(AccurevLauncher.java:439)
      12:37:36 	at hudson.plugins.accurev.AccurevLauncher.createProcess(AccurevLauncher.java:266)
      12:37:36 	at hudson.plugins.accurev.AccurevLauncher.runCommand(AccurevLauncher.java:218)
      12:37:36 	at hudson.plugins.accurev.AccurevLauncher.runCommand(AccurevLauncher.java:103)
      12:37:36 	at hudson.plugins.accurev.cmd.Login.accurevLogin(Login.java:101)
      12:37:36 	at hudson.plugins.accurev.cmd.Login.ensureLoggedInToAccurev(Login.java:70)
      12:37:36 	at hudson.plugins.accurev.delegates.AbstractModeDelegate.setup(AbstractModeDelegate.java:63)
      12:37:36 	at hudson.plugins.accurev.delegates.AbstractModeDelegate.checkout(AbstractModeDelegate.java:102)
      12:37:36 	at hudson.plugins.accurev.AccurevSCM.checkout(AccurevSCM.java:387)
      12:37:36 	at hudson.scm.SCM.checkout(SCM.java:495)
      12:37:36 	at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
      12:37:36 	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
      12:37:36 	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      12:37:36 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
      12:37:36 	at hudson.model.Run.execute(Run.java:1729)
      12:37:36 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      12:37:36 	at hudson.model.ResourceController.execute(ResourceController.java:98)
      12:37:36 	at hudson.model.Executor.run(Executor.java:404)
      12:37:36 Notifying upstream projects of job completion
      12:37:36 Email was triggered for: Always
      12:37:36 Sending email for trigger: Always
      12:37:36 Sending email to: xxxxxxxxxxxxxxxx
      12:37:36 Finished: FAILURE
      

      Attachments

        Activity

          casz Joseph Petersen (old) added a comment - - edited

          If it's the same laptop, there is no reason to connect the laptop as a slave, you can just increase the amount of executors on the master
          edit:
          heres how
          goto: http://localhost:8080/computer/(master)/configure and edit the amount of executors.

          casz Joseph Petersen (old) added a comment - - edited If it's the same laptop, there is no reason to connect the laptop as a slave, you can just increase the amount of executors on the master edit: heres how goto: http://localhost:8080/computer/(master)/configure and edit the amount of executors.
          bercma00 Mark Berchem added a comment -

          This is my test version of Jenkins. All changes are made on my laptop before upgrading our Jenkins CI Server. I am able to catch issues locally before causing our developer builds to fail. Having a slave locally is only to test the ability to connect and run in slaves. This problem might occur trying to connect to a remote slave as well.

          bercma00 Mark Berchem added a comment - This is my test version of Jenkins. All changes are made on my laptop before upgrading our Jenkins CI Server. I am able to catch issues locally before causing our developer builds to fail. Having a slave locally is only to test the ability to connect and run in slaves. This problem might occur trying to connect to a remote slave as well.

          Have you checked the server configuration?
          Also the exception never throw a caused by, which to me signals that I haven't gotten the full log.
          Can you try adding a logger for
          "hudson.plugins.accurev" and set it for all? You can add it under System log.

          casz Joseph Petersen (old) added a comment - Have you checked the server configuration? Also the exception never throw a caused by, which to me signals that I haven't gotten the full log. Can you try adding a logger for "hudson.plugins.accurev" and set it for all? You can add it under System log.

          I cannot test it myself atm our Accurev server is shutdown for backup

          casz Joseph Petersen (old) added a comment - I cannot test it myself atm our Accurev server is shutdown for backup
          casz Joseph Petersen (old) added a comment - - edited

          12:37:36 at hudson.plugins.accurev.AccurevLauncher.findAccurevExe(AccurevLauncher.java:439)

          Seems like you ended up in the isUnix in the findAccurevExe. But being on Windows that seems ODD
          on line 439... I will have figure out why I wouldn't have the slighest idea, why

          casz Joseph Petersen (old) added a comment - - edited 12:37:36 at hudson.plugins.accurev.AccurevLauncher.findAccurevExe( AccurevLauncher.java:439 ) Seems like you ended up in the isUnix in the findAccurevExe. But being on Windows that seems ODD on line 439... I will have figure out why I wouldn't have the slighest idea, why
          casz Joseph Petersen (old) added a comment - - edited

          Thanks found the issue.
          Sending an empty String to ProcessStarter is bad

          Should look something like this now

          FATAL: rocky: login (accurev login -H localhost:5050 test ******) failed with java.io.IOException: Cannot run program "accurev" (in directory "C:\Users\joseph\Documents\GitHub\casz\accurev-plugin\work\workspace\accurev-plugin"): CreateProcess error=2, The system cannot find the file specified
          java.io.IOException: Cannot run program "accurev" (in directory "C:\Users\joseph\Documents\GitHub\casz\accurev-plugin\work\workspace\accurev-plugin"): CreateProcess error=2, The system cannot find the file specified
          	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
          	at hudson.Proc$LocalProc.<init>(Proc.java:245)
          	at hudson.Proc$LocalProc.<init>(Proc.java:214)
          	at hudson.Launcher$LocalLauncher.launch(Launcher.java:846)
          	at hudson.Launcher$ProcStarter.start(Launcher.java:384)
          	at hudson.Launcher$ProcStarter.join(Launcher.java:395)
          	at hudson.plugins.accurev.AccurevLauncher.runCommandToCompletion(AccurevLauncher.java:247)
          	at hudson.plugins.accurev.AccurevLauncher.runCommand(AccurevLauncher.java:220)
          	at hudson.plugins.accurev.AccurevLauncher.runCommand(AccurevLauncher.java:100)
          	at hudson.plugins.accurev.cmd.Login.accurevLogin(Login.java:101)
          	at hudson.plugins.accurev.cmd.Login.ensureLoggedInToAccurev(Login.java:70)
          	at hudson.plugins.accurev.delegates.AbstractModeDelegate.setup(AbstractModeDelegate.java:63)
          	at hudson.plugins.accurev.delegates.AbstractModeDelegate.checkout(AbstractModeDelegate.java:102)
          	at hudson.plugins.accurev.AccurevSCM.checkout(AccurevSCM.java:387)
          	at hudson.scm.SCM.checkout(SCM.java:495)
          	at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
          	at hudson.model.Run.execute(Run.java:1728)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          	at hudson.model.ResourceController.execute(ResourceController.java:98)
          	at hudson.model.Executor.run(Executor.java:404)
          Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
          	at java.lang.ProcessImpl.create(Native Method)
          	at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
          	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
          	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
          	... 22 more
          
          casz Joseph Petersen (old) added a comment - - edited Thanks found the issue. Sending an empty String to ProcessStarter is bad Should look something like this now FATAL: rocky: login (accurev login -H localhost:5050 test ******) failed with java.io.IOException: Cannot run program "accurev" (in directory "C:\Users\joseph\Documents\GitHub\casz\accurev-plugin\work\workspace\accurev-plugin" ): CreateProcess error=2, The system cannot find the file specified java.io.IOException: Cannot run program "accurev" (in directory "C:\Users\joseph\Documents\GitHub\casz\accurev-plugin\work\workspace\accurev-plugin" ): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at hudson.Proc$LocalProc.<init>(Proc.java:245) at hudson.Proc$LocalProc.<init>(Proc.java:214) at hudson.Launcher$LocalLauncher.launch(Launcher.java:846) at hudson.Launcher$ProcStarter.start(Launcher.java:384) at hudson.Launcher$ProcStarter.join(Launcher.java:395) at hudson.plugins.accurev.AccurevLauncher.runCommandToCompletion(AccurevLauncher.java:247) at hudson.plugins.accurev.AccurevLauncher.runCommand(AccurevLauncher.java:220) at hudson.plugins.accurev.AccurevLauncher.runCommand(AccurevLauncher.java:100) at hudson.plugins.accurev.cmd.Login.accurevLogin(Login.java:101) at hudson.plugins.accurev.cmd.Login.ensureLoggedInToAccurev(Login.java:70) at hudson.plugins.accurev.delegates.AbstractModeDelegate.setup(AbstractModeDelegate.java:63) at hudson.plugins.accurev.delegates.AbstractModeDelegate.checkout(AbstractModeDelegate.java:102) at hudson.plugins.accurev.AccurevSCM.checkout(AccurevSCM.java:387) at hudson.scm.SCM.checkout(SCM.java:495) at hudson.model.AbstractProject.checkout(AbstractProject.java:1278) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1728) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:386) at java.lang.ProcessImpl.start(ProcessImpl.java:137) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 22 more
          casz Joseph Petersen (old) added a comment - - edited

          You end up in isUnix because C:/JenkinsSlave hits the

          return !remote.contains("\\");
          

          User input I believe when setting the node's Remote root directory.
          Should be able to fix it by using the Launcher instead of FilePath to check if it's Unix or not.

          Edit:
          No reason to make such a lengthy environment details

          casz Joseph Petersen (old) added a comment - - edited You end up in isUnix because C:/JenkinsSlave hits the return !remote.contains( "\\" ); User input I believe when setting the node's Remote root directory. Should be able to fix it by using the Launcher instead of FilePath to check if it's Unix or not. Edit: No reason to make such a lengthy environment details

          Code changed in jenkins
          User: Joseph
          Path:
          src/main/java/hudson/plugins/accurev/AccurevLauncher.java
          src/main/java/hudson/plugins/accurev/cmd/Login.java
          http://jenkins-ci.org/commit/accurev-plugin/a89fc085eccce375eb0c343a5b7f16060bf752f4
          Log:
          JENKINS-41266 Fix ArrayIndexOutOfBoundsException (#41)

          • Avoid sending empty string to process starter
          • Add CheckForNull
          • Use Launcher to check isUnix
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Joseph Path: src/main/java/hudson/plugins/accurev/AccurevLauncher.java src/main/java/hudson/plugins/accurev/cmd/Login.java http://jenkins-ci.org/commit/accurev-plugin/a89fc085eccce375eb0c343a5b7f16060bf752f4 Log: JENKINS-41266 Fix ArrayIndexOutOfBoundsException (#41) Avoid sending empty string to process starter Add CheckForNull Use Launcher to check isUnix
          bercma00 Mark Berchem added a comment -

          I upgraded to the 0.7.9 version of the AccuRev Plugin and it seems to be OK.

          bercma00 Mark Berchem added a comment - I upgraded to the 0.7.9 version of the AccuRev Plugin and it seems to be OK.

          People

            jetersen Joseph Petersen
            bercma00 Mark Berchem
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: