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

Since EnvInject 1.81 variables cannot be used for Base ClearCase plugin VCS polling

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • envinject-plugin
    • None
    • All machines: Windows 7 x64, JRE 7 x64
      Jenkins Versions: At least from 1.501 to 1.504
      ClearCase Plugin: 1.3.14

      Since update from EnvInject 1.80 to 1.81 or higher (also tested with 1.82 and 1.83), the variables set by EnvInject plugin in "Prepare an environment for the run"-->"Properties Content" are not expanded when used by ClearCase VCS polling (ClearCase plugin) any longer.

      I'm setting the following variables in "Prepare an environment for the run"-->"Properties Content":

      PROJECT=KC001
      MinorVersion=${MinorBaseVersion}${MinorMinorVersion}
      

      Then, in the "Base ClearCase Plugin" I'm using those in the following fields:

      View tag: ${COMPUTERNAME}-snap-${PROJECT}-cont
      View path: ${COMPUTERNAME}-snap-${PROJECT}-cont
      Get config spec from a file: ${CCProfiles}\RRM\Continuous\${PROJECT}\Rules
      Branch(es): br_${PROJECT}_REL_${MajorVersion}_${MinorBaseVersion}x
      

      This has always been working up to now.
      Since update to EnvInject 1.81 (no update to ClearCase plugin) this is what's written in the SCM Polling Log of Jenkins:

      *************************** get view CSPEC ***********************
      [Snapshots] $ cleartool catcs -tag RRM-BUILD-S3-snap-${PROJECT}-cont
      cleartool: Error: View tag "RRM-BUILD-S3-snap-${PROJECT}-cont": ClearCase object not found
      FATAL: Base ClearCase failed. exit code=1
      

      Hence all variables not coming from EnvInject are expanded properly but the EnvInject "Prepare Environment ..." variables are not.

      This only happens in the VCS Polling activity. When manually triggering a build everything works just as expected and all variables are expanded properly.

      Unclear whether it's a bug in EnvInject or ClearCase plugin (i.e. using wrong way for expanding the vars).

          [JENKINS-16992] Since EnvInject 1.81 variables cannot be used for Base ClearCase plugin VCS polling

          I'm seeing the same issue with SVN polling, so it seems this isn't specific to ClearCase. It worked with 1.80, started failing with 1.81 and still fails on 1.83.

          The symptoms are like this, when Jenkins polls this is what happens:

          Started on Mar 6, 2013 3:54:57 PM
          Location 'https://server/svn/REPO/${SVN_LOCATION}/Project' does not exist
          One or more repository locations do not exist anymore for hudson.model.FreeStyleProject@4d4a39[Project], project will be disabled.
          Done. Took 0.19 sec
          No changes

          After starting the build manually everything works, it builds normally and the polling continues work as well. That is, polling works once the build has finished, not during the build. And after a restart of Jenkins everything is broken again.

          Arjan Veenstra added a comment - I'm seeing the same issue with SVN polling, so it seems this isn't specific to ClearCase. It worked with 1.80, started failing with 1.81 and still fails on 1.83. The symptoms are like this, when Jenkins polls this is what happens: Started on Mar 6, 2013 3:54:57 PM Location 'https://server/svn/REPO/${SVN_LOCATION}/Project' does not exist One or more repository locations do not exist anymore for hudson.model.FreeStyleProject@4d4a39[Project], project will be disabled. Done. Took 0.19 sec No changes After starting the build manually everything works, it builds normally and the polling continues work as well. That is, polling works once the build has finished, not during the build. And after a restart of Jenkins everything is broken again.

          Which Jenkins version do you use?

          Gregory Boissinot added a comment - Which Jenkins version do you use?

          Kurt added a comment - - edited

          Sorry for not giving the versions right away.
          I'm quite frequently updating to latest versions. The problem occured when updating the EnvInject plugin to 1.81.
          Not sure what was the exact Jenkins version when EnvInject 1.81 was released. But I guess it was something around Jenkins 1.501. So I would say at least for Jenkins 1.501 to 1.504 the problem occurs for me.
          ClearCase Plugin Version (maybe no longer relevant but for completness): 1.3.14 (not changed for some time - so not tested any older version)

          Additional Remark: I didn't find any exception or other hints in any of the Jenkins logs.

          Kurt added a comment - - edited Sorry for not giving the versions right away. I'm quite frequently updating to latest versions. The problem occured when updating the EnvInject plugin to 1.81. Not sure what was the exact Jenkins version when EnvInject 1.81 was released. But I guess it was something around Jenkins 1.501. So I would say at least for Jenkins 1.501 to 1.504 the problem occurs for me. ClearCase Plugin Version (maybe no longer relevant but for completness): 1.3.14 (not changed for some time - so not tested any older version) Additional Remark: I didn't find any exception or other hints in any of the Jenkins logs.

          I've first seen this in Jenkins 1.500, together with EnvInject 1.81. I downgraded EnvInject back to 1.80 wich solved the issue. It currently all works for me ruining 1.80 on 1.504.
          I'm loading the properties from a file, which might matter. Perhaps this issue is related to JENKINS-16575?

          Arjan Veenstra added a comment - I've first seen this in Jenkins 1.500, together with EnvInject 1.81. I downgraded EnvInject back to 1.80 wich solved the issue. It currently all works for me ruining 1.80 on 1.504. I'm loading the properties from a file, which might matter. Perhaps this issue is related to JENKINS-16575 ?

          Kurt added a comment -

          I see the problem while using properties from "Properties Content" field.
          So it seems this is independent of where the EnvInject properties are coming from.

          Kurt added a comment - I see the problem while using properties from "Properties Content" field. So it seems this is independent of where the EnvInject properties are coming from.

          Kurt added a comment -

          It seems the problem has been raised again as JENKINS-17377.
          Anybody can help to analyze the code changes between EnvInject 1.80 and 1.81?
          Unfortunately I'm a C++/C# developer and config manager but not experienced with Java/Eclipse/Maven/GIT at all. So I see no easy way for me to set up Jenkins R&D environment, debug and fix this myself.
          But if anybody with Jenkins Plugin R&D environment is willing to fix this but needs additional info or help in testing some debug builds with additional traces etc. I'm always available to help.

          Kurt added a comment - It seems the problem has been raised again as JENKINS-17377 . Anybody can help to analyze the code changes between EnvInject 1.80 and 1.81? Unfortunately I'm a C++/C# developer and config manager but not experienced with Java/Eclipse/Maven/GIT at all. So I see no easy way for me to set up Jenkins R&D environment, debug and fix this myself. But if anybody with Jenkins Plugin R&D environment is willing to fix this but needs additional info or help in testing some debug builds with additional traces etc. I'm always available to help.

          Kurt added a comment -

          For me this suddenly started working again with EnvInject Plugin v 1.89 (with v 1.88 it was definitely not working yet), ClearCase Plugin v 1.4 on Jenkins 1.526 (all version above have other issues preventing me from testing it further).
          So from my side I could close the issue now but it seems more people had this or similar problems. So before we close it maybe at least people could share their results on whether this is really gone.

          Kurt added a comment - For me this suddenly started working again with EnvInject Plugin v 1.89 (with v 1.88 it was definitely not working yet), ClearCase Plugin v 1.4 on Jenkins 1.526 (all version above have other issues preventing me from testing it further). So from my side I could close the issue now but it seems more people had this or similar problems. So before we close it maybe at least people could share their results on whether this is really gone.

          Jim Goodspeed added a comment -

          I'm seeing similar behavior with Jenkins 1.537 and version 1.89 of the plugin, but it is sporadic. I've defined the following in properties content:

          PROJ_ID=2013_10

          I'm then using this in the RTC plugin in the workspace field and the stream field:

          Workspace field: Jenkins_${PROJ_ID}_Workspace
          Stream field: Stream_${PROJ_ID}_Development

          The variable works in the workspace field, but not the stream field. I see the following in the console output:

          ERROR: Failed to run compare ws Jenkins_2013_10_Workspace stream Stream_${PROJ_ID}_Development

          I checked the jelly config source code for the RTC plugin to see if there was any difference in the way the fields were setup - they look the same except that the workspace field has a default value configured:

          <f:entry title="${%Build workspace}" field="workspaceName">
          <f:textbox default="${descriptor.defaultWS}"/>
          </f:entry>

          <f:entry title="${%Source stream}" field="streamName">
          <f:textbox/>
          </f:entry>

          Jim Goodspeed added a comment - I'm seeing similar behavior with Jenkins 1.537 and version 1.89 of the plugin, but it is sporadic. I've defined the following in properties content: PROJ_ID=2013_10 I'm then using this in the RTC plugin in the workspace field and the stream field: Workspace field: Jenkins_${PROJ_ID}_Workspace Stream field: Stream_${PROJ_ID}_Development The variable works in the workspace field, but not the stream field. I see the following in the console output: ERROR: Failed to run compare ws Jenkins_2013_10_Workspace stream Stream_${PROJ_ID}_Development I checked the jelly config source code for the RTC plugin to see if there was any difference in the way the fields were setup - they look the same except that the workspace field has a default value configured: <f:entry title="${%Build workspace}" field="workspaceName"> <f:textbox default="${descriptor.defaultWS}"/> </f:entry> <f:entry title="${%Source stream}" field="streamName"> <f:textbox/> </f:entry>

          Adil Akhund-Zade added a comment - - edited

          The same problem with Perforce: Perforce plugin 1.3.36 / Jeknins 1619 / EnvInject 1.92.1. It used to work, would be nice to have it fixed.
          The workaround I use: add a String parameter. .It propagates properly everywhere, but is unnecessarily exposed
          Tried with "Hidden parameter" plugin - worked too.

          Adil Akhund-Zade added a comment - - edited The same problem with Perforce: Perforce plugin 1.3.36 / Jeknins 1619 / EnvInject 1.92.1. It used to work, would be nice to have it fixed. The workaround I use: add a String parameter. .It propagates properly everywhere, but is unnecessarily exposed Tried with "Hidden parameter" plugin - worked too.

            gbois Gregory Boissinot
            klou Kurt
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: