我正在尝试设置使用Jenkins文件的Jenkins multibranch管道。 我配置的项目是使用gradle构建的,在jenkins文件中,我有以下代码段
stage('build')
sh "./gradlew build --stacktrace"
每次运行构建时,它总是会失败并出现以下错误。我试图禁用gradle守护程序,但它一直显示相同的错误。
FAILURE: Build failed with an exception.
* What went wrong:
Could not receive a message from the daemon.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.launcher.daemon.client.DaemonConnectionException: Could not receive a message from the daemon.
at org.gradle.launcher.daemon.client.DaemonClientConnection.receive(DaemonClientConnection.java:81)
at org.gradle.launcher.daemon.client.DaemonClientConnection.receive(DaemonClientConnection.java:35)
at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:210)
at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:178)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:141)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:92)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:285)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:258)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:251)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:185)
at org.gradle.launcher.Main.doAction(Main.java:36)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
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:498)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
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:498)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.internal.remote.internal.RecoverableMessageIOException: Could not read message from '/127.0.0.1:33449'.
at org.gradle.internal.remote.internal.inet.SocketConnection.receive(SocketConnection.java:86)
at org.gradle.launcher.daemon.client.DaemonClientConnection.receive(DaemonClientConnection.java:75)
... 29 more
Caused by: java.io.StreamCorruptedException: invalid stream header: ED000573
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
at org.gradle.internal.io.ClassLoaderObjectInputStream.<init>(ClassLoaderObjectInputStream.java:27)
at org.gradle.internal.serialize.ExceptionReplacingObjectInputStream.<init>(ExceptionReplacingObjectInputStream.java:39)
at org.gradle.internal.serialize.Message.receive(Message.java:54)
at org.gradle.internal.serialize.BaseSerializerFactory$ThrowableSerializer.read(BaseSerializerFactory.java:240)
at org.gradle.internal.serialize.BaseSerializerFactory$ThrowableSerializer.read(BaseSerializerFactory.java:238)
at org.gradle.internal.logging.serializer.LogEventSerializer.read(LogEventSerializer.java:56)
at org.gradle.internal.logging.serializer.LogEventSerializer.read(LogEventSerializer.java:26)
at org.gradle.internal.serialize.DefaultSerializerRegistry$TaggedTypeSerializer.read(DefaultSerializerRegistry.java:144)
at org.gradle.launcher.daemon.protocol.DaemonMessageSerializer$OutputMessageSerializer.read(DaemonMessageSerializer.java:147)
at org.gradle.launcher.daemon.protocol.DaemonMessageSerializer$OutputMessageSerializer.read(DaemonMessageSerializer.java:133)
at org.gradle.internal.serialize.DefaultSerializerRegistry$TaggedTypeSerializer.read(DefaultSerializerRegistry.java:144)
at org.gradle.internal.serialize.Serializers$StatefulSerializerAdapter$1.read(Serializers.java:36)
at org.gradle.internal.remote.internal.inet.SocketConnection.receive(SocketConnection.java:79)
... 30 more
答案 0 :(得分:0)
全部:哪个gradle版本(我从4.7升级到4.9后得到了此版本,但是您的帖子要早得多)
请尝试在没有守护程序的情况下进行构建,即
sh "./gradlew --no-daemon build -s"
这应该指出什么是错误原因,通常(我的观察)是在(自定义)插件或初始化阶段(buildSrc)的脚本中引发了错误
答案 1 :(得分:0)
您的移动热点是否已启用?如果您使用Windows 10移动热点,则会在我的计算机中导致该错误,请禁用并尝试该错误,然后正常运行。