What does "cannot start writing logs to a finished node" mean?

238 views
Skip to first unread message

ky...@kayak.com

unread,
Oct 20, 2016, 4:36:22 PM10/20/16
to Jenkins Users
[Lint KayakFree] [android-lint] Computing warning deltas based on reference build #35
[Pipeline] [Lint KayakFree] }
[Pipeline] [Lint KayakFree] // node
[Pipeline] [Lint KayakFree] }
[Pipeline] // parallel
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
java.lang.IllegalStateException: cannot start writing logs to a finished node org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode[id=30]


The lint stage never finishes and lint passed so it shouldn't be hitting the catch which does print a little debug output.
This worked in the previous version of Jenkins (2.25)..current is 2.26:

stage ('Lint') {
  def branches = [:]
  branches['Lint KayakFree'] = {
    node ('android') {
      try {
        unstash name: 'source'
        sh "./gradlew --no-daemon lintKayakFree${variant}"
        androidLint()
      } catch (Exception err) {
        currentBuild.result = 'FAILURE'
        this.notifyStash('FAILED')
      }
    }
  }
  branches['Lint Checkfelix'] = {
    node ('android') {
      try {
        unstash name: 'source'
        sh "./gradlew --no-daemon lintCheckfelix${variant}"
      } catch (Exception err) {
        currentBuild.result = 'FAILURE'
        this.notifyStash('FAILED')
      }
    }
  }
  branches['Lint Swoodoo'] = {
    node ('android') {
      try {
        unstash name: 'source'
        sh "./gradlew --no-daemon lintSwoodoo${variant}"
      } catch (Exception err) {
        currentBuild.result = 'FAILURE'
        this.notifyStash('FAILED')
      }
    }
  }
  parallel branches
}

Sven Finsterwalder

unread,
Oct 21, 2016, 3:23:37 AM10/21/16
to Jenkins Users
I have a similar problem my code looks like this:

#!groovy​


timestamps
{
 
def checkoutFolderPipelineScript = '/../workspace@script'
 
def buildEnv
 node
('master') {
 stage
("Setup") {
 echo
"${pwd()}"
 buildEnv
= load("${pwd()}${checkoutFolderPipelineScript}/BuildEnvironment.groovy")
 
}
 
}

 node
{
 stage
('Create files') {
 parallel
(
 
JuriDefault: {
 
def casinoName = "astroroyal"
 dir
("${casinoName}") {
 writeFile file
: "IoM_default.html", text: "<tr><td>IoM</td><td>3</td><td>3</td><td>0</td><td>0</td></tr>"

 buildEnv
.stashItem("ast1", "IoM_default.html", "${pwd()}")
 
}
 
},
 
JuriIoM: {
 
def casinoName = "astroroyal_IoM"
 dir
("${casinoName}") {
 writeFile file
: "IoM.html", text: "<tr><td>IoM</td><td>17</td><td>10</td><td>7</td><td>0</td></tr>"

 buildEnv
.stashItem("ast2", "IoM.html", "${pwd()}")
 
}

 
},
 
JuriES: {
 
def casinoName = "astroroyal_ES"
 dir
("${casinoName}") {
 writeFile file
: "ES.html", text: "<tr><td>IoM</td><td>7</td><td>0</td><td>7</td><td>0</td></tr>"

 buildEnv
.stashItem("ast3", "ES.html", "${pwd()}")
 
}

 
}
 
)
 
}


 stage
("Create overview of files content") {
 dir
("testresultOverview") {
 unstash
("ast1")
 unstash
("ast2")
 unstash
("ast3")
 sh
"""#!/bin/sh
 ls -l ${pwd()}
 """


 
def reportFileList = new FileNameFinder().getFileNames("${pwd()}/", '*.html')
 
def htmlMetaDataAndStyle = "<!DOCTYPE html>\n" +
 
"<html>\n" +
 
"<head>\n" +
 
"<style>\n" +
 
"table {\n" +
 
" border-collapse: collapse;\n" +
 
"}\n" +
 
"th{" +
 
"background-color: #8f9093;" +
 
"color: white;" +
 
"padding: 5px" +
 
"}" +
 
"table, td, th {\n" +
 
" border: 1px solid black;\n" +
 
"}\n" +
 
"</style>\n" +
 
"</head>\n" +
 
"<body>"
 
def reportOutput = "<table><th>Jurisdiction</th><th>Total</th><th>Passed</th><th>Failed</th><th>Skipped</th>\n"
 
for (item in reportFileList) {
 
// If it does exist
 
if (fileExists(item)) {
 
def output = readFile item;
 reportOutput
= "${reportOutput} ${output}"
 
} else {
 echo
"skipp ${item}"
 
}
 
}
 echo
"${reportOutput}"
 writeFile file
: "testresultoverviewreport.html", text: "${htmlMetaDataAndStyle} ${reportOutput} </table></body></html>"
 publishHTML
([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true,
 reportDir
: "${pwd()}",
 reportFiles
: "testresultoverviewreport.html",
 reportName
: "TestresultOverviewReport"])
 
}

 
}
 
}
}

Daniel Jeznach

unread,
Oct 21, 2016, 3:44:04 AM10/21/16
to Jenkins Users
Hi,

I have similar problem as well, I noticed the exception today after upgrading Jenkins to 2.26, but problem with executing parallel tasks appeared earlier (probably after pipeline plugins upgrade).
I have too complex parallel delivery to paste here, but I tried to create other one, as simple as possible and it fails as well, making jenkins unusable.

Following code:

parallel one: {
    node('normal'){
        echo 'one'
    }
}, two: {
    node('heavy'){
        echo 'two'
    }
}


results in:

[Pipeline] parallel
[Pipeline] [one] { (Branch: one)
[Pipeline] [two] { (Branch: two)
[Pipeline] [one] node
[one] Running on N-escloc19_2-5e15cc49-8 in /ephemeral/jenkins_test/workspace/vartest
[Pipeline] [two] node
[Pipeline] [two] // node
[Pipeline] [two] }
[two] Failed in branch two
[Pipeline] [one] {
[Pipeline] [one] echo
[one] one
[Pipeline] [one] }
[Pipeline] [one] // node
[Pipeline] [one] }
[Pipeline] // parallel
[Pipeline] End of Pipeline
java.lang.IllegalStateException: cannot start writing logs to a finished node org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode[id=8]
	at org.jenkinsci.plugins.workflow.support.actions.LogActionImpl.<init>(LogActionImpl.java:110)
	at org.jenkinsci.plugins.workflow.support.actions.LogActionImpl.stream(LogActionImpl.java:81)
	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:73)
	at org.jenkinsci.plugins.workflow.steps.StepDescriptor.checkContextAvailability(StepDescriptor.java:252)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:179)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16)
	at WorkflowScript.run(WorkflowScript:6)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:48)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE



Sven Finsterwalder

unread,
Oct 21, 2016, 4:21:44 AM10/21/16
to Jenkins Users
Update the

Pipeline Supporting APIs Plugin to 2.10 then it will work again.


Am Donnerstag, 20. Oktober 2016 22:36:22 UTC+2 schrieb ky...@kayak.com:

Daniel Jeznach

unread,
Oct 21, 2016, 6:23:47 AM10/21/16
to jenkins...@googlegroups.com
Upgrading plugin worked for me, but after update I have no textarea
where I can input pipeline script. Only option "Pipeline script from
SCM" works for me... :(
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/jTsPn0_39rU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/0e0244c5-65c7-4962-9221-bad8ada3d84e%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Quidquid Latine dictum sit, altum videtur.

ky...@kayak.com

unread,
Oct 21, 2016, 9:51:23 AM10/21/16
to Jenkins Users


On Friday, October 21, 2016 at 4:21:44 AM UTC-4, Sven Finsterwalder wrote:
Update the

Pipeline Supporting APIs Plugin to 2.10 then it will work again.


Thanks Sven.
How do I get Jenkins to see the 2.10 plugin?  I've tried restarting it but it still thinks the latest is 2.9?
 

Sven Finsterwalder

unread,
Oct 22, 2016, 2:27:58 AM10/22/16
to Jenkins Users
You have to click the button, "Check for update now" at the end in one tab of the plugin configuration side, i think it was the installed tab.
Reply all
Reply to author
Forward
0 new messages