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

Exception caught evaluating condition: [org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Undefined parameter var in token ENV], action = [Fail the build]

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In a "Conditional step (single)" where Run is "Regular expression match" and Label is "${ENV,var="NODE_LABELS"}" I sometimes get "Exception caught evaluating condition: [org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Undefined parameter var in token ENV], action = [Fail the build]" errors.

      The exceptions started to appear after the update of the Token Macro Plugin to version 2.0 (from 1.12.1).

      As a side note: I only need to use a regex match on NODE_LABELS because there is no simpler way to identify windows nodes that I know of...

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/org/jenkinsci/plugins/tokenmacro/DataBoundTokenMacro.java
          http://jenkins-ci.org/commit/token-macro-plugin/65fabc0bb02fa64fc17fd5e1b12d39f3a9fa1eb5
          Log:
          Fix JENKINS-38871

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/org/jenkinsci/plugins/tokenmacro/DataBoundTokenMacro.java http://jenkins-ci.org/commit/token-macro-plugin/65fabc0bb02fa64fc17fd5e1b12d39f3a9fa1eb5 Log: Fix JENKINS-38871
          Hide
          cobexer Ing. Christoph Obexer added a comment -

          Sorry for not noticing this earlier.
          I have not seen this issue since I reported it here. I also didn't install new plugins into my Jenkins instance since then.

          I could definitely try out the attached plugin if that is of any help.

          Show
          cobexer Ing. Christoph Obexer added a comment - Sorry for not noticing this earlier. I have not seen this issue since I reported it here. I also didn't install new plugins into my Jenkins instance since then. I could definitely try out the attached plugin if that is of any help.
          Hide
          cobexer Ing. Christoph Obexer added a comment -

          So this happened again (4 times) . This time I updated the plugins listed below and restarted Jenkins:

          blueocean-commons.jpi
          blueocean-web.jpi
          blueocean-rest.jpi
          blueocean-jwt.jpi
          blueocean-rest-impl.jpi
          blueocean-pipeline-api-impl.jpi
          blueocean-github-pipeline.jpi
          blueocean-git-pipeline.jpi
          blueocean-config.jpi
          blueocean-events.jpi
          blueocean-personalization.jpi
          blueocean-i18n.jpi
          blueocean-dashboard.jpi
          blueocean.jpi
          active-directory.jpi
          analysis-core.jpi
          git-client.jpi
          matrix-project.jpi
          blueocean-rest
          blueocean-events
          blueocean-pipeline-api-impl
          analysis-core
          blueocean-commons
          blueocean-web
          blueocean-jwt
          blueocean-personalization
          blueocean-config
          blueocean-github-pipeline
          blueocean-dashboard
          blueocean-rest-impl
          blueocean
          active-directory
          matrix-project
          git-client
          blueocean-i18n
          blueocean-git-pipeline
          

          From the Jenkins log:

          Mär 27, 2017 1:04:15 PM org.jenkins_ci.plugins.run_condition.BuildStepRunner logEvaluateException
          WARNUNG: Exception caught evaluating condition: [org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Undefined parameter var in token ENV], action = [Fail the build]
          org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Undefined parameter var in token ENV
                  at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.prepare(DataBoundTokenMacro.java:172)
                  at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:198)
                  at org.jenkinsci.plugins.tokenmacro.Parser.processToken(Parser.java:297)
                  at org.jenkinsci.plugins.tokenmacro.Action$KiHW1UeqOdqAwZul.run(Unknown Source)
                  at org.parboiled.matchers.ActionMatcher.match(ActionMatcher.java:96)
                  at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)
                  at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)
                  at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)
                  at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)
                  at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)
                  at org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)
                  at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)
                  at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)
                  at org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)
                  at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)
                  at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)
                  at org.parboiled.matchers.ZeroOrMoreMatcher.match(ZeroOrMoreMatcher.java:39)
                  at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)
                  at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)
                  at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)
                  at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77)
                  at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351)
                  at org.parboiled.parserunners.BasicParseRunner.run(BasicParseRunner.java:72)
                  at org.parboiled.parserunners.ReportingParseRunner.runBasicMatch(ReportingParseRunner.java:86)
                  at org.parboiled.parserunners.ReportingParseRunner.run(ReportingParseRunner.java:66)
                  at org.parboiled.parserunners.AbstractParseRunner.run(AbstractParseRunner.java:81)
                  at org.parboiled.parserunners.AbstractParseRunner.run(AbstractParseRunner.java:76)
                  at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:68)
                  at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:204)
                  at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:234)
                  at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:216)
                  at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:208)
                  at org.jenkins_ci.plugins.run_condition.core.ExpressionCondition.runPerform(ExpressionCondition.java:57)
                  at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.evaluate(BuildStepRunner.java:107)
                  at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:147)
                  at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
                  at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:109)
                  at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
                  at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
                  at hudson.model.Build$BuildExecution.build(Build.java:206)
                  at hudson.model.Build$BuildExecution.doRun(Build.java:163)
                  at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
                  at hudson.model.Run.execute(Run.java:1733)
                  at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
                  at hudson.model.ResourceController.execute(ResourceController.java:97)
                  at hudson.model.Executor.run(Executor.java:405)
          
          Show
          cobexer Ing. Christoph Obexer added a comment - So this happened again (4 times) . This time I updated the plugins listed below and restarted Jenkins: blueocean-commons.jpi blueocean-web.jpi blueocean-rest.jpi blueocean-jwt.jpi blueocean-rest-impl.jpi blueocean-pipeline-api-impl.jpi blueocean-github-pipeline.jpi blueocean-git-pipeline.jpi blueocean-config.jpi blueocean-events.jpi blueocean-personalization.jpi blueocean-i18n.jpi blueocean-dashboard.jpi blueocean.jpi active-directory.jpi analysis-core.jpi git-client.jpi matrix-project.jpi blueocean-rest blueocean-events blueocean-pipeline-api-impl analysis-core blueocean-commons blueocean-web blueocean-jwt blueocean-personalization blueocean-config blueocean-github-pipeline blueocean-dashboard blueocean-rest-impl blueocean active-directory matrix-project git-client blueocean-i18n blueocean-git-pipeline From the Jenkins log: Mär 27, 2017 1:04:15 PM org.jenkins_ci.plugins.run_condition.BuildStepRunner logEvaluateException WARNUNG: Exception caught evaluating condition: [org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Undefined parameter var in token ENV], action = [Fail the build] org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Undefined parameter var in token ENV at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.prepare(DataBoundTokenMacro.java:172) at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:198) at org.jenkinsci.plugins.tokenmacro.Parser.processToken(Parser.java:297) at org.jenkinsci.plugins.tokenmacro.Action$KiHW1UeqOdqAwZul.run(Unknown Source) at org.parboiled.matchers.ActionMatcher.match(ActionMatcher.java:96) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.ZeroOrMoreMatcher.match(ZeroOrMoreMatcher.java:39) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.parserunners.BasicParseRunner.run(BasicParseRunner.java:72) at org.parboiled.parserunners.ReportingParseRunner.runBasicMatch(ReportingParseRunner.java:86) at org.parboiled.parserunners.ReportingParseRunner.run(ReportingParseRunner.java:66) at org.parboiled.parserunners.AbstractParseRunner.run(AbstractParseRunner.java:81) at org.parboiled.parserunners.AbstractParseRunner.run(AbstractParseRunner.java:76) at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:68) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:204) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:234) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:216) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:208) at org.jenkins_ci.plugins.run_condition.core.ExpressionCondition.runPerform(ExpressionCondition.java:57) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.evaluate(BuildStepRunner.java:107) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:147) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105) at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:109) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1733) at hudson.matrix.MatrixRun.run(MatrixRun.java:146) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405)
          Hide
          cobexer Ing. Christoph Obexer added a comment -

          I just noticed that I hadn't used your attached plugin yet... I installed the attached version now and restarted Jenkins - but considering the long time this worked without me using the updated version I'm not sure I will be able to provide any usable feedback any time soon =/

          Show
          cobexer Ing. Christoph Obexer added a comment - I just noticed that I hadn't used your attached plugin yet... I installed the attached version now and restarted Jenkins - but considering the long time this worked without me using the updated version I'm not sure I will be able to provide any usable feedback any time soon =/
          Hide
          slide_o_mix Alex Earl added a comment -

          Fixed in 2.1

          Show
          slide_o_mix Alex Earl added a comment - Fixed in 2.1

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              cobexer Ing. Christoph Obexer
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: