我安装了sonarqube 5.1并运行了许多微服务和软件包模块,但其中一个特别是让我无法忍受悲伤。它是一个适度大的maven项目,有大约3,300个java文件(好吧,我们有一些代码债务 - 谁知道?),但错误信息是完全不透明的。我正在连接到AWS RDS postgres db(9.3.5),并且通常通过我们的构建服务器TeamCity(9.0.3)调用maven。
构建日志中的错误是......
[07:24:07][net.ulfhedinn:Parent] [INFO] [15:19:55.114] Store results in database
[07:24:15][net.ulfhedinn:Parent] [INFO] [15:20:02.695] Analysis reports generated in 651ms, dir size=1 MB
[07:24:17][net.ulfhedinn:Parent] [INFO] [15:20:04.645] Analysis reports compressed in 1949ms, zip size=1 MB
[07:24:17][net.ulfhedinn:Parent] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project Parent: java.io.IOException: Error writing to server
错误(在postgres中)是......
2015-11-12 15:24:18 UTC:10.31.61.166(37212):sonar@sonar:[7800]:LOG: unexpected EOF on client connection with an open transaction
声纳服务器没有错误,只有200多个。
在调试模式下运行maven时,完整堆栈跟踪变为:
[17:24:58]W: [Step 2/2] [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project Parent: java.io.IOException: Error writing to server -> [Help 1]
[17:24:58] : [Step 2/2] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project Parent: java.io.IOException: Error writing to server
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[17:24:58] : [Step 2/2] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[17:24:58] : [Step 2/2] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[17:24:58] : [Step 2/2] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[17:24:58] : [Step 2/2] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[17:24:58] : [Step 2/2] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[17:24:58] : [Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[17:24:58] : [Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[17:24:58] : [Step 2/2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[17:24:58] : [Step 2/2] at java.lang.reflect.Method.invoke(Method.java:483)
[17:24:58] : [Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[17:24:58] : [Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[17:24:58] : [Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[17:24:58] : [Step 2/2] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[17:24:58] : [Step 2/2] Caused by: org.apache.maven.plugin.MojoExecutionException: java.io.IOException: Error writing to server
[17:24:58] : [Step 2/2] at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
[17:24:58] : [Step 2/2] at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:104)
[17:24:58] : [Step 2/2] at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:135)
[17:24:58] : [Step 2/2] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[17:24:58] : [Step 2/2] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[17:24:58] : [Step 2/2] ... 19 more
[17:24:58] : [Step 2/2] Caused by: com.github.kevinsawicki.http.HttpRequest$HttpRequestException: java.io.IOException: Error writing to server
[17:24:58] : [Step 2/2] at com.github.kevinsawicki.http.HttpRequest.code(HttpRequest.java:1483)
[17:24:58] : [Step 2/2] at com.github.kevinsawicki.http.HttpRequest.ok(HttpRequest.java:1508)
[17:24:58] : [Step 2/2] at org.sonar.batch.report.PublishReportJob.uploadMultiPartReport(PublishReportJob.java:122)
[17:24:58] : [Step 2/2] at org.sonar.batch.report.PublishReportJob.execute(PublishReportJob.java:77)
[17:24:58] : [Step 2/2] at org.sonar.batch.phases.DatabaseModePhaseExecutor.publishReportJob(DatabaseModePhaseExecutor.java:188)
[17:24:58] : [Step 2/2] at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:134)
[17:24:58] : [Step 2/2] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
[17:24:58] : [Step 2/2] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
[17:24:58] : [Step 2/2] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
[17:24:58] : [Step 2/2] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
[17:24:58] : [Step 2/2] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
[17:24:58] : [Step 2/2] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
[17:24:58] : [Step 2/2] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
[17:24:58] : [Step 2/2] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
[17:24:58] : [Step 2/2] at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
[17:24:58] : [Step 2/2] at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
[17:24:58] : [Step 2/2] at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
[17:24:58] : [Step 2/2] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
[17:24:58] : [Step 2/2] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
[17:24:58] : [Step 2/2] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
[17:24:58] : [Step 2/2] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
[17:24:58] : [Step 2/2] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
[17:24:58] : [Step 2/2] at org.sonar.runner.batch.BatchIsolatedLauncher.executeOldVersion(BatchIsolatedLauncher.java:92)
[17:24:58] : [Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[17:24:58] : [Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[17:24:58] : [Step 2/2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[17:24:58] : [Step 2/2] at java.lang.reflect.Method.invoke(Method.java:483)
[17:24:58] : [Step 2/2] at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
[17:24:58] : [Step 2/2] at com.sun.proxy.$Proxy42.executeOldVersion(Unknown Source)
[17:24:58] : [Step 2/2] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:284)
[17:24:58] : [Step 2/2] at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:166)
[17:24:58] : [Step 2/2] at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:153)
[17:24:58] : [Step 2/2] at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:99)
[17:24:58] : [Step 2/2] ... 22 more
[17:24:58] : [Step 2/2] Caused by: java.io.IOException: Error writing to server
[17:24:58] : [Step 2/2] at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:664)
[17:24:58] : [Step 2/2] at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:676)
[17:24:58] : [Step 2/2] at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1532)
[17:24:58] : [Step 2/2] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
[17:24:58] : [Step 2/2] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
[17:24:58] : [Step 2/2] at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
[17:24:58] : [Step 2/2] at com.github.kevinsawicki.http.HttpRequest.code(HttpRequest.java:1481)
[17:24:58] : [Step 2/2] ... 54 more
[17:24:58]W: [Step 2/2] [ERROR]
[17:24:58]W: [Step 2/2] [ERROR]
[17:24:58]W: [Step 2/2] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[17:24:58]W: [Step 2/2] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[17:24:58]W: [Step 2/2] Process exited with code 1