搭建Jenkins后,添加节点报错,花了半个下午,记录一下:
报错内容
java.io.IOException: error=0, Failed to exec spawn helper: pid: 83002, exit value: 127
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:314)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
Also: hudson.remoting.Channel C a l l S i t e S t a c k T r a c e : R e m o t e c a l l t o 10.16.10.4 a t h u d s o n . r e m o t i n g . C h a n n e l . a t t a c h C a l l S i t e S t a c k T r a c e ( C h a n n e l . j a v a : 1923 ) a t h u d s o n . r e m o t i n g . U s e r R e q u e s t CallSiteStackTrace: Remote call to 10.16.10.4 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1923) at hudson.remoting.UserRequest CallSiteStackTrace:Remotecallto10.16.10.4athudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1923)athudson.remoting.UserRequestExceptionResponse.retrieve(UserRequest.java:384)
at hudson.remoting.Channel.call(Channel.java:1112)
at hudson.Launcher R e m o t e L a u n c h e r . l a u n c h ( L a u n c h e r . j a v a : 1121 ) a t h u d s o n . L a u n c h e r RemoteLauncher.launch(Launcher.java:1121) at hudson.Launcher RemoteLauncher.launch(Launcher.java:1121)athudson.LauncherProcStarter.start(Launcher.java:506)
at PluginClassLoader for durable-task//org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:180)
发现添加其他节点测试后都没问题,添加本地服务器节点出现上述问题。
思路就聚焦的这个节点的启动脚本(节点启动用的是remoting.jar),和其他节点部署时没区别。
就报错内容查询帖子,发现本地启动可能存在启动参数上的区别,于是再节点启动的参数上加了
-Djdk.lang.Process.launchMechanism=vfork
成了