0

Sonarqube 分析完成,但对于代码库庞大的项目,报告处理失败。问题出现在具有 220K 行代码的项目中。

Sonarqube 版本 - 7.9.1 - 在 Kubernetes 上运行

我尝试删除新索引的 data/es 文件夹。仍然没有运气。

错误日志

Caused by: java.lang.IllegalStateException: Fail to execute ES refresh request on indices 'components'
    at org.sonar.server.es.request.ProxyRefreshRequestBuilder.get(ProxyRefreshRequestBuilder.java:44)
    at org.sonar.server.es.request.ProxyRefreshRequestBuilder.get(ProxyRefreshRequestBuilder.java:32)
    at org.sonar.server.es.BulkIndexer.stop(BulkIndexer.java:120)
    at org.sonar.server.component.index.ComponentIndexer.delete(ComponentIndexer.java:165)
    at org.sonar.ce.task.projectanalysis.purge.IndexPurgeListener.onComponentsDisabling(IndexPurgeListener.java:41)
    at org.sonar.db.purge.PurgeDao.purgeDisabledComponents(PurgeDao.java:107)
    at org.sonar.db.purge.PurgeDao.purge(PurgeDao.java:71)
    at org.sonar.ce.task.projectanalysis.purge.ProjectCleaner.purge(ProjectCleaner.java:63)
    at org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep.execute(PurgeDatastoresStep.java:76)
    at org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep.access$000(PurgeDatastoresStep.java:38)
    at org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep$1.visitProject(PurgeDatastoresStep.java:63)
    at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:70)
    at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:51)
    at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
    ... 18 common frames omitted
Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes were available: [{sonarqube}{}{}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}]
    at org.elasticsearch.client.transport.TransportClientNodesService$RetryListener.onFailure(TransportClientNodesService.java:294)
    at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:59)
    at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:533)
    at org.elasticsearch.action.TransportActionNodeProxy.execute(TransportActionNodeProxy.java:48)
    at org.elasticsearch.client.transport.TransportProxyClient.lambda$execute$0(TransportProxyClient.java:60)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:253)
    at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:60)
    at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:388)
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403)
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:391)
    at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1262)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:46)
    at org.sonar.server.es.request.ProxyRefreshRequestBuilder.get(ProxyRefreshRequestBuilder.java:42)
    ... 31 common frames omitted
Caused by: org.elasticsearch.transport.NodeNotConnectedException: [sonarqube][127.0.0.1:9001] Node not connected
    at org.elasticsearch.transport.ConnectionManager.getConnection(ConnectionManager.java:151)
    at org.elasticsearch.transport.TransportService.getConnection(TransportService.java:557)
    at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:529)
4

1 回答 1

0

我通过增加 SonarQube Kubernetes pod 的内存限制解决了这个问题。感谢@Przemek Nowak 对这个问题的回答。

于 2019-08-27T18:46:15.267 回答