[JIRA] (JENKINS-42895) Pipeline stage view is not showing the stages visually

1,013 views
Skip to first unread message

jnxlhuang@gmail.com (JIRA)

unread,
Mar 17, 2017, 3:29:01 PM3/17/17
to jenkinsc...@googlegroups.com
Jenny Huang updated an issue
 
Jenkins / Bug JENKINS-42895
Pipeline stage view is not showing the stages visually
Change By: Jenny Huang
Summary: Pipeline stage view is not showing the stages visually
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

jnxlhuang@gmail.com (JIRA)

unread,
Mar 20, 2017, 12:00:02 PM3/20/17
to jenkinsc...@googlegroups.com
Jenny Huang updated an issue
The pipeline stage view is not showing up after I switched the git repo from using gitLab to gitHub. 

svanoort@cloudbees.com (JIRA)

unread,
Mar 21, 2017, 12:05:01 PM3/21/17
to jenkinsc...@googlegroups.com
Sam Van Oort commented on Bug JENKINS-42895
 
Re: Pipeline stage view is not showing the stages visually

Hi Jenny Huang, do you have some more specific information to reproduce this in a small case?  Specifically a pipeline script that will demonstrate the issue.

frederic.meyrou@agfa.com (JIRA)

unread,
Mar 23, 2017, 10:15:01 AM3/23/17
to jenkinsc...@googlegroups.com

HI, 

I have the same problem here.

Config : Jenkins ver. 2.32.3 TLS + Windows Server 2012R2 + JDK 1.8 + 

Pipeline: Stage View Plugin
Pipeline Stage View Plugin.
2.6
Pipeline: Job
Defines a new job type for pipelines and provides their generic user interface.
2.10
JavaScript GUI Lib: Handlebars bundle plugin
JavaScript GUI Lib: Handlebars bundle plugin.
1.1.1
JavaScript GUI Lib: Moment.js bundle plugin
JavaScript GUI Lib: Moment.js bundle plugin.
1.1.1
Pipeline: REST API Plugin
Provides a REST API to access pipeline and pipeline run data.
2.6

 

Error message in Chrome (ressent version) :

GET http://jenkins-hcis-main.agfahealthcare.com/job/HICU/view/All/job/HICU_RELEASE_0804_core_RELEASE/job/trunk/wfapi/runs?fullStages=true&_=1490277536624 500 (Server Error)
send @ jquery2.js:998
ajax @ jquery2.js:998
exports.execAsyncGET @ stageview.js:3866
exports.getJobRuns @ stageview.js:3001
exports.listen @ stageview.js:2773
exports.getModelData @ stageview.js:3208
(anonymous) @ stageview.js:3703
(anonymous) @ stageview.js:2517
each @ jquery2.js:996
each @ jquery2.js:996
exports.forEachElement @ stageview.js:2516
exports.applyControllers @ stageview.js:3687
(anonymous) @ stageview.js:3802
j @ jquery2.js:996
fireWith @ jquery2.js:996
ready @ jquery2.js:996
I @ jquery2.js:996

 

Code of Pipeline :

// #!groovy
import hudson.scm.subversion.CheckoutUpdater

node('WIEN&&ALM_MANAGED') {
    timestamps {
        def mvnHome = tool 'Maven 3.3.x'
        def jdkHome = tool 'JDK 1.8 Orbis 64 bits'

        def mailingList = emailextrecipients([[$class: 'CulpritsRecipientProvider'],
        [$class: 'DevelopersRecipientProvider'],
        [$class: 'RequesterRecipientProvider']])
        def extendMailingList = ", amon....@agfa.com"

        def pom84File = 'pom.xml'
        def pom85File = 'pom85.xml'
        def pomFile

        def workspace = env.JOB_NAME.replace('branches%2F', '')
        env.WORKSPACE = "D:\\DEV\\CI\\WS\\${workspace}"
        env.JAVA_HOME = "${jdkHome}"

        ws(env.WORKSPACE) {
            try {
                if (env.JOB_NAME =~ '0804') {
                    pomFile = pom84File
                } else if (env.JOB_NAME =~ '0805') {
                    pomFile = pom85File
                } else {
                    throw new Exception("Define an ORBIS Solution (0804 or 0805) in the job name")
                }

                echo "Building ${env.JOB_NAME} with ${env.BRANCH_NAME} and ${pomFile} using ${env.WORKSPACE}"

                if (env.JOB_NAME =~ 'INTEGRATION') {
                    integrate(mvnHome, pomFile)
                } else if (env.JOB_NAME =~ 'TEST') {
                    test(mvnHome, pomFile)
                } else if (env.JOB_NAME =~ 'QUALITY') {
                    analyse(mvnHome, pomFile)
                } else if (env.JOB_NAME =~ 'SNAPSHOT') {
                    snapshot(mvnHome, pomFile)
                } else if (env.JOB_NAME =~ 'RELEASE' && env.BRANCH_NAME != 'trunk') {
                    release(mvnHome, pomFile)
                }
            } catch (any) {
                currentBuild.result = 'FAILURE'
                throw any //rethrow exception to prevent the build from proceeding
            } finally {
                // wipe workspace
                step([$class: 'WsCleanup', cleanWhenFailure: false])

                echo "Sending emails to ${mailingList}${extendMailingList}"

                step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: mailingList + extendMailingList, sendToIndividuals: true])
            }
        }
    }
}

// return the artifact version of a pom file
def getPomVersion(pomFile) {
    def matcher = pomFile =~ '<version>(.+)</version>'
    matcher ? matcher[0][1] : null
}

// get build artifacts and return a list of their hyperlinks
@NonCPS
def getArtifactsAsList(artifacts) {
    def artifactList = ""

    if(artifacts != null && artifacts.size() > 0) {
        artifacts.each() { f ->
            artifactList += "* ${f}\n"
        }
    }

    artifactList += "\nDownload: ${env.BUILD_URL}artifact/\n"

    return artifactList
}

// check out stage: scm is defined in multibranch pipeline configuration
void checkOut(pomFile) {
    stage('Checkout') {
        scm.setWorkspaceUpdater(new CheckoutUpdater())
        checkout scm

        def v = getPomVersion(readFile(pomFile))
        if (v) {
            echo "Version ${v}"
        }
    }
}

// update stage: update versions in pom file
void update(mvnHome, pomFile) {
    stage('Update') {
        bat "${mvnHome}\\bin\\mvn -f ${pomFile} versions:update-parent versions:update-properties -B"
    }
}

// checkin stage: if some dependency was updated
void checkIn(mvnHome, pomFile) {
    stage('Checkin') {
        def pomFileMainBackup = pomFile + '.versionsBackup'
        def pomFileModulesBackup = 'modules\\' + pomFileMainBackup

        if (fileExists (pomFileMainBackup) || fileExists (pomFileModulesBackup)) {
            echo "${pomFileMainBackup} exists: " + fileExists (pomFileMainBackup)
            echo "${pomFileModulesBackup} exists: " + fileExists (pomFileModulesBackup)

            def message = '"[versions-maven-plugin] update parent and/or properties version to latest release"'
            bat "${mvnHome}\\bin\\mvn -f ${pomFile} -Pxml-format xml-format:xml-format -B"
            bat "${mvnHome}\\bin\\mvn -f ${pomFile} versions:commit scm:checkin -Dmessage=${message} -B"
        } else {
            echo "No changes detected, skip checkin"
        }
    }
}

// build stage: package project
void build(mvnHome, pomFile) {
    checkOut(pomFile)
    update(mvnHome, pomFile)

    stage('Build') {
        bat "${mvnHome}\\bin\\mvn -f ${pomFile} clean package -B"
    }

    checkIn(mvnHome, pomFile)
}

// archive stage: archive artifacts on jenkins
void archive(pomFile) {
    stage('Archive') {
        archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/*.jar' , excludes: null, fingerprint: true, onlyIfSuccessful: true
    }
}

// test pipeline
void test(mvnHome, pomFile) {
    build(mvnHome, pomFile)

    stage('Test') {
        bat "${mvnHome}\\bin\\mvn -f ${pomFile} test -B -DskipTransactionalTests=false -Dtest.log4jlevel=DEBUG -Dmaven.test.failure.ignore=true -DdownloadSources=false -DdownloadJavadocs=false"
        junit healthScaleFactor: 5.0, allowEmptyResults: true, testDataPublishers: [[$class: 'ClaimTestDataPublisher']], testResults: '**/target/surefire-reports/*.xml'
    }
}

// analyse pipeline
void analyse(mvnHome, pomFile) {
    test(mvnHome, pomFile)

    stage('Analysis') {
        withSonarQubeEnv('sonar-hcis-vie-test') {
            bat "${mvnHome}\\bin\\mvn -f ${pomFile} sonar:sonar -Psonar -Dsonar.branch=${env.BRANCH_NAME} -Dsonar.scm.provider=svn"
        }
    }
}

// integration pipeline
void integrate(mvnHome, pomFile) {
    build(mvnHome, pomFile)

    stage('Integration') {
        bat "${mvnHome}\\bin\\mvn -f ${pomFile} install -B -Dmaven.test.failure.ignore=true -DdownloadSources=false -DdownloadJavadocs=false"
    }
}

// snapshot pipeline
void snapshot(mvnHome, pomFile) {
    build(mvnHome, pomFile)
    def version = getPomVersion(readFile(pomFile))

    stage('Snapshot') {
        bat "${mvnHome}\\bin\\mvn -f ${pomFile} deploy -B -Porbis-dev"
    }
    
    currentBuild.description = version
}

// release pipeline
void release(mvnHome, pomFile) {
    build(mvnHome, pomFile)
    def version = getPomVersion(readFile(pomFile)).replace('-SNAPSHOT', '')
    
    archive(pomFile)

    stage('Release') {
        bat "${mvnHome}\\bin\\mvn -f ${pomFile} -DdownloadSources=false -DdownloadJavadocs=false -Dmaven.test.failure.ignore=true release:prepare release:perform orbiscomponent:reset-start-revision -B -Porbis-dev"
    }
    
    currentBuild.description = version
}

alexander.olofsson@liu.se (JIRA)

unread,
Mar 28, 2017, 5:16:01 AM3/28/17
to jenkinsc...@googlegroups.com

Ran into this issue as well,
Jenkins ver. 2.52, CentOS 7.3.1611, OpenJDK 1.8.0_121

The GET for https://jenkins.fqdn/job/.../wfapi/runs?fullStages=true&_=1490691857430 fails with a 500 error and the following stack trace;

java.lang.IllegalStateException: Hit a BlockStartNode with no record of the start!
	at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.hitParallelStart(ForkScanner.java:554)
	at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.next(ForkScanner.java:584)
	at org.jenkinsci.plugins.workflow.graphanalysis.AbstractFlowScanner.next(AbstractFlowScanner.java:212)
	at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.next(ForkScanner.java:566)
	at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.visitSimpleChunks(ForkScanner.java:764)
	at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.visitSimpleChunks(ForkScanner.java:635)
	at com.cloudbees.workflow.rest.external.RunExt.createNew(RunExt.java:318)
	at com.cloudbees.workflow.rest.external.RunExt.create(RunExt.java:306)
	at com.cloudbees.workflow.rest.external.JobExt.create(JobExt.java:131)
	at com.cloudbees.workflow.rest.endpoints.JobAPI.doRuns(JobAPI.java:72)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
Caused: java.lang.reflect.InvocationTargetException
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:347)
	at com.cloudbees.workflow.util.ServeJson$Processor.invoke(ServeJson.java:30)
Caused: java.lang.RuntimeException: Unexpected exception while serving JSON
	at com.cloudbees.workflow.util.ServeJson$Processor.invoke(ServeJson.java:34)
	at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
...

alexander.olofsson@liu.se (JIRA)

unread,
Mar 28, 2017, 7:29:02 AM3/28/17
to jenkinsc...@googlegroups.com
Alexander Olofsson edited a comment on Bug JENKINS-42895
Ran into this issue as well,
Jenkins ver. 2.52, CentOS 7.3.1611, OpenJDK 1.8.0_121

The GET for https://jenkins.fqdn/job/.../wfapi/runs?fullStages=true&_=1490691857430 fails with a 500 error and the following stack trace;
{code}

java.lang.IllegalStateException: Hit a BlockStartNode with no record of the start!
at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.hitParallelStart(ForkScanner.java:554)
at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.next(ForkScanner.java:584)
at org.jenkinsci.plugins.workflow.graphanalysis.AbstractFlowScanner.next(AbstractFlowScanner.java:212)
at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.next(ForkScanner.java:566)
at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.visitSimpleChunks(ForkScanner.java:764)
at org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner.visitSimpleChunks(ForkScanner.java:635)
at com.cloudbees.workflow.rest.external.RunExt.createNew(RunExt.java:318)
at com.cloudbees.workflow.rest.external.RunExt.create(RunExt.java:306)
at com.cloudbees.workflow.rest.external.JobExt.create(JobExt.java:131)
at com.cloudbees.workflow.rest.endpoints.JobAPI.doRuns(JobAPI.java:72)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
Caused: java.lang.reflect.InvocationTargetException
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:347)
at com.cloudbees.workflow.util.ServeJson$Processor.invoke(ServeJson.java:30)
Caused: java.lang.RuntimeException: Unexpected exception while serving JSON
at com.cloudbees.workflow.util.ServeJson$Processor.invoke(ServeJson.java:34)
at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
...
{code}

I discovered a way to replicate this as well, just run the following pipeline and this will break;
{code:groovy}
// Works
stage('Stage A') {
    echo "A"
}
// Works
stage('Stage B') {
    parallel a: {
        echo "B.A"
    }, b: {
        echo "B.B"
    }
}
// Breaks
stage('Stage C') {
    def steps = [:]
    // Empty map
    parallel steps
}
{code}

alexander.olofsson@liu.se (JIRA)

unread,
Mar 28, 2017, 7:29:03 AM3/28/17
to jenkinsc...@googlegroups.com

jnxlhuang@gmail.com (JIRA)

unread,
Mar 29, 2017, 2:49:01 PM3/29/17
to jenkinsc...@googlegroups.com

Sam Van Oort Do you have trouble reproduce it? The stage view is gone completely on the server that I have. It shows up occasionally(rarely though), but most of time, it is invisible. I have more than one build items setup and I cannot see the stage view visually in any of them. But I am pretty sure it was working fine when I set it up initially.

Reply all
Reply to author
Forward
0 new messages