[JIRA] (JENKINS-51792) Incorrect Jenkinsfile with >1 steps section produces unclear error about `default` branch name

2 views
Skip to first unread message

kshultz@cloudbees.com (JIRA)

unread,
Jun 7, 2018, 3:43:01 PM6/7/18
to jenkinsc...@googlegroups.com
Karl Shultz created an issue
 
Jenkins / Bug JENKINS-51792
Incorrect Jenkinsfile with >1 steps section produces unclear error about `default` branch name
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2018-06-07 19:42
Environment: Jenkins:
Core 2.126
Experimental level plugins all up to date
Plus Declarative running not-even-merged PR 228 level code
Priority: Minor Minor
Reporter: Karl Shultz

Summary
I made a mistake and ended up with a stage containing two steps blocks. When it ran, I got two error messages. The first made total sense, but the second error barked at me about Duplicate parallel branch name: "default". It looked out of place, since there's no stage called default.

Steps to recreate
1. Fire up your favorite Jenkins instance

2. Build this fork/branch of Declarative (PR 228) and pop it on. I did it via

  • git checkout abayer/jenkins-45455
  • mvn clean install -DskipTests=true
  • Upload the resulting .hpi files to my instance
  • Restart

3. Run the following Pipeline. This will recreate via actually running it, or by using the CLI.

pipeline {

    agent any

    stages {
        stage('Only the duplicate steps problem') {
            steps {
                echo "NOT SEQUENTIAL"
            }
            steps {
                echo "NOT SEQUENTIAL"
            }
        } 
    } 
}

Results
Error messages as follows:

Branch indexing
Obtained Jenkinsfile from fb470cf3daecb279f90f1b07b459bd7fd8ce8468
Running in Durability level: MAX_SURVIVABILITY
[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 6: Multiple occurrences of the steps section @ line 6, column 9.
           stage('Only the duplicate steps problem') {
           ^

WorkflowScript: 6: Duplicate parallel branch name: "default" @ line 6, column 9.
           stage('Only the duplicate steps problem') {
           ^

2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

It's the second of the two errors that looked strange, since there's no branch called default.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

kshultz@cloudbees.com (JIRA)

unread,
Nov 16, 2018, 2:13:01 PM11/16/18
to jenkinsc...@googlegroups.com
Karl Shultz assigned an issue to Karl Shultz
Change By: Karl Shultz
Assignee: Andrew Bayer Karl Shultz
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kshultz@cloudbees.com (JIRA)

unread,
Nov 20, 2018, 8:11:03 AM11/20/18
to jenkinsc...@googlegroups.com
Karl Shultz started work on Bug JENKINS-51792
 
Change By: Karl Shultz
Status: Open In Progress

kshultz@cloudbees.com (JIRA)

unread,
Nov 28, 2018, 5:44:01 PM11/28/18
to jenkinsc...@googlegroups.com

kshultz@cloudbees.com (JIRA)

unread,
Nov 28, 2018, 5:45:01 PM11/28/18
to jenkinsc...@googlegroups.com

kshultz@cloudbees.com (JIRA)

unread,
Nov 29, 2018, 12:45:02 PM11/29/18
to jenkinsc...@googlegroups.com

kshultz@cloudbees.com (JIRA)

unread,
Nov 29, 2018, 6:44:01 PM11/29/18
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:10 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages