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

Clearcase polling fails if view name uses ${NODE_NAME}

    XMLWordPrintable

Details

    Description

      We just installed clearcase 1.1 plugin and the polling fails as it is not resolving the ${NODE_NAME} variable when executing the lshistory command. It works when you manually kick off a build though.

      From the logs:

      INFO | jvm 1 | 2010/01/08 08:30:55 | Jan 8, 2010 8:30:55 AM hudson.plugins.clearcase.ClearCaseSCM createHistoryAction
      INFO | jvm 1 | 2010/01/08 08:30:55 | WARNING: Exception when running 'cleartool pwv'
      INFO | jvm 1 | 2010/01/08 08:30:55 | java.io.IOException: Cannot run program "cleartool" (in directory "/opt/devlocal/hudson/workspace/eit-insight-desktop-2.5-ci/hudson_${NODE_NAME}_eit-insight-desktop-2.5-ci"): java.io.IOException: error=2, No such file or directory
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.Proc$LocalProc.<init>(Proc.java:145)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.Proc$LocalProc.<init>(Proc.java:118)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.Launcher$LocalLauncher.launch(Launcher.java:633)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.Launcher$ProcStarter.start(Launcher.java:268)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:775)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:753)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.remoting.UserRequest.perform(UserRequest.java:104)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at hudson.remoting.Request$2.run(Request.java:244)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.lang.Thread.run(Thread.java:619)
      INFO | jvm 1 | 2010/01/08 08:30:55 | Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.lang.ProcessImpl.start(ProcessImpl.java:65)
      INFO | jvm 1 | 2010/01/08 08:30:55 | at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
      INFO | jvm 1 | 2010/01/08 08:30:55 | ... 15 more
      INFO | jvm 1 | 2010/01/08 08:30:55 | Jan 8, 2010 8:30:55 AM hudson.plugins.clearcase.util.BuildVariableResolver resolve
      INFO | jvm 1 | 2010/01/08 08:30:55 | WARNING: Variable name 'NODE_NAME' look up failed because of java.lang.NullPointerException

      Attachments

        Activity

          abayer Andrew Bayer added a comment -

          Hmm. This is a weird one - I'm not sure what exactly changed such that NODE_NAME isn't available at polling time. I'll see what I can figure out.

          abayer Andrew Bayer added a comment - Hmm. This is a weird one - I'm not sure what exactly changed such that NODE_NAME isn't available at polling time. I'll see what I can figure out.
          abayer Andrew Bayer added a comment -

          Ah, found the problem. We switched to using Computer.currentComputer() rather than launcher.getComputer() - but Computer.currentComputer() only works during a build. I'll come up with an alternative.

          abayer Andrew Bayer added a comment - Ah, found the problem. We switched to using Computer.currentComputer() rather than launcher.getComputer() - but Computer.currentComputer() only works during a build. I'll come up with an alternative.
          abayer Andrew Bayer added a comment -

          Further investigation (thanks, mindless!) showed this to only occur when the Hudson master has zero executors - otherwise, it would work, though it would still result in a bad value in NODE_NAME if the polling wasn't actually running on the master. I'm now working off the assumption that if you've got NODE_NAME in your view name, you either are tearing down/recreating the view every build, or you've got the build locked to run on only one node - in that case, I can safely use the node name of the node the previous build ran on in polling.

          abayer Andrew Bayer added a comment - Further investigation (thanks, mindless!) showed this to only occur when the Hudson master has zero executors - otherwise, it would work, though it would still result in a bad value in NODE_NAME if the polling wasn't actually running on the master. I'm now working off the assumption that if you've got NODE_NAME in your view name, you either are tearing down/recreating the view every build, or you've got the build locked to run on only one node - in that case, I can safely use the node name of the node the previous build ran on in polling.
          petehayes Peter Hayes added a comment -

          We do have the Hudson master set to zero executors. We also lock the builds to specific nodes, though using the node label, builds could run on multiple nodes.

          petehayes Peter Hayes added a comment - We do have the Hudson master set to zero executors. We also lock the builds to specific nodes, though using the node label, builds could run on multiple nodes.

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java
          trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/util/BuildVariableResolver.java
          trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/AbstractClearCaseScmTest.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=25542
          Log:
          [FIXED JENKINS-5214] NODE_NAME (and other variable replacements depending on Computer) now work properly in polling.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/util/BuildVariableResolver.java trunk/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/AbstractClearCaseScmTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=25542 Log: [FIXED JENKINS-5214] NODE_NAME (and other variable replacements depending on Computer) now work properly in polling.

          People

            abayer Andrew Bayer
            petehayes Peter Hayes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: