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

Node executable is not begin initialised on slave node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: nodejs-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.30
      nodejs plugin from branch workaround-26583
      env-inject plugin 1.93.1
      CentOS 6.8
    • Similar Issues:

      Description

      I followed the workaround recommendation in JENKINS-41848 since I have env-inject plugin (and rely heaviliy on it) and "Provide npm to $PATH" did not work.

      With the workaround-26583 branch, $PATH issue has been addressed, but now the node build steps don't work. I have no global npm modules configured in tool config (and no spaces in the field either).

      If I add an invalid value to global npm modules (ie comma-delimited: phantomjs,pnpm,gulp), I get an error running npm. Otherwise, I get the stacktrace below (even when I have valid global npm modules specified)

      FATAL: command execution failed
      jenkins.plugins.nodejs.tools.DetectionFailedException: Cannot get installation for node, since it is not online
      at jenkins.plugins.nodejs.tools.NodeJSInstallation.getPlatform(NodeJSInstallation.java:178)
      at jenkins.plugins.nodejs.tools.NodeJSInstallation.access$000(NodeJSInstallation.java:64)
      at jenkins.plugins.nodejs.tools.NodeJSInstallation$1.call(NodeJSInstallation.java:128)
      at jenkins.plugins.nodejs.tools.NodeJSInstallation$1.call(NodeJSInstallation.java:123)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:324)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at hudson.remoting.Engine$1$1.run(Engine.java:63)
      at java.lang.Thread.run(Thread.java:745)
      at ......remote call to Channel to /10.130.221.2(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1435)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      at hudson.remoting.Channel.call(Channel.java:795)
      at jenkins.plugins.nodejs.tools.NodeJSInstallation.getExecutable(NodeJSInstallation.java:123)
      at jenkins.plugins.nodejs.NodeJSCommandInterpreter.perform(NodeJSCommandInterpreter.java:106)
      at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:65)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      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)
      ERROR: Build step failed with exception
      java.lang.IllegalStateException: Node executable not initialised
      at jenkins.plugins.nodejs.NodeJSCommandInterpreter.buildCommandLine(NodeJSCommandInterpreter.java:144)
      at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:108)
      at jenkins.plugins.nodejs.NodeJSCommandInterpreter.internalPerform(NodeJSCommandInterpreter.java:138)
      at jenkins.plugins.nodejs.NodeJSCommandInterpreter.perform(NodeJSCommandInterpreter.java:134)
      at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:65)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      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)
      Build step 'Execute NodeJS script' marked build as failure

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          src/test/java/jenkins/plugins/nodejs/tools/NodeJSInstallationTest.java
          http://jenkins-ci.org/commit/nodejs-plugin/dc4e2946d34cd2a0a773aaf80688c8df42d7e4bf
          Log:
          [FIX JENKINS-42232] Fix node executable not initialised on slave node where Computer.currentComputer was null.
          In case current computer is null platform is calculated on the current system properties, that it is also the case of MasterToSlave callable.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java src/test/java/jenkins/plugins/nodejs/tools/NodeJSInstallationTest.java http://jenkins-ci.org/commit/nodejs-plugin/dc4e2946d34cd2a0a773aaf80688c8df42d7e4bf Log: [FIX JENKINS-42232] Fix node executable not initialised on slave node where Computer.currentComputer was null. In case current computer is null platform is calculated on the current system properties, that it is also the case of MasterToSlave callable.
          Hide
          nfalco Nikolas Falco added a comment -

          ASAP I will release the 1.1.2 and I will update the workaround branch accordingly

          Show
          nfalco Nikolas Falco added a comment - ASAP I will release the 1.1.2 and I will update the workaround branch accordingly
          Hide
          akom Alexander Komarov added a comment -

          Confirmed that branch now works as of f405e0b1a955a4e38495691c1a8236b3b48b5881

          Show
          akom Alexander Komarov added a comment - Confirmed that branch now works as of f405e0b1a955a4e38495691c1a8236b3b48b5881
          Hide
          nfalco Nikolas Falco added a comment -

          Thank for the conferm

          Show
          nfalco Nikolas Falco added a comment - Thank for the conferm

            People

            • Assignee:
              nfalco Nikolas Falco
              Reporter:
              akom Alexander Komarov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: