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

[EnvInject] Injecting properties of previous build breaks SCM polling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • envinject-plugin
    • None

      The EnvInject plugin re-injects the environment of the previous build into the SCM poll for the next build.

      However, it does this blindly, without considering when and where the previous build happened, and without knowing if the properties are actually applicable.

      Scenario:

      1. Have 2 slaves (slave-linux, slave-windows)
      2. Configure job for SCM polling
      3. Build job for the first time -> runs on slave-linux
      4. builds/1/injectedEnvVars.txt contains, for example, HOME=/home/jenkins
      5. Wait for next SCM poll.
      6. SCM poll runs on slave-windows this time.
      7. EnvInject blindly takes the env vars from injectedEnvVars.txt from build 1 and injects it into the SCM polling process.
      8. SCM polling on Windows fails, e.g. with "Could not create directory '/home/jenkins/.ssh'." because of the wrong HOME environment variable.

      Is there a way to prevent this? The job in question does not even make use of the EnvInject functionality, yet, injecting still happens at SCM polling time.

            Unassigned Unassigned
            sratz Sebastian Ratz
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: