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

EnvInject overriding WORKSPACE variable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: envinject-plugin
    • Labels:
      None
    • Similar Issues:
      Show 5 results

      Description

      I upgraded Jenkins to 1.458 and envinject from 1.36 to 1.44. After the upgrade all my jobs that did not use envinject were getting their WORKSPACE variable set to another jobs that did use envinject WORKSPACE. Downgraded envinject to 1.36 and the problem went away.

      Here's an edited log that shows initially the workspace is correct, even after EnvInject line, but when the shell script runs, it is wrong.

      Also, I don't know why EnvInject is even being run for this job since it is not enabled anywhere...

      [EnvInject] - Preparing an environment for the build.
      Building on master in workspace -correct-workspace-
      Updating http://svn....
      At revision 36652
      no change for http://svn.... since the previous build
      No emails were triggered.
      [bronze-bin] $ /bin/sh -xe /tmp/hudson6983282044770433158.sh
      + echo -some-other-jobs-workspace-

        Activity

        Hide
        david_rubio David Rubio added a comment - - edited

        Similar problem detected with EnvInject 1.91.1 and Jenkins 1.609. Version 1.90 does not have the problem

        For some reason the Path env variable is not updated but java.library.path is. When you try to build, it looks in the old path

        Show
        david_rubio David Rubio added a comment - - edited Similar problem detected with EnvInject 1.91.1 and Jenkins 1.609. Version 1.90 does not have the problem For some reason the Path env variable is not updated but java.library.path is. When you try to build, it looks in the old path
        Hide
        deepchip Martin d'Anjou added a comment -

        Do you still see the problem with the 1.92.1 released on Aug 21 2015?

        Show
        deepchip Martin d'Anjou added a comment - Do you still see the problem with the 1.92.1 released on Aug 21 2015?
        Hide
        lautou Laurent TOURREAU added a comment - - edited

        I have installed 1.92.1 the problem is present.
        I have downgraded until 1.38 which is the latest version that doesn't have this defect.

        Here a log extract:

        Building remotely on quality in workspace /apps/homes/jenkins/node_quality/workspace/sonar_build
        [sonar_build] $ /bin/sh -xe /tmp/hudson4867033689412661438.sh
        + echo now Launching the build workspace...
        now Launching the build workspace...
        + /apps/tools/misc-tools/build_test.sh
        WORKSPACE=/apps/tools/homes/jenkins/node_quality
        

        As you can see WORKSPACE variable is not set correctly

        Show
        lautou Laurent TOURREAU added a comment - - edited I have installed 1.92.1 the problem is present. I have downgraded until 1.38 which is the latest version that doesn't have this defect. Here a log extract: Building remotely on quality in workspace /apps/homes/jenkins/node_quality/workspace/sonar_build [sonar_build] $ /bin/sh -xe /tmp/hudson4867033689412661438.sh + echo now Launching the build workspace... now Launching the build workspace... + /apps/tools/misc-tools/build_test.sh WORKSPACE=/apps/tools/homes/jenkins/node_quality As you can see WORKSPACE variable is not set correctly
        Hide
        ajbarber Andrew Barber added a comment -

        I see this issue as well. EnvInject 1.92.1, jenkins 1.642.1. I originally posted this bug
        https://issues.jenkins-ci.org/browse/JENKINS-19754

        The work around to get WORKSPACE set correctly is to
        ○ Select "Prepare jobs environment" on the slave
        ○ Select "Unset System Environment Variables" on the slave

        After recent upgrades on jenkins and plugins I now see intermittent env inject of WORKSPACE to the slave root. I think the "unset system environment variables" is being ignored intermittently. Passing builds have a small set of environment variables set which appear to be only jenkins related. Failing builds have many more environment variables, especially system ones like HOST and LSF environment variables. The passing cases do not have WORKSPACE set.
        This is causing a lot of grief for our work. I hope someone can look into it.

        Show
        ajbarber Andrew Barber added a comment - I see this issue as well. EnvInject 1.92.1, jenkins 1.642.1. I originally posted this bug https://issues.jenkins-ci.org/browse/JENKINS-19754 The work around to get WORKSPACE set correctly is to ○ Select "Prepare jobs environment" on the slave ○ Select "Unset System Environment Variables" on the slave After recent upgrades on jenkins and plugins I now see intermittent env inject of WORKSPACE to the slave root. I think the "unset system environment variables" is being ignored intermittently. Passing builds have a small set of environment variables set which appear to be only jenkins related. Failing builds have many more environment variables, especially system ones like HOST and LSF environment variables. The passing cases do not have WORKSPACE set. This is causing a lot of grief for our work. I hope someone can look into it.
        Hide
        ajbarber Andrew Barber added a comment -

        I should also note that the job affected by this does not have "Prepare an environment for the run" selected. EnvInject is still lurking though as this message is always present in stdout:
        [EnvInject] - Loading node environment variables.

        Show
        ajbarber Andrew Barber added a comment - I should also note that the job affected by this does not have "Prepare an environment for the run" selected. EnvInject is still lurking though as this message is always present in stdout: [EnvInject] - Loading node environment variables.

          People

          • Assignee:
            gbois Gregory Boissinot
            Reporter:
            jimsearle Jim Searle
          • Votes:
            7 Vote for this issue
            Watchers:
            19 Start watching this issue

            Dates

            • Created:
              Updated: