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

CommandInterpreter return value fix: causes incompatibility with Env-inject plugin in Jenkins v2.26

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Component/s: core, envinject-plugin
    • Labels:
    • Environment:
      windows 2012; Jenkins 2.16; latest version of envinject-plugin (as of 21/10/2016)
    • Similar Issues:

      Description

      When running Jenkins 2.26 with envinject-plugin and returning a map object from an Evaluated Groovy script, the environment variables are created but are empty.

      If I downgrade to Jenkins 2.25 environment variables are set correctly. Appears something in 2.26 breaks this plugin.

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I suppose it happens due to JENKINS-23786, which impacts Groovy Script interpreter.

            Show
            oleg_nenashev Oleg Nenashev added a comment - I suppose it happens due to JENKINS-23786 , which impacts Groovy Script interpreter.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -
            Show
            oleg_nenashev Oleg Nenashev added a comment - FYI Daniel Beck
            Hide
            danielbeck Daniel Beck added a comment -

            Cannot reproduce.

            Pristine Jenkins 2.30 instance. Install Envinject 1.93.1.

            Create a freestyle job with the following configuration:

            <?xml version='1.0' encoding='UTF-8'?>
            <project>
              <description></description>
              <keepDependencies>false</keepDependencies>
              <properties>
                <EnvInjectJobProperty plugin="envinject@1.93.1">
                  <info>
                    <groovyScriptContent>return [foo: &apos;bar&apos;, baz: &apos;qux&apos;]</groovyScriptContent>
                    <loadFilesFromMaster>false</loadFilesFromMaster>
                  </info>
                  <on>true</on>
                  <keepJenkinsSystemVariables>true</keepJenkinsSystemVariables>
                  <keepBuildVariables>true</keepBuildVariables>
                  <overrideBuildParameters>false</overrideBuildParameters>
                </EnvInjectJobProperty>
              </properties>
              <scm class="hudson.scm.NullSCM"/>
              <canRoam>true</canRoam>
              <disabled>false</disabled>
              <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
              <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
              <triggers/>
              <concurrentBuild>false</concurrentBuild>
              <builders>
                <hudson.tasks.Shell>
                  <command>env</command>
                </hudson.tasks.Shell>
              </builders>
              <publishers/>
              <buildWrappers/>
            </project>

            Build output (excerpt, removed useless variables from env output):

            Started by user admin
            [EnvInject] - Loading node environment variables.
            [EnvInject] - Preparing an environment for the build.
            [EnvInject] - Keeping Jenkins system variables.
            [EnvInject] - Keeping Jenkins build variables.
            [EnvInject] - Evaluating the Groovy script content
            [EnvInject] - Injecting contributions.
            Building in workspace /Users/danielbeck/JENKINS-39164-Home/workspace/JENKINS-39164
            [JENKINS-39164] $ /bin/sh -xe /var/folders/39/ggldtdps6034ct7d_y6x4_v80000gn/T/hudson3991272038220173596.sh
            + env
            SHELL=/bin/bash
            TERM=xterm-256color
            CLICOLOR=yes
            BUILD_TAG=jenkins-JENKINS-39164-1
            USER=danielbeck
            baz=qux
            JOB_NAME=JENKINS-39164
            foo=bar
            EXECUTOR_NUMBER=1
            NODE_LABELS=master
            BUILD_NUMBER=1
            Finished: SUCCESS

            So… how can this issue be reproduced? Or what else am I missing?

            Show
            danielbeck Daniel Beck added a comment - Cannot reproduce. Pristine Jenkins 2.30 instance. Install Envinject 1.93.1. Create a freestyle job with the following configuration: <?xml version='1.0' encoding='UTF-8'?> <project> <description></description> <keepDependencies>false</keepDependencies> <properties> <EnvInjectJobProperty plugin="envinject@1.93.1"> <info> <groovyScriptContent>return [foo: &apos;bar&apos;, baz: &apos;qux&apos;]</groovyScriptContent> <loadFilesFromMaster>false</loadFilesFromMaster> </info> <on>true</on> <keepJenkinsSystemVariables>true</keepJenkinsSystemVariables> <keepBuildVariables>true</keepBuildVariables> <overrideBuildParameters>false</overrideBuildParameters> </EnvInjectJobProperty> </properties> <scm class="hudson.scm.NullSCM"/> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild>false</concurrentBuild> <builders> <hudson.tasks.Shell> <command>env</command> </hudson.tasks.Shell> </builders> <publishers/> <buildWrappers/> </project> Build output (excerpt, removed useless variables from env output): Started by user admin [EnvInject] - Loading node environment variables. [EnvInject] - Preparing an environment for the build. [EnvInject] - Keeping Jenkins system variables. [EnvInject] - Keeping Jenkins build variables. [EnvInject] - Evaluating the Groovy script content [EnvInject] - Injecting contributions. Building in workspace /Users/danielbeck/JENKINS-39164-Home/workspace/JENKINS-39164 [JENKINS-39164] $ /bin/sh -xe /var/folders/39/ggldtdps6034ct7d_y6x4_v80000gn/T/hudson3991272038220173596.sh + env SHELL=/bin/bash TERM=xterm-256color CLICOLOR=yes BUILD_TAG=jenkins-JENKINS-39164-1 USER=danielbeck baz=qux JOB_NAME=JENKINS-39164 foo=bar EXECUTOR_NUMBER=1 NODE_LABELS=master BUILD_NUMBER=1 Finished: SUCCESS So… how can this issue be reproduced? Or what else am I missing?
            Hide
            danielbeck Daniel Beck added a comment -

            Oleg Nenashev Did you actually reproduce this bug?

            Show
            danielbeck Daniel Beck added a comment - Oleg Nenashev Did you actually reproduce this bug?
            Hide
            danielbeck Daniel Beck added a comment -

            Resolving as Cannot Reproduce for now, reopen when you can provide complete and unambiguous steps to reproduce this issue on a clean Jenkins installation.

            Show
            danielbeck Daniel Beck added a comment - Resolving as Cannot Reproduce for now, reopen when you can provide complete and unambiguous steps to reproduce this issue on a clean Jenkins installation.

              People

              • Assignee:
                Unassigned
                Reporter:
                apgray Andrew Gray
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: