当前位置: 首页 > 知识库问答 >
问题:

maven超时:套接字关闭/Sonarqube服务器:无法读取文件部分

苏建安
2023-03-14

我们在gitlab ci构建中使用Sonarqube进行代码分析,现在我们在使用mvn clean org时遇到了问题。jacoco:jacocomaven插件:准备代理安装-Dmaven。测验失败ignore=true-DskipTests sonar:sonar要运行gitlab管道,管道中的错误与问题Jenkins/sonar timeout:Socket closed相同。

sonarqube版本6.3.1;maven版本:3.2.1;sonar-maven-plugin:3.0.2

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project ***: Fail to request http://***:9000/api/ce/submit?projectKey=***:***&projectName=***: timeout: Socket closed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project ***: Fail to request http://***:9000/api/ce/submit?projectKey=***:***&projectName=***
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to request http://***:9000/api/ce/submit?projectKey=***:***&projectName=***
    at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.IllegalStateException: Fail to request http://***:9000/api/ce/submit?projectKey=***:***&projectName=***
    at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:177)
    at org.sonarqube.ws.client.HttpConnector.post(HttpConnector.java:144)
    at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:104)
    at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:73)
    at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:177)
    at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:131)
    at org.sonar.scanner.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:72)
    at org.sonar.scanner.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:54)
    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:175)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:262)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:257)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:247)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
    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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy24.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
    ... 22 more
Caused by: java.net.SocketTimeoutException: timeout
    at okio.Okio$3.newTimeoutException(Okio.java:212)
    at okio.AsyncTimeout.exit(AsyncTimeout.java:288)
    at okio.AsyncTimeout$1.write(AsyncTimeout.java:184)
    at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
    at okio.RealBufferedSink.write(RealBufferedSink.java:41)
    at okhttp3.internal.http.Http1xStream$FixedLengthSink.write(Http1xStream.java:286)
    at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
    at okio.RealBufferedSink.writeAll(RealBufferedSink.java:99)
    at okhttp3.RequestBody$3.writeTo(RequestBody.java:118)
    at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.java:171)
    at okhttp3.MultipartBody.writeTo(MultipartBody.java:113)
    at okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:756)
    at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:613)
    at okhttp3.RealCall.getResponse(RealCall.java:244)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201)
    at org.sonarqube.ws.client.OkHttpClientBuilder.completeHeaders(OkHttpClientBuilder.java:183)
    at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
    at okhttp3.RealCall.execute(RealCall.java:57)
    at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:174)
    ... 54 more
Caused by: java.net.SocketException: Socket closed
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at okio.Okio$1.write(Okio.java:80)
    at okio.AsyncTimeout$1.write(AsyncTimeout.java:180)
    ... 71 more

我的sonarqube服务器已经撤回了帖子请求并抛出一个异常:

java.lang.IllegalStateException: Can't read file part
        at org.sonar.server.ws.ServletRequest.readPart(ServletRequest.java:102)
        at org.sonar.server.ws.ServletRequest.readInputStreamParam(ServletRequest.java:85)
        at org.sonar.api.server.ws.internal.ValidatingRequest.paramAsInputStream(ValidatingRequest.java:86)
        at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:100)
        at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:103)
        at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:85)
        at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:126)
        at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:76)
        at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:63)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:72)
        at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:60)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException
        at org.apache.catalina.connector.Request.parseParts(Request.java:2874)
        at org.apache.catalina.connector.Request.parseParameters(Request.java:3177)
        at org.apache.catalina.connector.Request.getParameter(Request.java:1110)
        at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)
        at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:153)
        at org.sonar.server.ws.ServletRequest.readParam(ServletRequest.java:74)
        at org.sonar.api.server.ws.internal.ValidatingRequest.readParamOrDefaultValue(ValidatingRequest.java:143)
        at org.sonar.api.server.ws.internal.ValidatingRequest.param(ValidatingRequest.java:98)
        at org.sonar.api.server.ws.internal.ValidatingRequest.param(ValidatingRequest.java:70)
        at org.sonar.api.server.ws.Request.getParam(Request.java:310)
        at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:92)
        ... 42 common frames omitted
Caused by: org.apache.tomcat.util.http.fileupload.FileUploadException: null
        at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:308)
        at org.apache.catalina.connector.Request.parseParts(Request.java:2801)
        ... 52 common frames omitted
Caused by: java.net.SocketTimeoutException: null
        at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:201)
        at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:235)
        at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:216)
        at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1212)
        at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1161)
        at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:712)
        at org.apache.coyote.http11.Http11InputBuffer.access$300(Http11InputBuffer.java:40)
        at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1061)
        at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:139)
        at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:256)
        at org.apache.coyote.Request.doRead(Request.java:540)
        at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:319)
        at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:627)
        at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:342)
        at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:183)
        at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)
        at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:881)
        at java.io.InputStream.read(InputStream.java:101)
        at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:98)
        at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:68)
        at org.apache.tomcat.util.http.fileupload.MultipartStream.readBodyData(MultipartStream.java:571)
        at org.apache.tomcat.util.http.fileupload.MultipartStream.discardBodyData(MultipartStream.java:595)
        at org.apache.tomcat.util.http.fileupload.MultipartStream.skipPreamble(MultipartStream.java:613)
        at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:874)
        at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:854)
        at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:256)
        at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:280)
        ... 53 common frames omitted

共有1个答案

东方和惬
2023-03-14

实际上,运行程序和服务器之间存在一些网络问题。更改网络环境后,问题本身得到解决。

 类似资料:
  • 我有java服务器和只有一个客户端的时间。 客户端连接并发送卡ID(在服务器端阻止读取是合适的,因为当时只有一个客户端)

  • 这是来自.properties得my DB配置: 这是config.xml: 实际上,我可以很容易地访问我们的本地web应用程序,并且可以在日志中看到到DB的连接跟踪,但对于批处理来说,情况并非如此。 在我有了这个之后: 有人帮忙吗?

  • 请参阅下面的代码: 当程序启动时,我使用telnet连接localhost:8888,3秒后,服务器会杀死我,但当我使用netstat观看时,套接字状态仍然是ESTABLISHED。如果我删除了File()函数,套接字可以正常关闭。我怎样才能解决这个问题?

  • 我想把我的Android设备(Android4.2.2)与BluetothAdapter创建的另一个Android设备配对。startDiscovery()。我在运行BluetoothDevice时发现了什么。connect()请求配对开始。但我在运行connect()时遇到了问题 我在中尝试了impliment fallback和gatclass方法 IOException:读取失败,套接字可能

  • 问题内容: 我敢肯定这是一个简单的问题,但是我不知道socket.io文档在哪里,而http://labs.learnboost.com/socket.io/上的文档并没有真正的帮助。 假设我有一个socket.io http服务器,并写了一个网站来连接它。 我如何为服务器提供保护,以使未经授权的人(未通过网站连接的人)被阻止/丢弃/禁止。 如何在服务器端结束套接字连接?所以如果我有 如何结束套接

  • 我在netty server应用程序中面临资源问题。 无法看到与Netstat的任何打开或挂起的连接... 我使用ReadTimeoutHandler关闭未使用的连接,并使用以下exceptionHandler代码: 服务器引导程序如下所示: 更新2:根据请求,我将日志处理程序移到ReadTimeouthandler前面,以下是日志。客户端通常断开连接的情况: 客户端不断开连接的情况: 所以收盘前