【问题标题】:Sonarqube upgrade to 6.7: Unrecoverable indexation failuresSonarqube 升级到 6.7:不可恢复的索引失败
【发布时间】:2018-06-27 07:38:06
【问题描述】:

目前我们正处于从 v4.5.7 升级到 v6.7.1 的过程中。

SonarQube 已成功升级到 v5.6.7(包括 DB 升级),目前正在更新到 v6.7.1。

在空数据库 (bundled H2 DB) 上启动的新 SonarQube 版本运行良好。之后,所有插件及其版本都会得到相应的验证和更新。

现在 Sonar 服务启动失败,错误为 Background initialization failed. Stopping SonarQube java.lang.IllegalStateException: Unrecoverable indexation failures

我删除了data/es5 文件夹并重新尝试启动sonar,但没有成功。非常感谢您为解决此问题提供的任何帮助。

网络日志:

  INFO  web[][o.s.p.ProcessEntryPoint] Starting web
  INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
  INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
  INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
  INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
  INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
  INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9002]
  INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 6.7.1.35068 / 426519346f51f7b980a76f9050f983110550509d
  INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:oracle:thin:@host:****:instance
  INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /.../sonar/sonarqube-6.7.1
  INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Branch / 1.0.0.507 / e9d161eaa2993f79890dd5d08230f3f566e6be93
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Checkmarx / 8.41.0-20161229-0945
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Developer / 1.0.0.240 / 25c709aeb128caa14725b943422cca19def50493
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Flex / 2.3 / 79167f762219bea1fd181ff5ef6ca4b34abd1675
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin GitHub / 1.4.2.1027 / dcfb02a5fa40c219d527563f5b8c793966523ca7
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Governance / 2.0.2.3011 / 4756b2f9d98d28cf2762d91eba1b48839a1edbe1
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Groovy / 1.5 / dcbcd1eeb8f61c8351e5dd1e51e11e52d186df35
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin LDAP / 2.2.0.608 / 79dc3fa4393a29667673c70182f3016288b548b7
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin License / 3.3.0.1341 / 6b63240af64c92afe9421ece35c99c70f1b97991
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Pitest / 0.9 / 0c011514ce025e5524fdcaa0c917eacf9d40f312
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SVG Badges / 3.0.1
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarABAP / 3.5.0.1080 / c37baa20eb9d24a27961ffe25d95ae4b716a3193
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarC# / 6.5.0.3766 / 6011a1e9fb002edb044ae3092d92bcfb7d9d8a2d
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarCFamily / 5.0.0.9359 / 6001ee3bce59e4bb9a17e5edbe40b4b99bc2901a
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarCOBOL / 4.1.1.2663 / 846e542a08e9e472f0216da6c30e66a96bcbc821
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 3.2.0.5506 / 86da09565f891121df248835665f5d8ed98772b6
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava / 4.15.0.12310 / 572454b93016ec73a53fe0e07b2ffdc356d21ba9
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP / 2.11.0.2485 / 741861a29e5f9a26c6c99c06268facb6c4f4a882
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPLI / 1.7.0.1117 / 2e07afcb9ecb6a2e96c980b48f7195b82ffdd014
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPLSQL / 3.2.0.1753 / 455f471cfde991b2cd1a86a939ff410bf3006059
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython / 1.8.0.1496 / 3fe3bc4d0273a5721ea2fb368dc45b1bb82fede3
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: Git / 1.3.0.869 / 4da53e3f9e55f4f2e5796625cb0c5768ed152079
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: SVN / 1.6.0.860 / 2111fdbd1dddda4ad6d4ed6486fd0b18c1010d3b
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarRPG / 2.2.0.1005 / 146ae32dade755799da4fa9655e865d8757fddfa
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarSwift / 3.1.0.2067 / 22db8593d10c835675860598372d41ba8d5f0b8e
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 1.1.0.1079 / 042c9e65239a47d92d305f9767f730b3cc1e5ed3
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarTSQL / 1.1.0.2177 / e8811dfecb71d328c4deca89297bc100b270313c
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarVB / 4.2.0.248 / 75e2175c7464b814699abd6719b964c027717683
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarVB6 / 2.3.0.992 / 8c9e2016cb2e325b2fdeba4d303181b33bbbda4b
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML / 1.4.3.1027 / 39588245cecf538bb27be4e496ff303b0143d20b
  INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Web / 2.5.0.476 / 636872f5d37fa7a440fe07d08d504e1a881225e5
  INFO  web[][c.c.sonar.CxPlugin] Checkmarx plugin loaded
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@6cdba960 [pattern=UrlPattern{inclusions=[/api/system/migrate_db/*, ...], exclusions=[/api/properties*, ...]}]
  INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port ****
  INFO  web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
  INFO  web[][c.q.p.s.b.f.PreferredFontProvider] SVGImageGenerator will be using font 'Verdana' in order to compute SVG badges width.
  INFO  web[][c.q.p.s.b.w.SVGImageGenerator] SVGImageGenerator is now ready.
  INFO  web[][c.q.p.s.b.w.g.QualityGateBadgeGenerator] QualityGateBadgeGenerator is now ready.
  INFO  web[][c.q.p.s.b.w.m.MeasureBadgeGenerator] MeasureBadgeGenerator is now ready.
  INFO  web[][c.q.p.s.b.w.c.CeActivityBadgeGenerator] CeActivityBadgeGenerator is now ready.
  WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/editions/show_license
  WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/views/definition
  INFO  web[][o.s.s.s.LogServerId] Server ID: *********
  WARN  web[][o.s.s.u.DeprecatedViews] Widget 'Checkmarx' (checkmarx-project-widget) is ignored. See org.sonar.api.web.page.PageDefinition to define pages.
  WARN  web[][o.s.s.u.DeprecatedViews] Page 'Checkmarx' (/cx_config/index) is ignored. See org.sonar.api.web.page.PageDefinition to define pages.
  INFO  web[][org.sonar.INFO] Security realm: LDAP
  INFO  web[][org.sonar.INFO] Security realm started
  INFO  web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.
  INFO  web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.)
  INFO  web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index
  INFO  web[][o.s.s.s.RegisterPlugins] Register plugins
  INFO  web[][o.s.s.s.RegisterMetrics] Register metrics
  INFO  web[][o.s.s.r.RegisterRules] Register rules
  INFO  web[][o.s.s.q.BuiltInQProfileRepositoryImpl] Load quality profiles
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Register quality profiles
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile cpp/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile c/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile rpg/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile js/Sonar way Recommended
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile js/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile py/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile pli/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile tsql/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile vb/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile plsql/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile cs/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile java/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile cobol/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile web/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile flex/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile xml/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile php/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile php/PSR-2
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile php/Drupal
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile vbnet/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile abap/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile grvy/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile objc/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile swift/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile ts/Sonar way
  INFO  web[][o.s.s.q.RegisterQualityProfiles] Update profile ts/Sonar way recommended
  INFO  web[][o.s.s.s.RegisterPermissionTemplates] Register permission templates
  INFO  web[][o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@1c655890 [pattern=UrlPattern{inclusions=[/api/measures/component/*, ...], exclusions=[/api/properties*, ...]}]
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.DeprecatedPropertiesWsFilter@4f45e5bd [pattern=UrlPattern{inclusions=[/api/properties/*], exclusions=[]}]
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceReroutingFilter@29719313 [pattern=UrlPattern{inclusions=[/api/components/bulk_update_key, ...], exclusions=[]}]
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@694be25 [pattern=UrlPattern{inclusions=[/sessions/init/*], exclusions=[]}]
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@61014c56 [pattern=UrlPattern{inclusions=[/oauth2/callback/*], exclusions=[]}]
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LoginAction@44a4512f [pattern=UrlPattern{inclusions=[/api/authentication/login], exclusions=[]}]
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LogoutAction@67e2e76 [pattern=UrlPattern{inclusions=[/api/authentication/logout], exclusions=[]}]
  INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.ValidateAction@12d61b62 [pattern=UrlPattern{inclusions=[/api/authentication/validate], exclusions=[]}]
  INFO  web[][o.s.s.e.IndexerStartupTask] Indexing of type [components/component] ...
  INFO  web[][o.s.s.es.BulkIndexer] 201463 requests processed (3357 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 357701 requests processed (2603 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 506390 requests processed (2478 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 636193 requests processed (2163 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 766613 requests processed (2173 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (2220 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (0 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (0 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (0 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (0 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (0 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (0 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 899827 requests processed (0 items/sec)
  INFO  web[][o.s.s.e.IndexerStartupTask] Indexing of type [components/component] done | time=815372ms
  INFO  web[][o.s.s.e.IndexerStartupTask] Indexing of type [views/view] ...
  INFO  web[][o.s.s.e.IndexerStartupTask] Indexing of type [views/view] done | time=3122ms
  INFO  web[][o.s.s.e.IndexerStartupTask] Indexing of type [issues/issue] ...
  INFO  web[][o.s.s.es.BulkIndexer] 758897 requests processed (12648 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 1395232 requests processed (10605 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 1989212 requests processed (9899 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 2567812 requests processed (9643 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 3159399 requests processed (9859 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 3320485 requests processed (2684 items/sec)
  INFO  web[][o.s.s.es.BulkIndexer] 3320485 requests processed (0 items/sec)
  ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
  java.lang.IllegalStateException: Unrecoverable indexation failures
at org.sonar.server.es.IndexingListener$1.onFinish(IndexingListener.java:39)
at org.sonar.server.es.BulkIndexer.stop(BulkIndexer.java:117)
at org.sonar.server.issue.index.IssueIndexer.doIndex(IssueIndexer.java:247)
at org.sonar.server.issue.index.IssueIndexer.indexOnStartup(IssueIndexer.java:95)
at org.sonar.server.es.IndexerStartupTask.indexUninitializedTypes(IndexerStartupTask.java:68)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at org.sonar.server.es.IndexerStartupTask.execute(IndexerStartupTask.java:55)
at java.util.Optional.ifPresent(Optional.java:159)
at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:84)
at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:45)
at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:80)
at org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:196)
at org.sonar.server.platform.Platform.access$400(Platform.java:46)
at org.sonar.server.platform.Platform$1.lambda$doRun$1(Platform.java:121)
at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
at org.sonar.server.platform.Platform$1.doRun(Platform.java:121)
at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
at java.lang.Thread.run(Thread.java:745)
  INFO  web[][o.s.p.StopWatcher] Stopping process

【问题讨论】:

  • 明确地说,您正在尝试使用 H2 DB 进行升级?
  • 没有安,在日志中,我们也有 Oracle DB。在升级之前,我在新目录中配置了新的 Sonarqube,使用 H2 DB 启动它,然后使用实际 DB 详细信息更新属性文件并尝试启动服务。

标签: sonarqube


【解决方案1】:

终于,我们的问题得到了解决。系统配置似乎是这个问题的根本原因。我们在一个服务器上运行这个,大约。 25GB 可用空间并以索引错误结束。使用具有更多可用空间的服务器有助于将 Sonarqube 成功升级到 v6.7.1。

【讨论】:

  • 真的吗???它是 SonarQube 2.7.x 的先决条件吗?我会在一台有 25GB 空闲空间的机器上试一试……
  • 我猜所需的磁盘空间与Sonarqube分析的问题数量和LOC有关。我们的服务器非常大,大约有 70M LOC,所以不得不使用空间更大的服务器。
  • 我确认:将 sonarquebe 文件夹复制到另一台具有更多可用磁盘空间的服务器上,服务器声明没有任何错误!在先决条件文档中添加注释可能更好:(
【解决方案2】:

看来你

  • 使用默认配置启动新实例
  • 安装了新的插件版本
  • 关闭新实例
  • 编辑了新实例的配置以指向您的生产数据库
  • 启动它备份(或尝试)

郑重声明,由于您面临的问题,这不再是推荐的升级过程。 Elasticsearch 针对您的空数据库运行其索引。现在您的实例由非空数据库支持,并且索引不匹配。

曾几何时,建议是删除data/es,但最近升级嵌入式版本的 Elasticsearch 意味着该过程不再顺利。

也许最简单的事情就是重新开始。您可以重新使用您下载的插件集,方法是手动将它们转移到新的extensions/plugins 目录并确保服务器在初始启动时指向您的生产数据库。

【讨论】:

  • 不幸的是,即使解释了新配置,也会出现同样的错误。还有什么线索吗?
  • @Coc,检查$SONARQUBE_HOME/logs/es.log & 如果有任何有趣的事情,请编辑问题以包括在内。
  • 我希望你能恢复 Elasticsearch 的重建能力或任何东西以避免这种混乱,这是一个相当常见的情况,谢谢
【解决方案3】:

我是第一次安装,第一次扫描时就遇到了这个问题。

使用 Community EditionVersion 8.7(内部版本 41497)LGPL v3

就我个人而言,这个问题只是因为我的硬盘已满......我只剩下大约 5GB 了。

所以我只是删除了一些东西,重新启动了 SonarQube 和 Sonar-scanner,执行了新的扫描,一切都很好。

【讨论】:

    【解决方案4】:

    请注意,最近诊断出一个错误,导致此精确故障:

    • SONAR-10502 - 服务器无法启动并出现错误“不可恢复的索引失败”

    这在 v7.1 中已修复(在 v6.7.3 中向后移植),详细信息在票证中。

    【讨论】:

      【解决方案5】:

      重建索引期间任务失败

      在 Elasticsearch 由于灾难恢复或升级而重新索引期间,您的分支或拉取请求中可能有失败的任务。如果你只有几个失败的任务,你可以重新分析你的分支或拉取请求。您可能希望使用 Web 服务来删除无法重新分析的分支和拉取请求,因为它们已从版本控制中删除。如果您有许多失败的任务,您可能需要删除您的 Elasticsearch 目录并重新索引。要删除您的 Elasticsearch 目录:

      • 停止 SonarQube
      • 删除data/es7目录
      • 重启 SonarQube

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-04-05
        • 2020-08-29
        • 2018-05-21
        • 1970-01-01
        • 2015-07-06
        • 1970-01-01
        • 2016-02-06
        • 1970-01-01
        相关资源
        最近更新 更多