SonarQube for MSBuild - 结束分析失败

时间:2016-07-20 12:22:30

标签: sonarqube azure-devops sonarqube-scan

在此问题上花费了20多个小时,但无法解决。

要求 - SONARQube在Visual Studio online中与MSBuild集成。

遵循的步骤 -

设置SONARQube-5.6

  1. 使用SQL Server 2012的Azure上的Windows服务器VM。
  2. 按照以下两个链接中提供的以下步骤进行操作
  3. http://docs.sonarqube.org/display/SONAR/Installing+the+Server http://donovanbrown.com/post/2015/06/17/how-to-setup-a-sonarqube-server-in-azure

    1. 将SQL Server与SQL身份验证配合使用。
    2. Sonar正在运行Windows服务。
    3. 安装了JDK 8,JRE 8
    4. 问题1 - 可以使用服务器本身上的以下网址http://abc.cloudapp.net:9000访问SONARQube。通过互联网在服务器外面无法访问。

      在MSBuild中集成SONARQube

      按照以下链接中提供的步骤操作 https://blogs.msdn.microsoft.com/visualstudioalm/2015/08/24/build-tasks-for-sonarqube-analysis/

      问题2 -

      当我对构建进行排队时,成功执行Begin Analysis步骤以获取SONAR配置文件。在解决方案构建步骤之后,执行“结束分析”步骤时,此步骤将失败,并显示以下错误。

      2016-07-20T11:47:55.0719979Z 11:47:54.868 INFO  - Analysis report generated in 218ms, dir size=1 MB
      2016-07-20T11:47:55.1813633Z 11:47:54.993 INFO  - Analysis reports compressed in 125ms, zip size=593 KB
      2016-07-20T11:47:55.9512068Z INFO: ------------------------------------------------------------------------
      2016-07-20T11:47:55.9512068Z INFO: EXECUTION FAILURE
      2016-07-20T11:47:55.9512068Z INFO: ------------------------------------------------------------------------
      2016-07-20T11:47:55.9512068Z Total time: 25.270s
      2016-07-20T11:47:55.9512068Z Final Memory: 12M/419M
      2016-07-20T11:47:55.9512068Z INFO: ------------------------------------------------------------------------
      2016-07-20T11:47:55.9512068Z ##[error]ERROR: Error during Sonar runner execution
      2016-07-20T11:47:55.9512068Z ##[error]org.sonar.runner.impl.RunnerException: Unable to execute Sonar
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
      2016-07-20T11:47:55.9512068Z ##[error]at java.security.AccessController.doPrivileged(Native Method)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.api.Runner.execute(Runner.java:100)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.Main.executeTask(Main.java:70)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.Main.execute(Main.java:59)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.Main.main(Main.java:53)
      2016-07-20T11:47:55.9512068Z ##[error]Caused by: org.sonarqube.ws.client.HttpException: Error 500 on http://nstudio36db.cloudapp.net:9000/api/ce/submit?projectKey=nstudio36&projectName=nstudio36POC
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:34)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.bootstrap.BatchWsClient.failIfUnauthorized(BatchWsClient.java:99)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.bootstrap.BatchWsClient.call(BatchWsClient.java:69)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.report.ReportPublisher.upload(ReportPublisher.java:172)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.report.ReportPublisher.execute(ReportPublisher.java:127)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:64)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:51)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:86)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
      2016-07-20T11:47:55.9512068Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2016-07-20T11:47:55.9512068Z ##[error]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      2016-07-20T11:47:55.9512068Z ##[error]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      2016-07-20T11:47:55.9512068Z ##[error]at java.lang.reflect.Method.invoke(Method.java:498)
      2016-07-20T11:47:55.9512068Z ##[error]at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
      2016-07-20T11:47:55.9512068Z ##[error]... 9 more
      2016-07-20T11:47:55.9512068Z ##[error]ERROR:
      2016-07-20T11:47:55.9512068Z ##[error]ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
      2016-07-20T11:47:55.9512068Z ##[error]The SonarQube Scanner did not complete successfully
      2016-07-20T11:47:55.9512068Z 11:47:55.873  Creating a summary markdown file...
      2016-07-20T11:47:55.9668295Z ##[error]Post-processing failed. Exit code: 1
      2016-07-20T11:47:56.0157824Z ##[error]System.Exception: Unexpected exit code received from batch file: 1
      2016-07-20T11:47:56.0157824Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.PowerShell.InvokeBatchScriptCmdlet.ProcessRecord()
      2016-07-20T11:47:56.0157824Z ##[error]   at System.Management.Automation.CommandProcessor.ProcessRecord()
      2016-07-20T11:47:56.0626590Z ##[debug]Calling InvokeGetRestMethod "/api/server/version" 
      2016-07-20T11:47:56.0939103Z ##[debug]GET http://nstudio36db.cloudapp.net:9000/api/server/version with 0-byte payload
      2016-07-20T11:47:56.2411799Z ##[debug]received 3-byte response of content type text/html;charset=utf-8
      2016-07-20T11:47:56.2935352Z Waiting on the SonarQube server to finish processing in order to determine the quality gate status.
      2016-07-20T11:47:56.3327387Z ##[error]System.Management.Automation.RuntimeException: Cannot determine if the analysis has finished. Possible cause: your SonarQube server version is lower than 5.3 - for more details see https://go.microsoft.com/fwlink/?LinkId=722407 ---> System.Management.Automation.RuntimeException: Cannot determine if the analysis has finished. Possible cause: your SonarQube server version is lower than 5.3 - for more details see https://go.microsoft.com/fwlink/?LinkId=722407
      2016-07-20T11:47:56.3327387Z ##[error]   --- End of inner exception stack trace ---
      2016-07-20T11:47:56.3327387Z ##[error]   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
      2016-07-20T11:47:56.3327387Z ##[error]   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
      2016-07-20T11:47:56.3327387Z ##[error]   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
      2016-07-20T11:47:56.3327387Z ##[error]   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
      2016-07-20T11:47:56.3327387Z ##[error]   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
      2016-07-20T11:47:56.3327387Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Handlers.PowerShellHandler.Execute(ITaskContext context, CancellationToken cancellationToken, Int32 timeoutInMinutes)
      2016-07-20T11:47:56.3327387Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.RunTask(ITaskContext context, TaskWrapper task, CancellationTokenSource tokenSource)
      

      惊喜元素

      1. 结束分析步骤正在执行,报告最初正在上传。 2-3天后,我关闭了虚拟机。有一天我又开始了,事情就停止了。

      2. 安装了声纳的config中的sonar.properties文件,从下载的zip版本中解压缩后没有任何更改。如果我按照SONARQube网站安装指南中的要求进行更改 http://docs.sonarqube.org/display/SONAR/Installing+the+Server Windows服务Sonar Qube甚至没有运行,它启动和停止时记录了一些错误。

      3. 我还附上了SONARQube的日志以获得更多说明

        Sonar.log的内容

        SonarQube removed.
        CreateService failed - The specified service has been marked for deletion. (0x430)
        Starting the SonarQube service...
        Unable to start the service - The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. (0x422)
        SonarQube installed.
        Starting the SonarQube service...
        --> Wrapper Started as Service
        Launching a JVM...
        Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
          Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
        
        2016.07.20 11:42:19 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\SonarCubeNStudio\temp
        2016.07.20 11:42:19 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[es]: C:\Program Files\Java\jre1.8.0_101\bin\java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\SonarCubeNStudio\temp -javaagent:C:\Program Files\Java\jre1.8.0_101\lib\management-agent.jar -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:\SonarCubeNStudio\temp\sq-process8674696029876155294properties
        2016.07.20 11:42:21 INFO   es[o.s.p.ProcessEntryPoint]  Starting es
        2016.07.20 11:42:21 INFO   es[o.s.s.EsSettings]  Elasticsearch listening on 127.0.0.1:9001
        2016.07.20 11:42:21 INFO   es[o.elasticsearch.node]  [sonar-1469014939182] version[1.7.5], pid[5080], build[00f95f4/2016-02-02T09:55:30Z]
        2016.07.20 11:42:21 INFO   es[o.elasticsearch.node]  [sonar-1469014939182] initializing ...
        2016.07.20 11:42:21 INFO   es[o.e.plugins]  [sonar-1469014939182] loaded [], sites []
        SonarQube started.
        2016.07.20 11:42:23 INFO   es[o.elasticsearch.env]  [sonar-1469014939182] using [1] data paths, mounts [[(C:)]], net usable_space [84.9gb], net total_space [126.9gb], types [NTFS]
        2016.07.20 11:42:26 WARN   es[o.e.bootstrap]  JNA not found. native methods will be disabled.
        2016.07.20 11:42:29 INFO   es[o.elasticsearch.node]  [sonar-1469014939182] initialized
        2016.07.20 11:42:29 INFO   es[o.elasticsearch.node]  [sonar-1469014939182] starting ...
        2016.07.20 11:42:29 INFO   es[o.e.transport]  [sonar-1469014939182] bound_address {inet[/127.0.0.1:9001]}, publish_address {inet[/127.0.0.1:9001]}
        2016.07.20 11:42:29 INFO   es[o.e.discovery]  [sonar-1469014939182] sonarqube/tJjpPHT5QwKQ0DICqUP99w
        2016.07.20 11:42:33 INFO   es[o.e.cluster.service]  [sonar-1469014939182] new_master [sonar-1469014939182][tJjpPHT5QwKQ0DICqUP99w][nstudio36db][inet[/127.0.0.1:9001]]{rack_id=sonar-1469014939182}, reason: zen-disco-join (elected_as_master)
        2016.07.20 11:42:33 INFO   es[o.elasticsearch.node]  [sonar-1469014939182] started
        2016.07.20 11:42:33 INFO   es[o.e.gateway]  [sonar-1469014939182] recovered [0] indices into cluster_state
        2016.07.20 11:42:33 INFO  app[o.s.p.m.Monitor] Process[es] is up
        2016.07.20 11:42:33 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[web]: C:\Program Files\Java\jre1.8.0_101\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=C:\SonarCubeNStudio\temp -javaagent:C:\Program Files\Java\jre1.8.0_101\lib\management-agent.jar -cp ./lib/common/*;./lib/server/*;C:\SonarCubeNStudio\lib\jdbc\h2\h2-1.3.176.jar org.sonar.server.app.WebServer C:\SonarCubeNStudio\temp\sq-process3740500123831706040properties
        2016.07.20 11:42:35 INFO  web[o.s.p.ProcessEntryPoint] Starting web
        2016.07.20 11:42:36 INFO  web[o.s.s.a.TomcatContexts] Webapp directory: C:\SonarCubeNStudio\web
        2016.07.20 11:42:37 INFO  web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-9000"]
        2016.07.20 11:42:37 INFO  web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
        2016.07.20 11:42:39 INFO  web[o.s.s.p.ServerImpl] SonarQube Server / 5.6 / 074f3d1169f9688d15af4aff67e7e672cbeed782
        2016.07.20 11:42:40 INFO  web[o.s.s.d.EmbeddedDatabase] Starting embedded database on port 9092 with url jdbc:h2:tcp://localhost:9092/sonar
        2016.07.20 11:42:40 INFO  web[o.s.s.d.EmbeddedDatabase] Embedded database started. Data stored in: C:\SonarCubeNStudio\data
        2016.07.20 11:42:40 INFO  web[o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://localhost:9092/sonar
        2016.07.20 11:42:41 WARN  web[o.s.d.DatabaseChecker] H2 database should be used for evaluation purpose only
        2016.07.20 11:42:44 INFO  web[o.s.s.p.DefaultServerFileSystem] SonarQube home: C:\SonarCubeNStudio
        2016.07.20 11:42:45 INFO  web[o.e.plugins] [sonar-1469014939182] loaded [], sites []
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Plugin C# [csharp] installed
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Plugin Java [java] installed
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Plugin JavaScript [javascript] installed
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Plugin Git [scmgit] installed
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Plugin SVN [scmsvn] installed
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin C# / 5.0 / 17ddb09047940791828dcb70c9e225f006ab11aa
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.2 / a713dd64daf8719ba4e7f551f9a1966c62690c17
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin Java / 3.13.1 / cf0f0c950ba3e83a87c7fe11c6ff7e63f4864bd9
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin JavaScript / 2.11 / a9b1afa9ceef7079811779d9efc5f8026acb1400
        2016.07.20 11:42:48 INFO  web[o.s.s.p.ServerPluginRepository] Deploy plugin SVN / 1.3 / aff503d48bc77b07c2b62abf93249d0a20bd355c
        2016.07.20 11:42:49 INFO  web[o.s.s.d.m.DatabaseMigrator] Create database
        2016.07.20 11:42:51 INFO  web[o.s.s.p.RailsAppsDeployer] Deploying Ruby on Rails applications
        2016.07.20 11:42:53 INFO  web[o.s.s.p.UpdateCenterClient] Update center: http://update.sonarsource.org/update-center.properties (no proxy)
        2016.07.20 11:42:54 INFO  web[o.s.s.e.IndexCreator] Create index tests
        2016.07.20 11:42:55 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [tests] creating index, cause [api], templates [], shards [5]/[0], mappings []
        2016.07.20 11:42:58 INFO  web[o.s.s.e.IndexCreator] Create type tests/test
        2016.07.20 11:42:58 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [tests] create_mapping [test]
        2016.07.20 11:42:58 INFO  web[o.s.s.e.IndexCreator] Create index activities
        2016.07.20 11:42:58 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [activities] creating index, cause [api], templates [], shards [5]/[0], mappings []
        2016.07.20 11:42:59 INFO  web[o.s.s.e.IndexCreator] Create type activities/activity
        2016.07.20 11:42:59 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [activities] create_mapping [activity]
        2016.07.20 11:42:59 INFO  web[o.s.s.e.IndexCreator] Create index rules
        2016.07.20 11:42:59 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [rules] creating index, cause [api], templates [], shards [5]/[0], mappings []
        2016.07.20 11:43:00 INFO  web[o.s.s.e.IndexCreator] Create type rules/activeRule
        2016.07.20 11:43:00 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [rules] create_mapping [activeRule]
        2016.07.20 11:43:00 INFO  web[o.s.s.e.IndexCreator] Create type rules/rule
        2016.07.20 11:43:00 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [rules] create_mapping [rule]
        2016.07.20 11:43:00 INFO  web[o.s.s.e.IndexCreator] Create index issues
        2016.07.20 11:43:00 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [issues] creating index, cause [api], templates [], shards [5]/[0], mappings []
        2016.07.20 11:43:01 INFO  web[o.s.s.e.IndexCreator] Create type issues/authorization
        2016.07.20 11:43:01 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [issues] create_mapping [authorization]
        2016.07.20 11:43:01 INFO  web[o.s.s.e.IndexCreator] Create type issues/issue
        2016.07.20 11:43:01 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [issues] create_mapping [issue]
        2016.07.20 11:43:01 INFO  web[o.s.s.e.IndexCreator] Create index users
        2016.07.20 11:43:01 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [users] creating index, cause [api], templates [], shards [5]/[0], mappings []
        2016.07.20 11:43:02 INFO  web[o.s.s.e.IndexCreator] Create type users/user
        2016.07.20 11:43:02 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [users] create_mapping [user]
        2016.07.20 11:43:02 INFO  web[o.s.s.e.IndexCreator] Create index views
        2016.07.20 11:43:02 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [views] creating index, cause [api], templates [], shards [5]/[0], mappings []
        2016.07.20 11:43:03 INFO  web[o.s.s.e.IndexCreator] Create type views/view
        2016.07.20 11:43:03 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [views] create_mapping [view]
        2016.07.20 11:43:03 INFO  web[o.s.s.n.NotificationService] Notification service started (delay 60 sec.)
        2016.07.20 11:43:04 INFO  web[o.s.s.s.RegisterMetrics] Register metrics
        2016.07.20 11:43:04 INFO  web[o.s.s.r.RegisterRules] Register rules
        2016.07.20 11:43:20 INFO  web[o.s.s.q.RegisterQualityProfiles] Register quality profiles
        2016.07.20 11:43:22 INFO  web[o.s.s.q.RegisterQualityProfiles] Register profile {lang=cs, name=Sonar way}
        2016.07.20 11:43:24 INFO  web[o.s.s.q.RegisterQualityProfiles] Set default cs profile: Sonar way
        2016.07.20 11:43:24 INFO  web[o.s.s.q.RegisterQualityProfiles] Register profile {lang=java, name=Sonar way}
        2016.07.20 11:43:27 INFO  web[o.s.s.q.RegisterQualityProfiles] Set default java profile: Sonar way
        2016.07.20 11:43:27 INFO  web[o.s.s.q.RegisterQualityProfiles] Register profile {lang=js, name=Sonar way}
        2016.07.20 11:43:28 INFO  web[o.s.s.q.RegisterQualityProfiles] Register profile {lang=js, name=Sonar Security Way}
        2016.07.20 11:43:28 INFO  web[o.s.s.q.RegisterQualityProfiles] Set default js profile: Sonar way
        2016.07.20 11:43:31 INFO  web[o.s.s.s.RegisterNewMeasureFilters] Register measure filters
        2016.07.20 11:43:31 INFO  web[o.s.s.s.RegisterNewMeasureFilters] Register measure filter: Projects
        2016.07.20 11:43:31 INFO  web[o.s.s.s.RegisterNewMeasureFilters] Register measure filter: My favourites
        2016.07.20 11:43:31 INFO  web[o.s.s.s.RegisterDashboards] Register dashboards
        2016.07.20 11:43:32 INFO  web[o.s.s.s.RegisterDashboards] Register dashboard: Custom
        2016.07.20 11:43:32 INFO  web[o.s.s.s.RegisterDashboards] Register dashboard: Home
        2016.07.20 11:43:32 INFO  web[o.s.s.s.RegisterPermissionTemplates] Register permission templates
        2016.07.20 11:43:32 INFO  web[o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys
        2016.07.20 11:43:32 INFO  web[o.s.s.s.RenameIssueWidgets] Replacing issue related widgets with issue filter widgets
        2016.07.20 11:43:32 INFO  web[o.s.s.e.IndexerStartupTask] Index activities
        2016.07.20 11:43:34 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [activities] update_mapping [activity] (dynamic)
        2016.07.20 11:43:34 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [activities] update_mapping [activity] (dynamic)
        2016.07.20 11:43:35 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [activities] update_mapping [activity] (dynamic)
        2016.07.20 11:43:35 INFO   es[o.e.cluster.metadata]  [sonar-1469014939182] [activities] update_mapping [activity] (dynamic)
        2016.07.20 11:43:35 INFO  web[o.s.s.e.IndexerStartupTask] Index issues
        2016.07.20 11:43:36 INFO  web[o.s.s.e.IndexerStartupTask] Index tests
        2016.07.20 11:43:36 INFO  web[o.s.s.e.IndexerStartupTask] Index users
        2016.07.20 11:43:36 INFO  web[o.s.s.e.IndexerStartupTask] Index views
        2016.07.20 11:43:37 INFO  web[jruby.rack] jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_101-b13 [Windows Server 2012 R2-amd64]
        2016.07.20 11:43:37 INFO  web[jruby.rack] using a shared (threadsafe!) runtime
        2016.07.20 11:44:09 INFO  web[jruby.rack] keeping custom (config.logger) Rails logger instance
        2016.07.20 11:44:09 INFO  web[o.s.s.p.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@1653ae93 [pattern=/sessions/init/*]
        2016.07.20 11:44:09 INFO  web[o.s.s.p.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@363262a [pattern=/oauth2/callback/*]
        2016.07.20 11:44:09 INFO  web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9000"]
        2016.07.20 11:44:09 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
        2016.07.20 11:44:09 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
        2016.07.20 11:44:10 INFO  app[o.s.p.m.Monitor] Process[web] is up
        2016.07.20 11:44:10 INFO  app[o.s.p.m.JavaProcessLauncher] Launch process[ce]: C:\Program Files\Java\jre1.8.0_101\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=C:\SonarCubeNStudio\temp -javaagent:C:\Program Files\Java\jre1.8.0_101\lib\management-agent.jar -cp ./lib/common/*;./lib/server/*;./lib/ce/*;C:\SonarCubeNStudio\lib\jdbc\h2\h2-1.3.176.jar org.sonar.ce.app.CeServer C:\SonarCubeNStudio\temp\sq-process5870977745631384763properties
        2016.07.20 11:44:12 INFO  ce[o.s.p.ProcessEntryPoint] Starting ce
        2016.07.20 11:44:12 INFO  ce[o.s.ce.app.CeServer] Compute Engine starting up...
        2016.07.20 11:44:13 INFO  ce[o.s.s.p.ServerImpl] SonarQube Server / 5.6 / 074f3d1169f9688d15af4aff67e7e672cbeed782
        2016.07.20 11:44:13 INFO  ce[o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://localhost:9092/sonar
        2016.07.20 11:44:13 WARN  ce[o.s.d.DatabaseChecker] H2 database should be used for evaluation purpose only
        2016.07.20 11:44:17 INFO  ce[o.s.s.p.DefaultServerFileSystem] SonarQube home: C:\SonarCubeNStudio
        2016.07.20 11:44:18 INFO  ce[o.e.plugins] [sonar-1469014939182] loaded [], sites []
        2016.07.20 11:44:21 INFO  ce[o.s.c.c.CePluginRepository] Load plugins
        2016.07.20 11:44:26 INFO  ce[o.s.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before Fri Jan 22 11:44:26 UTC 2016
        2016.07.20 11:44:26 INFO  ce[o.s.ce.app.CeServer] Compute Engine is up
        2016.07.20 11:44:27 INFO  app[o.s.p.m.Monitor] Process[ce] is up
        2016.07.20 11:47:54 ERROR web[rails] /!\ FAILSAFE /!\  Wed Jul 20 11:47:54 UTC 2016
          Status: 500 Internal Server Error
          No such file or directory - C:/Windows/system32/config/systemprofile/AppData/Local/Temp
            org/jruby/RubyFile.java:842:in `stat'
            jar:file:/C:/SonarCubeNStudio/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:33:in `tmpdir'
            org/jruby/RubyArray.java:1613:in `each'
            jar:file:/C:/SonarCubeNStudio/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:30:in `tmpdir'
            jar:file:/C:/SonarCubeNStudio/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:109:in `tmpdir'
            jar:file:/C:/SonarCubeNStudio/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:141:in `create'
            org/jruby/ext/tempfile/Tempfile.java:88:in `initialize'
            org/jruby/RubyIO.java:852:in `new'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/utils.rb:559:in `parse_multipart'
            org/jruby/RubyKernel.java:1519:in `loop'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/utils.rb:537:in `parse_multipart'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/request.rb:268:in `parse_multipart'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/request.rb:146:in `POST'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/methodoverride.rb:15:in `call'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:15:in `call'
            file:/C:/SonarCubeNStudio/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/session_store.rb:70:in `context'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/session/abstract/id.rb:58:in `call'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call'
            C:/SonarCubeNStudio/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call'
            file:/C:/SonarCubeNStudio/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34:in `serve_rails'
            file:/C:/SonarCubeNStudio/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39:in `call'
            file:/C:/SonarCubeNStudio/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:in `call'
        

1 个答案:

答案 0 :(得分:3)

服务器端的错误(在客户端调用 api / ce / submit 期间发生)与已知错误SONAR-7896非常匹配 - 分析失败,如果SonarQube作为Windows服务运行(这是你的情况)。

故障单中列出了变通方法:

  
      
  • <sonar_install_dir>/conf/wrapper.conf中添加set.TMPDIR=../../temp
  •   
  • 在Windows服务管理工具中,编辑SonarQube服务属性,将“登录”从“本地系统帐户”更改为   '此帐户'(提供您当地的管理员用户名/密码)
  •   
  • 或者从命令行手动运行SonarQube
  •