Jenkins Windows worker fails first build with ClosedChannelException - jenkins

I have a self-provisioned Jenkins setup using vSphere cloud, where workers are cloned from previously built templates on demand. Everything is working smooth except for Windows workers. When I start a job which uses Windows node and there is none available, Jenkins creates one to run the job (it takes a 2 or 3 mins) but then fails on the checkout scm step, which gives following output:
> git fetch --no-tags --force --progress -- <repo> +refs/heads/master:refs/remotes/origin/master # timeout=10
12:58:50 [Pipeline] cleanWs
12:58:50 jenkins-windows-2019-worker1 was marked offline: Connection was broken: java.nio.channels.ClosedChannelException
12:58:50 at jenkins.agents.WebSocketAgents$Session.closed(WebSocketAgents.java:144)
12:58:50 at jenkins.websocket.WebSocketSession.onWebSocketSomething(WebSocketSession.java:91)
12:58:50 at com.sun.proxy.$Proxy129.onWebSocketClose(Unknown Source)
12:58:50 at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onClose(JettyListenerEventDriver.java:149)
12:58:50 at org.eclipse.jetty.websocket.common.WebSocketSession.callApplicationOnClose(WebSocketSession.java:394)
12:58:50 at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:225)
12:58:50 at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher.onCompleteFailure(AbstractWebSocketConnection.java:100)
12:58:50 at org.eclipse.jetty.util.IteratingCallback.failed(IteratingCallback.java:402)
12:58:50 at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:302)
12:58:50 at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381)
12:58:50 at org.eclipse.jetty.websocket.common.io.FrameFlusher.flush(FrameFlusher.java:264)
12:58:50 at org.eclipse.jetty.websocket.common.io.FrameFlusher.process(FrameFlusher.java:193)
12:58:50 at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
12:58:50 at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
12:58:50 at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:581)
12:58:50 at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:181)
12:58:50 at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:510)
12:58:50 at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:440)
12:58:50 at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
12:58:50 at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
12:58:50 at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
12:58:50 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
12:58:50 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
12:58:50 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
12:58:50 at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
12:58:50 at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
12:58:50 at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
12:58:50 at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
12:58:50 at java.base/java.lang.Thread.run(Thread.java:829)
12:58:50 org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException: Unable to create live FilePath for jenkins-windows-2019-worker1
12:58:50 at org.jenkinsci.plugins.workflow.support.steps.FilePathDynamicContext.get(FilePathDynamicContext.java:66)
12:58:50 at org.jenkinsci.plugins.workflow.support.steps.FilePathDynamicContext.get(FilePathDynamicContext.java:48)
12:58:50 at org.jenkinsci.plugins.workflow.steps.DynamicContext$Typed.get(DynamicContext.java:95)
12:58:50 at org.jenkinsci.plugins.workflow.cps.ContextVariableSet.get(ContextVariableSet.java:139)
12:58:50 at org.jenkinsci.plugins.workflow.cps.CpsThread.getContextVariable(CpsThread.java:137)
12:58:50 at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:298)
12:58:50 at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75)
12:58:50 at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:83)
12:58:50 at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71)
12:58:50 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
12:58:50 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
12:58:50 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
12:58:50 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
12:58:50 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
12:58:50 at java.base/java.lang.Thread.run(Thread.java:829)
Interesting thing is that I can replay the job and it will succeed on the same worker - only the first job on given Windows worker instance will fail.
Jenkins worker is started as Windows service using New-Service cmdlet. The service runs following command: java -Xmx6g -jar C:\jenkins-worker\agent.jar -jnlpUrl <jnlpUrl> -secret <secret>.
Linux workers are fine while having the same env (same network, same vCenter etc.)
I've tried updating Java versions to exactly match up to minor version - no result. Adding sleep before checkout scm solves the issue but is very dirty.

Related

Jenkins Pipepline is failing: Remote call on JNLP4-connect connection from XXX failed

My Jenkins pipeline is failing while checking out from svn. Below is the error.
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from nobuild01.sdi.pvt/152.144.34.14:50396
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.FilePath.act(FilePath.java:1036)
at hudson.FilePath.act(FilePath.java:1025)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:928)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:864)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.NoClassDefFoundError: Could not initialize class jenkins.model.Jenkins
at hudson.scm.SubversionSCM.descriptor(SubversionSCM.java:2584)
at hudson.scm.SubversionSCM.createDefaultSVNOptions(SubversionSCM.java:1085)
at hudson.scm.SubversionSCM.createClientManager(SubversionSCM.java:1075)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1002)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:979)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2918)
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(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
at java.lang.Thread.run(Thread.java:745)
Caused: java.io.IOException: Remote call on JNLP4-connect connection from nobuild01.sdi.pvt/152.144.219.14:50396 failed
at hudson.remoting.Channel.call(Channel.java:961)
at hudson.FilePath.act(FilePath.java:1036)
Caused: java.io.IOException: remote file operation failed: c:\Dev at hudson.remoting.Channel#4b1b30ed:JNLP4-connect connection from nobuild01.sdi.pvt/152.144.34.14:50396
at hudson.FilePath.act(FilePath.java:1043)
at hudson.FilePath.act(FilePath.java:1025)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:928)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:864)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Slave machine is running on openJDK, not Oracle java. so I used IcedTea to run .jnlp.
I checked my Jenkins service is running.
openjdkverion: java-1.8.0-openjdk-1.8.0.91-3
Also someone guild me where I can see the Jenkins log. I am running Jenkins master as a Docker container.
For Windows, go to Services (Start → Run: services.msc), find Jenkins and Jenkins Agent, right click → Restart.
If it does not help (UI is not responding) open the Windows Task Manager → Processes, kill the java.exe process, and restart the service once again.
ps -ef | grep jenkins
sudo kill -9 <pid>
This could be due to refSpec configuration on jenkins. In Source Code management, provide the SSH, github/any other git REPO URL .
Tap on Advanced Button and provide "refs/pull/:refs/remotes/origin/pr/" in RefSpec
In above configuration bold content might be creating problem, please remove and restart your jenkins.
In my case this solved problem for me.

java.io.IOException: Can't find allure commandline <null>

My Jenkins master system is linux and slave system is windows.
I have set the allure commandline path in Global tool configuration and slave configuration, but when I run the job, I'm getting following error:
ERROR: Step ‘Allure Report’ aborted due to exception:
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from ip/ip:port
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
at hudson.remoting.Channel.call(Channel.java:908)
at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation.getMajorVersion(AllureCommandlineInstallation.java:58)
at ru.yandex.qatools.allure.jenkins.ReportBuilder.build(ReportBuilder.java:44)
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:298)
at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:223)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1073)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1749)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
java.io.IOException: Can't find allure commandline <null>
at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$2.call(AllureCommandlineInstallation.java:63)
at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$2.call(AllureCommandlineInstallation.java:58)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
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$1.run(Engine.java:98)
at java.lang.Thread.run(Unknown Source)
Finished: FAILURE
my question is resolved by #vipinnambiar' answer,Thanks very much!
"On the agent configuration setting,set the Allure installation home directory(without the "bin") should resolve this issue. That worked for me."--#vipinnambiar
enter image description here

UnsatisfiedLinkError and JNLP4-connect problem from docker.push in Jenkins

While trying to run a docker.push on a ppc64le Jenkins slave called by an x86 Jenkins master, the following error occurs.
Remote call to JNLP4-connect connection from /
java.lang.UnsatisfiedLinkError: /tmp/libnetty-transport-native-epoll3535546627560640699.so: /tmp/libnetty-transport-native-epoll3535546627560640699.so: cannot open shared object file: No such file or directory (Possible cause: can’t load AMD 64-bit .so on a Power PC 64-bit platform
Whole log
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from IP1/IP2:PORT
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 org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils.getImageIdFromAgent(DockerAgentUtils.java:303)
at org.jfrog.hudson.pipeline.steps.DockerPushStep$Execution.run(DockerPushStep.java:122)
at org.jfrog.hudson.pipeline.steps.DockerPushStep$Execution.run(DockerPushStep.java:86)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.UnsatisfiedLinkError: /tmp/libnetty-transport-native-epoll3535546627560640699.so: /tmp/libnetty-transport-native-epoll3535546627560640699.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64-bit .so on a Power PC 64-bit platform)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:214)
at io.netty.channel.epoll.Native.loadNativeLibrary(Native.java:269)
at io.netty.channel.epoll.Native.<clinit>(Native.java:64)
at io.netty.channel.epoll.IovArray.<clinit>(IovArray.java:57)
at io.netty.channel.epoll.EpollEventLoop.<init>(EpollEventLoop.java:62)
at io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:130)
at io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:35)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:58)
at io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:100)
at io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:87)
at io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:64)
at com.github.dockerjava.netty.NettyDockerCmdExecFactory$UnixDomainSocketInitializer.init(NettyDockerCmdExecFactory.java:220)
at com.github.dockerjava.netty.NettyDockerCmdExecFactory.init(NettyDockerCmdExecFactory.java:196)
at com.github.dockerjava.core.DockerClientImpl.withDockerCmdExecFactory(DockerClientImpl.java:161)
at com.github.dockerjava.core.DockerClientBuilder.build(DockerClientBuilder.java:45)
at org.jfrog.hudson.pipeline.docker.utils.DockerUtils.getDockerClient(DockerUtils.java:326)
at org.jfrog.hudson.pipeline.docker.utils.DockerUtils.getImageIdFromTag(DockerUtils.java:37)
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$6.call(DockerAgentUtils.java:305)
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$6.call(DockerAgentUtils.java:303)
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(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
Caused: java.io.IOException: Remote call on JNLP4-connect connection from IP1/IP2:PORT failed
at hudson.remoting.Channel.call(Channel.java:961)
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils.getImageIdFromAgent(DockerAgentUtils.java:303)
at org.jfrog.hudson.pipeline.steps.DockerPushStep$Execution.run(DockerPushStep.java:122)
at org.jfrog.hudson.pipeline.steps.DockerPushStep$Execution.run(DockerPushStep.java:86)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE
A workaround is not to use the syntax provided in Jenkins and just wrap docker commands inside sh.
sh """
docker build . -t ${imageTag}
docker push ${imageTag}
"""

Jenkins - Gitlab Integration Issue

I am trying to integrate Jenkins ver. 2.89.4 with Gitlab 1.5.3
I have entered my Gitlab host URL and
API Token for accessing Gitlab.
But, when I click test connection, i get the following exception trace:
Any help will be appreciate.
java.util.NoSuchElementException: no client-builder found that supports server at https://gitlab.com/tom/abc.git
at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetectOrDie(AutodetectingGitLabClient.java:271)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
Caused: javax.servlet.ServletException
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:765)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The problem was resolved by the root URL https://gitlab.com and the API Token in the :
Jenkins > configuration > GitLab connections > Gitlab host URL
Jenkins > configuration > GitLab connections > Credentials
I had to create an API from the GitLab repo site. which was applied to Jenkins via :
Jenkins > Credentials > Systems

Jenkins Pipeline 'checkout scm' Fails on Specific Node

This is a tale of two Jenkins nodes.
I'm seeing a strange error during the Jenkins checkout scm stage after the initial Jenkinsfile checkout and node selection on one of my two nodes.
For one particular node, Jenkins is omitting the "git" command in "git init" which expectedly fails the build.
What I see on the failing node is this:
> init /home/hudson/build/workspace/androidplatform_pipeline # timeout=10
On my working node, running the exact same pipeline script, I see this:
> git init /home/hudson/build/workspace/androidplatform_pipeline # timeout=10
Both of my nodes are Amazon EC2 instances, so I tried deleting the failing one and replacing it with a clone of the working one, but the "git" command is still being omitted.
Here are the relevant specs:
Jenkins ver: 2.46.3
Git client plugin: 2.4.6
Git plugin: 3.3.0
Pipeline: 2.5
Pipeline: SCM Step: 2.4
Console out (with redactions):
[Pipeline] checkout
Cloning the remote Git repository
Cloning repository https://stash.*******/androidplatform.git
> init /home/hudson/build/workspace/androidplatform_pipeline # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /home/hudson/build/workspace/androidplatform_pipeline
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:696)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:497)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
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(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)
at ......remote call to andy-11-dc-big-replace(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:830)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor479.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy94.execute(Unknown Source)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1067)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1107)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
at
org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:260)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
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)
Caused by: hudson.plugins.git.GitException: Error performing command: init /home/hudson/build/workspace/androidplatform_pipeline
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1910)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1871)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1867)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1512)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:694)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:497)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
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)
... 4 more
Caused by: java.io.IOException: Cannot run program "" (in directory "/home/hudson/build/workspace/androidplatform_pipeline"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:245)
at hudson.Proc$LocalProc.<init>(Proc.java:214)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:846)
at hudson.Launcher$ProcStarter.start(Launcher.java:384)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1899)
... 15 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 20 more
[Pipeline] }
[Pipeline] // wrap
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
groovy.lang.MissingPropertyException: No such property: utils for class: WorkflowScript
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)
at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:243)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:52)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:308)
at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:28)
at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
at WorkflowScript.notifyStash(WorkflowScript:139)
at WorkflowScript.handleBuildFailure(WorkflowScript:143)
at WorkflowScript.run(WorkflowScript:11)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
at sun.reflect.GeneratedMethodAccessor466.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:173)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
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
I'm at a loss. Also I've had trouble constructing a useful search query for this issue.
Thanks for the help all.
You could try cleaning your workspace prior to the checkout.
Add this stage before your checkout stage
stage('Clean workspace') {
deleteDir()
sh 'ls -lah'
}
The deleteDir() cleans the workspace folder, also the .git files.
And the sh 'ls -lah' logs the contents of the workspace folder to see if everything is gone, you could skip that. Only works on Linux of course
It turns out the problem was with the Jenkins Node Configuration.
See here: https://issues.jenkins-ci.org/browse/JENKINS-44901
I fixed the problem by navigating to Manage Jenkins -> Manage Nodes and then clicking on the gear icon next to the misbehaving node. Under the Node Properties section, there was an empty git field probably added erroneously. Deleting that empty field solved the issue. Thanks everyone for the help.

Resources