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

Problems expanding variables created outside the Jenkins build

      Some plugins stopped to work when macros are putted to expand. That worked well before. You can see almost identical stacktrace

      https://issues.jenkins-ci.org/browse/JENKINS-37222
      https://github.com/jenkinsci/stashnotifier-plugin/issues/117

          [JENKINS-37238] Problems expanding variables created outside the Jenkins build

          Pavel Batanov created issue -

          Alex Earl added a comment -

          It looks like you are using the beta release, which means this is not critical.

          Alex Earl added a comment - It looks like you are using the beta release, which means this is not critical.

          Pavel Batanov added a comment -

          Yeah, really the beta one. I think you should add compatibility section to your pom.xml to warn users that this version is not compatible with earlies ones

          https://wiki.jenkins-ci.org/display/JENKINS/Marking+a+new+plugin+version+as+incompatible+with+older+versions

          Pavel Batanov added a comment - Yeah, really the beta one. I think you should add compatibility section to your pom.xml to warn users that this version is not compatible with earlies ones https://wiki.jenkins-ci.org/display/JENKINS/Marking+a+new+plugin+version+as+incompatible+with+older+versions
          Pavel Batanov made changes -
          Priority Original: Critical [ 2 ] New: Minor [ 4 ]

          Alex Earl added a comment -

          The plugin IS compatible with earlier versions. It's just still under test, which is why it is released as a beta.

          Alex Earl added a comment - The plugin IS compatible with earlier versions. It's just still under test, which is why it is released as a beta.

          Pavel Batanov added a comment -

          Understand, sorry

          Pavel Batanov added a comment - Understand, sorry

          I put in the original ticket for the stash-updater plugin, Which version of the token macro plugin is needed to avoid the following bug:

          17:33:19 org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Unrecognized macro 'FOO' in '$FOO'
          17:33:19 at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:198)
          17:33:19 at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:233)
          17:33:19 at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:222)
          17:33:19 at org.jenkinsci.plugins.stashNotifier.StashNotifier.lookupCommitSha1s(StashNotifier.java:287)
          17:33:19 at org.jenkinsci.plugins.stashNotifier.StashNotifier.processJenkinsEvent(StashNotifier.java:247)
          17:33:19 at org.jenkinsci.plugins.stashNotifier.StashNotifier.prebuild(StashNotifier.java:194)
          17:33:19 at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:837)
          17:33:19 at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:832)
          17:33:19 at hudson.model.Build$BuildExecution.doRun(Build.java:144)
          17:33:19 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
          17:33:19 at hudson.model.Run.execute(Run.java:1738)
          17:33:19 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          17:33:19 at hudson.model.ResourceController.execute(ResourceController.java:98)
          17:33:19 at hudson.model.Executor.run(Executor.java:410)

          I'm at 1.9 now, i've tried 1.10 as well as 1.21

          Shawn Baumkirchner added a comment - I put in the original ticket for the stash-updater plugin, Which version of the token macro plugin is needed to avoid the following bug: 17:33:19 org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Unrecognized macro 'FOO' in '$FOO' 17:33:19 at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:198) 17:33:19 at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:233) 17:33:19 at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:222) 17:33:19 at org.jenkinsci.plugins.stashNotifier.StashNotifier.lookupCommitSha1s(StashNotifier.java:287) 17:33:19 at org.jenkinsci.plugins.stashNotifier.StashNotifier.processJenkinsEvent(StashNotifier.java:247) 17:33:19 at org.jenkinsci.plugins.stashNotifier.StashNotifier.prebuild(StashNotifier.java:194) 17:33:19 at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:837) 17:33:19 at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:832) 17:33:19 at hudson.model.Build$BuildExecution.doRun(Build.java:144) 17:33:19 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 17:33:19 at hudson.model.Run.execute(Run.java:1738) 17:33:19 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 17:33:19 at hudson.model.ResourceController.execute(ResourceController.java:98) 17:33:19 at hudson.model.Executor.run(Executor.java:410) I'm at 1.9 now, i've tried 1.10 as well as 1.21

          Alex Earl added a comment -

          1.9 works?

          Alex Earl added a comment - 1.9 works?

          no the above errors are from the 1.9 version of token-macro. I'm using jenkins version: 1.655 as well.

          Shawn Baumkirchner added a comment - no the above errors are from the 1.9 version of token-macro. I'm using jenkins version: 1.655 as well.

          Alex Earl added a comment -

          Please try ${ENV, var="YOURVAR"}, which is the generally supported way to access environment variables. If that doesn't work, then the variable is not in any context that token macro can access it.

          Alex Earl added a comment - Please try ${ENV, var="YOURVAR"}, which is the generally supported way to access environment variables. If that doesn't work, then the variable is not in any context that token macro can access it.

            slide_o_mix Alex Earl
            scaytrase Pavel Batanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: