问题描述:  在jenkins slave上提交任何一个job都会failed,即使job什么都不执行, 而且此时jenkins node是正常connet的, 没有任何问题,但是一执行job就失败。失败 log的信息如下:

[EnvInject] - Loading node environment variables.
ERROR: SEVERE ERROR occurs
org.jenkinsci.lib.envinject.EnvInjectException: java.io.InvalidClassException: org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader$1; local class incompatible: stream classdesc serialVersionUID = -2630906866550529145, local class serialVersionUID = -2721064306957331564
	at org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvVarsForNode(EnvironmentVariablesNodeLoader.java:95)
	at org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:80)
	at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:43)
	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:572)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:492)
	at hudson.model.Run.execute(Run.java:1735)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:405)
Caused by: java.io.InvalidClassException: org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader$1; local class incompatible: stream classdesc serialVersionUID = -2630906866550529145, local class serialVersionUID = -2721064306957331564
	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:702)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1705)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1600)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1875)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1432)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
	at hudson.remoting.UserRequest.deserialize(UserRequest.java:217)
	at hudson.remoting.UserRequest.perform(UserRequest.java:131)
	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
	at hudson.remoting.Request$2.run(Request.java:332)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(FutureTask.java:277)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at hudson.remoting.Engine$1$1.run(Engine.java:85)
	at java.lang.Thread.run(Thread.java:785)
	at ......remote call to Channel to /9.111.111.21(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 hudson.FilePath.act(FilePath.java:1081)
	at org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvVarsForNode(EnvironmentVariablesNodeLoader.java:64)
	... 8 more
Finished: FAILURE

原因:

安装jenkins agent需要先安装java 8, 这个失败是因为安装的java 版本有问题。 所以需要确保你的java 8的版本安装没问题。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐