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

EnvInject failure using multi-configuration jobs

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • envinject-plugin
    • None
    • Debian 5.0

    Description

      We recently upgraded to 1.424.1 LTS, and switched to the EnvInject plugin instead of the deprecated "Hudson SetEnv" plugin to set environment variables for our jobs.

      All our multi-configuration jobs are now failing:

      [EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build step: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem

      This is easy to reproduce:

      • Install EnvInject
      • Create a new multiconfiguration job
      • Add an axis named "axis" with the values "a b c"
      • Add an execute shell build step consisting of "echo $axis"
      • Save and run the job (it should execute successfully against three configurations)
      • Now, edit the job and check "Inject environment variables to the build process" in the Build Environment section. You don't actually need to add any properties content to reproduce the problem--just check the checkbox.
      • Run the job again. All three configurations fail.

      This is a big problem for us as all our multi-configuration jobs also use environment variables.

      Attachments

        Activity

          EnvInject 1.1 fixes the bug.
          Thanks

          gbois Gregory Boissinot added a comment - EnvInject 1.1 fixes the bug. Thanks
          javierb JavierB added a comment - - edited

          This issue has happened to me again today when I've upgraded to version 1.26 of the EnvInject plugin

          From console output:

          [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
          [EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem

          I've rolled back to previous version 1.25 and things are working fine again.

          Current Jenkins version: Jenkins ver. 1.451 [under Ubuntu]

          javierb JavierB added a comment - - edited This issue has happened to me again today when I've upgraded to version 1.26 of the EnvInject plugin From console output: [EnvInject] - Executing scripts and injecting environment variables after the SCM step. [EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem I've rolled back to previous version 1.25 and things are working fine again. Current Jenkins version: Jenkins ver. 1.451 [under Ubuntu]
          javierb JavierB added a comment - - edited

          Issue happens for latest versions 1.26 and 1.27

          javierb JavierB added a comment - - edited Issue happens for latest versions 1.26 and 1.27
          mikerohan Mikel Perez added a comment -

          The same issue happens (multi-configuration jobs) after upgrading jenkins from 1.448 to 1.456 and this plugin from 1.31 to 1.40(1.41 & 1.42)

          mikerohan Mikel Perez added a comment - The same issue happens (multi-configuration jobs) after upgrading jenkins from 1.448 to 1.456 and this plugin from 1.31 to 1.40(1.41 & 1.42)

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java
          http://jenkins-ci.org/commit/envinject-plugin/6d5641bf91a569f9a37e4881b84170ce0834856f
          Log:
          Fix JENKINS-12108

          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/EnvInjectListener.java http://jenkins-ci.org/commit/envinject-plugin/6d5641bf91a569f9a37e4881b84170ce0834856f Log: Fix JENKINS-12108

          People

            gbois Gregory Boissinot
            twood Thomas Wood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: