0

环境:
Jenkins Server (Linux)
Senkins slave agent (Windows)
构建:Gradle
项目:EasyB,Selenium,Groovy

我在尝试编译我的 easyB + selenium 项目时遇到编译错误。我们使用 gradle 来管理项目。

这些项目在本地桌面上编译得很好,但是当我们尝试通过 Jenkins 作业编译它时失败 - 使用 Windows 从代理,它会引发编译错误。错误有点神秘 -java.net.SocketException: Unrecognized Windows Sockets error: 10106: socket

Grails 用户报告了一个类似的问题——他们将其归因于端口的过度使用。但是在这种情况下就不能这样吗?

我想知道 Gradle 是否正在尝试下载东西?但这也没有多大意义——因为编译运行良好——如果我在直接登录到 Windows 从代理机器时运行它。

编译错误

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileGroovy'.
         at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
         at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
         at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
         at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
         at org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200)
         at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172)
         at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
         at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:137)
         at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
         at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
         at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
         at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
         at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
         at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
         at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
         at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
         at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247)
         at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
         at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
         at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
         at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
         at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
         at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
         at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
         at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
         at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)
         at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)
         at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109)
         at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:129)
         at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
         at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
         at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
         at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
         at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
         at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
         at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
         at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
         at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
         at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
         at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
         at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
         at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
         at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
         at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
         at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:30)
         at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:22)
         at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:200)
         at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:173)
         at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
         at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:138)
         at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
         at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
         at org.gradle.launcher.Main.doAction(Main.java:48)
         at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
         at org.gradle.launcher.Main.main(Main.java:39)
         at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
         at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
         at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: org.gradle.internal.UncheckedException: java.net.SocketException: Unrecognized Windows Sockets error: 10106: socket
         at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
         at org.gradle.messaging.remote.internal.inet.TcpIncomingConnector.accept(TcpIncomingConnector.java:66)
         at org.gradle.messaging.remote.internal.HandshakeIncomingConnector.accept(HandshakeIncomingConnector.java:45)
         at org.gradle.messaging.remote.internal.DefaultMultiChannelConnector.accept(DefaultMultiChannelConnector.java:57)
         at org.gradle.messaging.remote.internal.DefaultMessagingServer.accept(DefaultMessagingServer.java:43)
         at org.gradle.process.internal.DefaultWorkerProcessFactory$DefaultWorkerProcessBuilder.build(DefaultWorkerProcessFactory.java:77)
         at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager.startDaemon(CompilerDaemonManager.java:92)
         at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager.getDaemon(CompilerDaemonManager.java:52)
         at org.gradle.api.internal.tasks.compile.daemon.DaemonGroovyCompiler.execute(DaemonGroovyCompiler.java:47)
         at org.gradle.api.internal.tasks.compile.daemon.DaemonGroovyCompiler.execute(DaemonGroovyCompiler.java:34)
         at org.gradle.api.internal.tasks.compile.NormalizingGroovyCompiler.delegateAndHandleErrors(NormalizingGroovyCompiler.java:99)
         at org.gradle.api.internal.tasks.compile.NormalizingGroovyCompiler.execute(NormalizingGroovyCompiler.java:48)
         at org.gradle.api.internal.tasks.compile.NormalizingGroovyCompiler.execute(NormalizingGroovyCompiler.java:34)
         at org.gradle.api.internal.tasks.compile.DelegatingGroovyCompiler.execute(DelegatingGroovyCompiler.java:29)
         at org.gradle.api.internal.tasks.compile.DelegatingGroovyCompiler.execute(DelegatingGroovyCompiler.java:20)
         at org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport.execute(IncrementalJavaCompilerSupport.java:33)
         at org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport.execute(IncrementalJavaCompilerSupport.java:23)
         at org.gradle.api.tasks.compile.GroovyCompile.compile(GroovyCompile.java:77)
         at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196)
         at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102)
         at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:99)
         at org.gradle.api.tasks.compile.GroovyCompile_Decorated.invokeMethod(Unknown Source)
         at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
         at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:150)
         at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:145)
         at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:472)
         at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:461)
         at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
         ... 57 more
Caused by: java.net.SocketException: Unrecognized Windows Sockets error: 10106: socket
         at org.gradle.messaging.remote.internal.inet.TcpIncomingConnector.accept(TcpIncomingConnector.java:61)
         ... 83 more
4

1 回答 1

1

看起来该错误是WSAEPROVIDERFAILEDINIT错误。从链接:

服务提供者初始化失败。
无法加载或初始化请求的服务提供者。如果无法加载服务提供者的 DLL(LoadLibrary 失败)或提供者的 WSPStartup 或 NSPStartup 函数失败,则会返回此错误。

这可能是由于包装器启动了 Java,但没有接收到所有正确的环境变量

在 Sun 的 Java 站点(对于“10106”)进行快速搜索,发现了这个线程:“java.net.SocketException: Unrecognized Windows Sockets error: 10106: create”,位于http://forum.java.sun.com/thread。 jsp...线程ID=329241

该线程似乎表明您的“系统根”环境变量可能不正确,并且需要重置。或者,作为替代方案,您可以设置/选择“将环境附加到本机环境”

(请注意,该链接已失效,但此链接有效:Unrecognized Windows Sockets error: 10106: create

所以,我想看看 Jenkins 是如何启动的。

于 2013-06-17T19:05:23.473 回答