• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Critical Critical
    • None
    • Jenkins 2.176.3, Ubuntu 14.04
      Environment Injector Plugin - 2.2.1
      Build Name and Description Setter - 2.0.3
      GitPlugin - 3.12.1
      GitClient Plugin - 2.9.0
      TokenMacroPlugin 2.8

      We use a macro (${PACKAGE_VERSION}) to push a tag to git after a successful build. 

      This used to work, until we started getting this error:

      ...
      [EnvInject] - Injecting environment variables from a build step.
      [EnvInject] - Injecting as environment variables the properties file path 'build.properties'
      [EnvInject] - Variables injected successfully.
      Failed to evaluate name macro:org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Unrecognized macro 'PACKAGE_VERSION' in '#59 (***-${PACKAGE_VERSION})'
      Archiving artifacts 
      
      

       

          [JENKINS-59892] Token evaluation fails in GitPlugin

          Moshe Zvi added a comment -

          I'm using the latest available version: 2.0.3. To the best of my knowledge, it was released in September.

          Moshe Zvi added a comment - I'm using the latest available version: 2.0.3. To the best of my knowledge, it was released in September.

          Mark Waite added a comment -

          Are you able to install build-name-setter 1.7.1 to see if that resolves the issue?

          Mark Waite added a comment - Are you able to install build-name-setter 1.7.1 to see if that resolves the issue?

          Moshe Zvi added a comment -

          I'll give it a try.
          So basically, revert to the last version before the breaking change in 2.0?

          Moshe Zvi added a comment - I'll give it a try. So basically, revert to the last version before the breaking change in 2.0?

          Mark Waite added a comment -

          Yes, that was my idea to test if that is the crucial change that resolves your issue.

          Mark Waite added a comment - Yes, that was my idea to test if that is the crucial change that resolves your issue.

          Moshe Zvi added a comment -

          OK. I'll find some time to install the plugin.

          Moshe Zvi added a comment - OK. I'll find some time to install the plugin.

          Based on logs it is clear to me that the build configuration is not correct and this is why macro plugin reports the issue which might be passed over via other plugin.

          Fix the configuration first

          Damian Szczepanik added a comment - Based on logs it is clear to me that the build configuration is not correct and this is why macro plugin reports the issue which might be passed over via other plugin. Fix the configuration first

          Resolving as it works as expected when the configuration is not correct

          Damian Szczepanik added a comment - Resolving as it works as expected when the configuration is not correct

          Moshe Zvi added a comment -

          dszczepanik: How is "clear to you" that the configuration is incorrect? This configuration was working correctly, and suddenly stopped.
          If you want to close the issue, at least provide some info on how to fix the configuration.

          Moshe Zvi added a comment - dszczepanik : How is "clear to you" that the configuration is incorrect? This configuration was working correctly, and suddenly stopped. If you want to close the issue, at least provide some info on how to fix the configuration.

          First, you need to prove this error comes from my plugin - you use the same macro a few times for different plugins and I have checked - this one works for me with plugin I develop. Second you are trying to evaluate empty string:
          + echo PACKAGE_VERSION=
          PACKAGE_VERSION=

          and error says that this is not valid operation. If you analyze output carefully you will notice that the cause of build failure is probably here:

          ERROR: Failed to push tag authgateway-${PACKAGE_VERSION} to origin
          hudson.plugins.git.GitException: Command "git push XXX authgateway-${PACKAGE_VERSION}" returned

          Damian Szczepanik added a comment - First, you need to prove this error comes from my plugin - you use the same macro a few times for different plugins and I have checked - this one works for me with plugin I develop. Second you are trying to evaluate empty string: + echo PACKAGE_VERSION= PACKAGE_VERSION= and error says that this is not valid operation. If you analyze output carefully you will notice that the cause of build failure is probably here: ERROR: Failed to push tag authgateway-${PACKAGE_VERSION} to origin hudson.plugins.git.GitException: Command "git push XXX authgateway-${PACKAGE_VERSION}" returned

          Moshe Zvi added a comment -

          However, the EnvInject plugin is misbehaving, because - as you can plainly see - the content of the file is fine. So I'm guessing an EnvInject issue.
          I don't which plugin is yours, but the issue is very much still happening, so please refrain from closing it until we've had a chance to fully examine and resolve.

          Moshe Zvi added a comment - However, the EnvInject plugin is misbehaving, because - as you can plainly see - the content of the file is fine. So I'm guessing an EnvInject issue. I don't which plugin is yours, but the issue is very much still happening, so please refrain from closing it until we've had a chance to fully examine and resolve.

            dszczepanik Damian Szczepanik
            moshe_zvi Moshe Zvi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: