Jenkins multijob show failed when all sub jobs succeed - jenkins

I have a multijob which has 6 child job. During test, I found that the multijob always show failed even all sub jobs succeed. The error message is:
Finished Build : 1.0.0.1 of Job : Sub_Job_6 with status : SUCCESS
FATAL: Channel "unknown": Remote call on JNLP4-connect connection from build_machine/10.224.113.202:51903 failed. The channel is closing down or has closed down
java.nio.channels.ClosedChannelException
at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:789)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on JNLP4-connect connection from build_machine/10.224.113.202:51903 failed. The channel is closing down or has closed down
at hudson.remoting.Channel.call(Channel.java:945)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:148)
at hudson.model.Run.execute(Run.java:1727)
at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:76)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

I found the root cause. One of my sub job is to power off, power on the build machine( a reboot actually). After reboot, Jenkins client will re-connect to Jenkins server. The server may think it's a new conversation, the old one has stopped with some exception. So the final result will show failed.
After I removed this sub job, the multijob showed success finally.

Related

Jenkins JNLP4-connect connection from xxx.xxx.xxx.xxx failed after the success of build procedure

I got a failure after all the build procedure were finished without any errors.
And I don't know why below error has occurred.
This error has marked the status of a job as a failure even all the tests were successfully finished.
FATAL: Remote call on JNLP4-connect connection from socautovm1.xxx.local/192.168.114.144:65033 failed
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from socautovm1.xxx.local/192.168.114.144:65033
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
at hudson.remoting.Channel.call(Channel.java:955)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1815)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
java.lang.NoClassDefFoundError: Could not initialize class hudson.slaves.SlaveComputer
at hudson.util.ProcessTree.get(ProcessTree.java:399)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1090)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1081)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
at java.lang.Thread.run(Unknown Source)
Caused: java.io.IOException: Remote call on JNLP4-connect connection from socautovm1.xxx.local/192.168.114.144:65033 failed
at hudson.remoting.Channel.call(Channel.java:961)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1815)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
It seems that the agent is down. Check in which node the job runs and check its status. You may need to restart the node or even free some space in order to get it back online if the current status is offline.
I restarted the jenkins agent service and it resolved the issue. (/service/jenkins-agent)
I was having a similar issue when trying to run a Job on Jenkins that fetches the list of containers on a Slave node.
Whenever I run the job I get the error below:
ERROR: Issue with creating launcher for agent Linux1(Docker). The agent is being disconnected
[EnvInject] - Loading node environment variables.
ERROR: SEVERE ERROR occurs
org.jenkinsci.lib.envinject.EnvInjectException: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on Linux1(Docker) failed. The channel is closing down or has closed down
Here's how I fixed it:
I simply restarted the Jenkins service on the main/master node.
For Windows servers:
Search for Services and then locate the Jenkins service and restart it.
For Linux servers:
You might need to use Systemd (sudo systemctl restart jenkins)
That's all.
I hope this helps

Jenkins - connection to slave lost - ClosedChannelException

Every now and then all the Jenkins jobs that are currently running on some of my Jenkins slaves fail for the following reason:
java.nio.channels.ClosedChannelException
at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:721)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Issue happens only on some slaves, so it's not a problem with the master, I think...
In Jenkins slave log I got this one:
JNLP agent connected from xxxx
Slave.jar version: 3.7
This is a Windows agent
just before slave SLAVE01 gets online ...
executing prepare script ...
setting up slave SLAVE01 ...
slave setup done.
Agent successfully connected and online
ERROR: Connection terminated
[8mha:////4JmhQISHGLISGlsTHOZXEPbCK6pxtJiroBix+jLdfCfh/YKcSsnpDAAAAVx+LCAAAAAAAA98nsLuhNKKmjNKU4P08vOT+vODjuha&SHllHSE4tKMnMz/PLL0mV3NWzufebKBsTA0NFEYMUmgZnCA1SyAABjKpSSsdxNaiYAAAAA==[0mjava.nio.channels.ClosedChannelException
at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:721)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
In slave's windows event log I got the following records:
SLAVE01 7031 Error Microsoft-Windows-Service Control Manager System 27-03-2018 06:32:05 The Jenkins agent (jenkinsslave-c__jenkins) service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 0 milliseconds: Restart the service.
SLAVE01 0 Warning jenkinsslave-c__jenkins Application 27-03-2018 06:32:05 Child process [596 - C:\Program Files\Java\jre1.8.0_162\bin\java.exe -Xrs -jar "c:\jenkins\slave.jar" -jnlpUrl http://master:1234/computer/SLAVE01/slave-agent.jnlp -secret 8b64b1c4c643a36587dfaa4bf106b9099ad1c5cd8f12333a4f2fa518363aa250] finished with -1
SLAVE01 0 Warning jenkinsslave-c__jenkins Application 27-03-2018 06:31:53 SIGINT to 3552 failed - Killing as fallback
SLAVE01 0 Warning jenkinsslave-c__jenkins Application 27-03-2018 06:31:52 SIGINT to 2308 failed - Killing as fallback
Any ideas what is going on?

IOException Upload to Artifactory from Jenkins Slave

Trying to upload artifacts to Artifactory from a Slave agent but getting the following exception.
Jenkins Artifactory Plugin version: 2.9.1
For pattern: Installer-(*).exe 1 artifacts were found.
Deploying artifact: https://*********/artifactory/****/0.0.0.0.zip
ERROR: remote file operation failed: d:\j\workspace\Test at hudson.remoting.Channel#ab91c59:JNLP4-connect connection from 2.38.60.62/2.38.60.62:59447: java.io.IOException: Failed to deploy file. Status code: 502
java.io.IOException: remote file operation failed: d:\j\workspace\Test at hudson.remoting.Channel#ab91c59:JNLP4-connect connection from 2.38.60.62/2.38.60.62:59447: java.io.IOException: Failed to deploy file. Status code: 502
at hudson.FilePath.act(FilePath.java:992)
at hudson.FilePath.act(FilePath.java:974)
at org.jfrog.hudson.generic.GenericArtifactsDeployer.deploy(GenericArtifactsDeployer.java:76)
at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator$1.tearDown(ArtifactoryGenericConfigurator.java:392)
at hudson.model.Build$BuildExecution.doRun(Build.java:174)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Caused by: java.io.IOException: Failed to deploy file. Status code: 502
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:565)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:278)
at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:217)
at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:189)
at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:130)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2731)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:94)
at java.lang.Thread.run(Unknown Source)
at ......remote call to JNLP4-connect connection from 2.38.60.62/2.38.60.62:59447(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1537)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:822)
at hudson.FilePath.act(FilePath.java:985)
... 9 more
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE`
I have turned off Agent->Master Access Control, opened up all ports in firewall but still getting the same error.
Thank you.
Ok, here's what I did.
I configured the job again to upload from master and it failed. However, it provided me the correct exception. The reason was that the user account I was using didn't have write access to that repo.
Once I added required permissions, I was able to upload from slave.

How to prevent Jenkins from resuming an aborted job

I had aborted a job by clicking the [x] button next to it's name in the Build Executor Status panel of Jenkins, yet the job is still present and waiting.
Even when I restart Jenkins it will resume building. When I take a look at the console I see:
Sending interrupt signal to process Click here to forcibly terminate
running steps java.io.IOException: Aborting build at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at Script1.run(Script1.groovy:1) at
groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) [SNIP]
Finished: ABORTED Resuming build at Tue Oct 25 14:56:36 CDT 2016 after
Jenkins restart
I believe this version of my Pipeline script also included an "Input" block, it's possible the job was aborted as it was waiting for Input if that makes a difference
I clean these up by going Manage Jenkins -> Script Console and then putting in code like this:
Jenkins.instance.getItemByFullName(
"tpr-ereg")
.getBuildByNumber(24).
finish(hudson.model.Result.ABORTED,
new java.io.IOException("Aborting build"));
NOTE: the above may need to be all on one line in the Script Console

Jenkins slave job fails after successful job

I have 2 jenkins servers because my 2 builds have some incompatible system requirements.
I setup a new node for one of the servers and migrated the jobs from the other server and set them up to run on the node.
The node runs the job just fine and even archives the artifacts (they are linked from the job) but the job throws and exception and gets marked as a failure.
** Below is the output from the jobs **
Completed build, now archiving <-- I print this out at the end of my last build step
FATAL: Remote call on ops-1-jenkins-android-10-186.fam.io failed
java.io.IOException: Remote call on ops-1-jenkins-android-10-186.fam.io failed
at hudson.remoting.Channel.call(Channel.java:748)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:940)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:556)
at hudson.model.Run.execute(Run.java:1745)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class hudson.slaves.SlaveComputer
at hudson.util.ProcessTree.getKillers(ProcessTree.java:151)
at hudson.util.ProcessTree$OSProcess.killByKiller(ProcessTree.java:212)
at hudson.util.ProcessTree$UnixProcess.kill(ProcessTree.java:557)
at hudson.util.ProcessTree$UnixProcess.killRecursively(ProcessTree.java:564)
at hudson.util.ProcessTree$Unix.killAll(ProcessTree.java:488)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:952)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:943)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Thread.java:701)
Thanks Lovato!
After I updated all the plugins and jenkins things worked just fine.
We got this error: FATAL: java.io.IOException: Remote call on pm_jenprodslave_1 failed. We found the slave server was unresponsive and had to reboot it. Once it came back the build works again.

Resources