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

Token evaluation fails in GitPlugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Labels:
      None
    • Environment:
      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
    • Similar Issues:

      Description

      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 
      
      

       

        Attachments

          Activity

          Hide
          dszczepanik 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

          Show
          dszczepanik 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
          Hide
          dszczepanik Damian Szczepanik added a comment -

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

          Show
          dszczepanik Damian Szczepanik added a comment - Resolving as it works as expected when the configuration is not correct
          Hide
          moshe_zvi Moshe Zvi added a comment -

          Damian Szczepanik: 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.

          Show
          moshe_zvi Moshe Zvi added a comment - Damian Szczepanik : 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.
          Hide
          dszczepanik 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

          Show
          dszczepanik 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
          Hide
          moshe_zvi 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.

          Show
          moshe_zvi 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.

            People

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

              Dates

              Created:
              Updated:
              Resolved: