jenkinsci / build-name-setter-plugin

Build Name Setter Plugin for Jenkins CI
https://plugins.jenkins.io/build-name-setter/
MIT License
34 stars 51 forks source link

IllegalStateException (Build step 'Changes build name' marked build as failure), while actual build is SUCCESS #62

Closed paulvi closed 3 years ago

paulvi commented 3 years ago

I am very glad to discover this plugin as it make build info really helpful at first sight. I use

#${BUILD_NUMBER}: ${GIT_REVISION,length=8} (${GIT_BRANCH}) by ${BUILD_USER_ID}

image

It seems that this plugin make build unstable as Jenkins build often fails over IllegalStateException (Build step 'Changes build name' marked build as failure), while actual build is SUCCESS

Reproduction steps

Results

Expected result:

BUILD successfull

Actual result:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:04 min
....
[JENKINS] Archiving /hbdata/data/jenkins_data/workspace/...-1.0.0-SNAPSHOT.jar
channel stopped
ERROR: Build step failed with exception
java.lang.IllegalStateException
    at org.objectweb.asm.tree.analysis.BasicInterpreter.<init>(BasicInterpreter.java:66)
    at org.parboiled.transform.RuleMethodInterpreter.<init>(RuleMethodInterpreter.java:42)
    at org.parboiled.transform.InstructionGraphCreator.process(InstructionGraphCreator.java:41)
    at org.parboiled.transform.ParserTransformer.runMethodTransformers(ParserTransformer.java:62)
    at org.parboiled.transform.ParserTransformer.extendParserClass(ParserTransformer.java:45)
    at org.parboiled.transform.ParserTransformer.transformParser(ParserTransformer.java:39)
    at org.parboiled.Parboiled.createParser(Parboiled.java:54)
Caused: java.lang.RuntimeException: Error creating extended parser class: null
    at org.parboiled.Parboiled.createParser(Parboiled.java:58)
    at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:80)
    at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:74)
    at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:199)
    at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:237)
    at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:207)
    at org.jenkinsci.plugins.buildnamesetter.Executor.evaluateMacro(Executor.java:75)
    at org.jenkinsci.plugins.buildnamesetter.Executor.setName(Executor.java:30)
    at org.jenkinsci.plugins.pipeline.BuildNameStep.perform(BuildNameStep.java:35)
    at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:944)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:894)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
    at hudson.model.Run.execute(Run.java:1906)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Build step 'Changes build name' marked build as failure
Collecting metadata...
Metadata collection done.
13-04-2021 23:02:43 Allure Report Recorder Plugin: job class name:MavenModuleSetBuild
13-04-2021 23:02:43 Allure Report Recorder Plugin: job type invalid,not analyse
Finished: FAILURE

Version report

Jenkins and plugins versions report:

build-name-setter:2.1.0

Jenkins: 2.245
OS: Linux - 4.15.0-70-generic
---
pipeline-npm:0.9.2
rundeck:3.6.9
built-on-column:1.1
jquery3-api:3.5.1-2
pipeline-maven:3.9.3
multiple-scms:0.6
authentication-tokens:1.4
cvs:2.17
cobertura:1.16
token-macro:2.13
email-ext:2.81
leiningen-plugin:0.5.6
pipeline-github:2.7
git-client:3.6.0
workflow-remote-loader:1.5
jx-pipelines:1.0.15
blueocean-commons:1.24.3
ws-cleanup:0.38
workflow-cps-global-lib-http:1.10.1
junit:1.48
script-security:1.75
envinject:2.3.0
pipeline-build-step:2.13
git-prebuildmerge-trait:1.0
gitlab-hook:1.4.2
scm-api:2.6.4
build-token-root:1.7
gradle:1.36
sonar-gerrit:2.4.3
AllureReportRecorder:1.0.0
git:4.5.2
jquery:1.12.4-1
pipeline-stage-step:2.5
blueocean-pipeline-api-impl:1.24.3
codefresh:1.8
h2-api:1.4.199
pipeline-multibranch-defaults:2.1
github-branch-source:2.9.3
Parameterized-Remote-Trigger:3.1.5.1
jacoco:3.1.0
uno-choice:2.5.1
pipeline-input-step:2.12
parameterized-trigger:2.39
mapdb-api:1.0.9.0
cloudbees-folder:6.15
pipeline-githubnotify-step:1.0.5
database-mysql:1.4
workflow-api:2.40
multi-branch-project-plugin:0.7
build-name-setter:2.1.0
build-token-trigger:1.0.0
build-pipeline-plugin:1.5.8
workflow-cps-global-lib:2.17
cas-plugin:1.4.3
workflow-basic-steps:2.21
log-command:1.0.2
command-launcher:1.5
lockable-resources:2.10
description-setter:1.10
gerrit-verify-status-reporter:0.0.3
ace-editor:1.1
aws-credentials:1.28
blueocean-rest:1.24.3
locale:1.4
gerrit-trigger:2.32.0
jqs-monitoring:1.4
copy-project-link:1.5
plasticscm-mergebot:0.14
blueocean-jwt:1.24.3
coding-webhook:1.4.3
durable-task:1.35
fortify:20.2.34
pipeline-graph-analysis:1.10
monitoring:1.86.0
git-server:1.9
compact-columns:1.12
pipeline-model-api:1.7.2
gradle-repo:1.0.1
jackson2-api:2.12.1
favorite:2.3.2
webhook-step:1.4
pipeline-github-lib:1.0
simple-theme-plugin:0.6
ant:1.11
workflow-step-api:2.23
console-column-plugin:1.5
sonar-quality-gates:1.3.1
plugin-util-api:1.6.1
variant:1.3
ssh-credentials:1.18.1
structs:1.20
antisamy-markup-formatter:2.1
extended-read-permission:3.2
pipeline-aggregator-view:1.11
badge:1.8
checks-api:1.2.0
phabricator-plugin:2.1.3
list-command:0.2
metadata:1.1.0b
htmlpublisher:1.24
momentjs:1.1.1
github:1.32.0
pipeline-milestone-step:1.3.1
jsch:0.1.55.2
emailext-template:1.2
rebuild:1.31
gitlab-plugin:1.5.13
jobConfigHistory:2.26
workflow-durable-task-step:2.35
pipeline-config-history:1.6
nodelabelparameter:1.7.2
lenientshutdown:1.1.1
python:1.3
jquery-detached:1.2.1
resource-disposer:0.14
workflow-aggregator:2.6
mailer:1.32.1
blueocean-core-js:1.24.3
monitor-remote-job:1.0
windows-slaves:1.6
workflow-cps:2.87
groovy-postbuild:2.5
okhttp-api:3.14.9
jquery-ui:1.0.2
pipeline-cps-http:0.3.1
gerrit-code-review:0.4.4
bootstrap4-api:4.5.3-1
role-strategy:3.1
sonar:2.13
docker-commons:1.17
persistent-parameter:1.2
pipeline-bamboo:0.0.2
display-url-api:2.3.4
postbuildscript:2.11.0
allure-jenkins-plugin:2.29.0
blueocean-web:1.24.3
branch-api:2.6.2
ruby-runtime:0.12
blueocean-rest-impl:1.24.3
pipeline-deploymon:1.0
run-condition:1.5
bouncycastle-api:2.20
git-parameter:0.9.13
thinBackup:1.10
javadoc:1.6
plain-credentials:1.7
saferestart:0.3
config-file-provider:3.7.0
pipeline-restful-api:0.10
github-autostatus:3.6.2
docker-workflow:1.25
dingding-json-pusher:2.0
workflow-multibranch:2.22
code-coverage-api:1.2.0
apache-httpcomponents-client-4-api:4.5.13-1.0
msginject:0.1.1
global-build-stats:1.5
jdk-tool:1.4
workflow-support:3.7
database:1.7
pipeline-model-extensions:1.7.2
ssh-agent:1.20
popper-api:1.16.0-7
pipeline-model-definition:1.7.2
build-monitor-plugin:1.12+build.201809061734
postbuild-task:1.9
pipeline-stage-view:2.19
snakeyaml-api:1.27.0
build-timeout:1.20
pipeline-as-yaml:0.16-rc
credentials-binding:1.24
trilead-api:1.0.13
http_request:1.8.27
pipeline-aws:1.43
external-monitor-job:1.7
file-operations:1.11
pipeline-model-declarative-agent:1.1.1
pubsub-light:1.13
echarts-api:4.9.0-2
workflow-job:2.40
pipeline-utility-steps:2.6.1
covcomplplot:1.1.1
extended-choice-parameter:0.82
envinject-api:1.7
groovy:2.3
font-awesome-api:5.15.1-1
github-api:1.122
workflow-scm-step:2.11
credentials:2.3.14
ssh-slaves:1.31.5
handlebars:1.1.1
matrix-project:1.18
multibranch-build-strategy-extension:1.0.10
timestamper:1.11.8
maven-plugin:3.8
distfork:1.7
matrix-auth:2.6.6
aws-java-sdk:1.11.930
pipeline-stage-tags-metadata:1.7.2
pyenv-pipeline:2.1.2
extra-columns:1.22
build-user-vars-plugin:1.6
pam-auth:1.6
dashboard-view:2.14
pipeline-rest-api:2.19
blueocean-pipeline-scm-api:1.24.3
jenkins-design-language:1.24.3
jenkins-multijob-plugin:1.36
subversion:2.13.2
pipeline-dependency-walker:1.0.0
conditional-buildstep:1.4.1
dingding-notifications:1.9
active-directory:2.23.
Paste here
damianszczepanik commented 3 years ago

Looks like problem with token macro and its version, upgrade token macro and should be fine

paulvi commented 3 years ago

Do you mean token-macro:2.13 is too old?

Please confirm exactly. What min version of token-macro is needed?