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

Incorrect inserting environment variables on linux slave

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: envinject-plugin
    • Labels:
      None
    • Environment:
      master-windows, slave-linux
    • Similar Issues:

      Description

      I have problem with new plugin 1.5/1.6 (1.2 works well) on slave (linux) node. I've tried this plugin using "Inject environment variables to the build process" in "build environments". I used cmakebuilder plugin (not significant). Although a building process fail with cmake errors It is probably error in EnvInject plugin 1.5 version because the building process in 1.2 is ok. Bookmarks "Injected Environment Variable" in 1.2 contains environment variables from linux (slave), but 1.5/1.6 contains environment variable from windows (master). Thanks!

        Attachments

          Activity

          ferda juraj fedorko created issue -
          Hide
          mwebber Matthew Webber added a comment -

          I have what apears to be the same problem. The slave looks like it has inherited $PATH from the master - not great when the master is a 32 bit machine whose $PATH points to 32 bit versions of various software, and the slave is a 64 bit machine.

          Show
          mwebber Matthew Webber added a comment - I have what apears to be the same problem. The slave looks like it has inherited $PATH from the master - not great when the master is a 32 bit machine whose $PATH points to 32 bit versions of various software, and the slave is a 64 bit machine.
          Hide
          mwebber Matthew Webber added a comment -

          I can confirm that I needed to downgrade the plugin to 1.2 in order to resolve this problem.

          Show
          mwebber Matthew Webber added a comment - I can confirm that I needed to downgrade the plugin to 1.2 in order to resolve this problem.
          Hide
          gbois Gregory Boissinot added a comment -

          Could you attach your job configuration file (config.xml)?
          Thanks

          Show
          gbois Gregory Boissinot added a comment - Could you attach your job configuration file (config.xml)? Thanks
          gbois Gregory Boissinot made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          mwebber Matthew Webber added a comment -

          I have attached the config file for a job that works under 1.2. This job runs on a slave. In 1.2, the job did not inherit $PATH from the master, but in 1.5 it did.

          Show
          mwebber Matthew Webber added a comment - I have attached the config file for a job that works under 1.2. This job runs on a slave. In 1.2, the job did not inherit $PATH from the master, but in 1.5 it did.
          mwebber Matthew Webber made changes -
          Attachment config.xml [ 21376 ]
          Hide
          pezzu Peter Sukhenko added a comment - - edited

          Looks like problem introduced in 1.4 in EnvInjectComputerListener.java, line 74.
          Following code:

          Map<String, String> nodeEnvVars = Hudson.getInstance().getRootPath().act(
          new Callable<Map<String, String>, IOException>() {
          public Map<String, String> call() throws IOException

          { return EnvVars.masterEnvVars; }

          }
          );

          always get variables from master while should take from slave.
          Replacing it with

          Map<String, String> nodeEnvVars = c.getNode().getRootPath().act( ...

          resolved the issue

          Show
          pezzu Peter Sukhenko added a comment - - edited Looks like problem introduced in 1.4 in EnvInjectComputerListener.java, line 74. Following code: Map<String, String> nodeEnvVars = Hudson.getInstance().getRootPath().act( new Callable<Map<String, String>, IOException>() { public Map<String, String> call() throws IOException { return EnvVars.masterEnvVars; } } ); always get variables from master while should take from slave. Replacing it with Map<String, String> nodeEnvVars = c.getNode().getRootPath().act( ... resolved the issue
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectComputerListener.java
          http://jenkins-ci.org/commit/envinject-plugin/948cf472a104f89f8ecccabcf71c40f585a01eed
          Log:
          Fix JENKINS-12293

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectComputerListener.java http://jenkins-ci.org/commit/envinject-plugin/948cf472a104f89f8ecccabcf71c40f585a01eed Log: Fix JENKINS-12293
          Hide
          gbois Gregory Boissinot added a comment -

          Thank you very much for all your inputs.
          Could you try the version 1.7. The problem should be fixed.

          Show
          gbois Gregory Boissinot added a comment - Thank you very much for all your inputs. Could you try the version 1.7. The problem should be fixed.
          Hide
          pezzu Peter Sukhenko added a comment -

          1.7 works fine for me.
          Thanks

          Show
          pezzu Peter Sukhenko added a comment - 1.7 works fine for me. Thanks
          Hide
          mwebber Matthew Webber added a comment -

          Also working ok for me (Linux master 32-bit, Linux slave 64-bit). Thanks.

          Show
          mwebber Matthew Webber added a comment - Also working ok for me (Linux master 32-bit, Linux slave 64-bit). Thanks.
          Hide
          ferda juraj fedorko added a comment -

          Yes, it works correctly. Thanks.

          Show
          ferda juraj fedorko added a comment - Yes, it works correctly. Thanks.
          gbois Gregory Boissinot made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 142615 ] JNJira + In-Review [ 190199 ]

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              ferda juraj fedorko
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: