Error when start sonar on Windows OS with sonar-cxx

Template for a good bug report, formatted with Markdown:

  • versions used SonarQube 9.0.1 without any plugin
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
2021.08.26 14:03:00 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2021.08.26 14:03:00 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2021.08.26 14:04:21 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
2021.08.26 14:04:22 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2021.08.26 14:04:22 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://kubernetes.docker.internal:9001]
2021.08.26 14:04:22 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.0.1.46107 / d32acdb9a65112f50702ab8f09521c7ebe80ead0
2021.08.26 14:04:22 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost/sonar
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: C:\Tools\sonarqube-9_0_1
2021.08.26 14:04:23 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2021.08.26 14:04:23 INFO  web[][o.s.s.p.d.m.h.MigrationHistoryTableImpl] Creating table schema_migrations
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin C# Code Quality and Security / 8.25.0.33663 / b0179674e9c2f72aae6c02a9a432a7b16b9dfef9
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin C++ (Community) / 2.0.4.2806 / f00c2b89f2d5ea26107abe4d8f1f1187e2d17b3e
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin CSS Code Quality and Security / 1.4.2.2002 / faa7d4f1407df67df7ada53caf677ab783721173
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Flex Code Quality and Security / 2.6.2.2641 / 11f07506915923b3a0e39e4e34280644c035b925
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Go Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin HTML Code Quality and Security / 3.4.0.2754 / 38f7ff864ae15152c9f1efc3014594f7e7ca7b6e
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JaCoCo / 1.1.1.1157 / 83478572b9f23efac29de15e30c7758bbb0c0e47
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Java Code Quality and Security / 7.1.0.26670 / 443133205a173cc74f55c04cc3d5d8a25644538c
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin JavaScript/TypeScript Code Quality and Security / 8.1.0.15788 / 5f6b8aa5acbb10db6a8852860755314fb1532449
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Kotlin Code Quality and Security / 2.0.1.110 / 484b3faa8cbcada38d017045d7faf5438e0b5395
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin PHP Code Quality and Security / 3.17.0.7439 / 44c7760147080c157fa0ff579772f92d3c8e1ebf
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Python Code Quality and Security / 3.5.0.8244 / 7992d2ad600835c9c1a3533f2ede108288e1a1e5
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Ruby Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin Scala Code Quality and Security / 1.8.3.2219 / d6ad7a5a47fc4785d2e80918fb7424be46e38a7f
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin VB.NET Code Quality and Security / 8.25.0.33663 / b0179674e9c2f72aae6c02a9a432a7b16b9dfef9
2021.08.26 14:04:23 INFO  web[][o.s.s.p.ServerPluginManager] Deploy plugin XML Code Quality and Security / 2.2.0.2973 / 16002945f0725643a7b42f090572795dd8b72a0f
2021.08.26 14:04:25 INFO  web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2021.08.26 14:04:25 INFO  web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install
2021.08.26 14:04:25 INFO  web[][DbMigrations] Executing DB migrations...
2021.08.26 14:04:25 INFO  web[][DbMigrations] #1 'Create initial schema'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #1 'Create initial schema': success | time=539ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #2 'Populate initial schema'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #2 'Populate initial schema': success | time=91ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5001 'Drop PK on 'uuid' for 'ce_activity' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5001 'Drop PK on 'uuid' for 'ce_activity' table': success | time=11ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5002 'Drop 'ce_activity_uuid' index'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5002 'Drop 'ce_activity_uuid' index': success | time=8ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5003 'Recreate PK on 'uuid' for 'ce_activity' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5003 'Recreate PK on 'uuid' for 'ce_activity' table': success | time=6ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5004 'Drop PK on 'uuid' for 'events' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5004 'Drop PK on 'uuid' for 'events' table': success | time=4ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5005 'Drop 'events_uuid' index'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5005 'Drop 'events_uuid' index': success | time=4ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5006 'Recreate PK on 'uuid' for 'events' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5006 'Recreate PK on 'uuid' for 'events' table': success | time=3ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5007 'Drop PK on 'kee' for 'issues' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5007 'Drop PK on 'kee' for 'issues' table': success | time=4ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5008 'Drop 'issues_kee' index'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5008 'Drop 'issues_kee' index': success | time=4ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5009 'Recreate PK on 'kee' for 'issues' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5009 'Recreate PK on 'kee' for 'issues' table': success | time=3ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5010 'Drop PK on 'kee' for 'snapshots' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5010 'Drop PK on 'kee' for 'snapshots' table': success | time=4ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5011 'Drop 'analyses_uuid' index'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5011 'Drop 'analyses_uuid' index': success | time=3ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5012 'Recreate PK on 'kee' for 'snapshots' table'...
2021.08.26 14:04:26 INFO  web[][DbMigrations] #5012 'Recreate PK on 'kee' for 'snapshots' table': success | time=3ms
2021.08.26 14:04:26 INFO  web[][DbMigrations] Executed DB migrations: success | time=693ms
2021.08.26 14:04:26 INFO  web[][o.s.s.p.Platform] Database has been automatically updated
2021.08.26 14:04:26 WARN  web[][o.a.c.u.SessionIdGeneratorBase] Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [412] milliseconds.
2021.08.26 14:04:26 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@405e9162 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]
2021.08.26 14:04:26 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2021.08.26 14:04:27 INFO  web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
2021.08.26 14:04:27 INFO  web[][o.s.s.e.IndexCreator] Delete Elasticsearch indices (DB vendor changed)
2021.08.26 14:04:28 INFO  web[][o.s.s.e.IndexCreator] Create index [components]
2021.08.26 14:04:29 INFO  web[][o.s.s.e.IndexCreator] Create type components/auth
2021.08.26 14:04:29 INFO  web[][o.s.s.e.IndexCreator] Create index [projectmeasures]
2021.08.26 14:04:30 INFO  web[][o.s.s.e.IndexCreator] Create type projectmeasures/auth
2021.08.26 14:04:30 INFO  web[][o.s.s.e.IndexCreator] Create index [rules]
2021.08.26 14:04:31 INFO  web[][o.s.s.e.IndexCreator] Create type rules/rule
2021.08.26 14:04:31 INFO  web[][o.s.s.e.IndexCreator] Create index [issues]
2021.08.26 14:04:32 INFO  web[][o.s.s.e.IndexCreator] Create type issues/auth
2021.08.26 14:04:32 INFO  web[][o.s.s.e.IndexCreator] Create index [users]
2021.08.26 14:04:32 INFO  web[][o.s.s.e.IndexCreator] Create type users/user
2021.08.26 14:04:32 INFO  web[][o.s.s.e.IndexCreator] Create index [views]
2021.08.26 14:04:33 INFO  web[][o.s.s.e.IndexCreator] Create type views/view
2021.08.26 14:04:33 INFO  web[][o.s.s.s.LogServerId] Server ID: A7EE8CF2-AXuBD0O8IUc0QESBYoP0
2021.08.26 14:04:33 WARN  web[][o.s.s.a.LogOAuthWarning] For security reasons, OAuth authentication should use HTTPS. You should set the property 'Administration > Configuration > Server base URL' to a HTTPS URL.
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/plugins/download
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/permissions/search_templates
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/list_bitbucketserver_projects
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/search_bitbucketcloud_repos
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/check_pat
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/list_azure_projects
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/search_bitbucketserver_repos
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/search_azure_repos
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/list_github_organizations
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/list_github_repositories
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_integrations/get_github_client_id
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_settings/get_binding
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_settings/list
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_settings/list_definitions
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_settings/count_binding
2021.08.26 14:04:34 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/alm_settings/validate
2021.08.26 14:04:34 INFO  web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.
2021.08.26 14:04:34 INFO  web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.)
2021.08.26 14:04:34 INFO  web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired session tokens has removed 0 elements
2021.08.26 14:04:34 INFO  web[][o.s.s.a.p.ExpiredSessionsCleaner] Purge of expired SAML message ids has removed 0 elements
2021.08.26 14:04:34 INFO  web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index
2021.08.26 14:04:34 INFO  web[][o.s.s.s.RegisterPlugins] Register plugins
2021.08.26 14:04:34 INFO  web[][o.s.s.s.RegisterMetrics] Register metrics
2021.08.26 14:04:34 INFO  web[][o.s.s.q.RegisterQualityGates] Built-in quality gate's conditions of [Sonar way] has been updated
2021.08.26 14:04:34 INFO  web[][o.s.s.r.RegisterRules] Register rules
2021.08.26 14:04:34 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.NoSuchMethodError: org.sonar.api.server.rule.RulesDefinition$NewRule.setEffortToFixDescription(Ljava/lang/String;)Lorg/sonar/api/server/rule/RulesDefinition$NewRule;
	at org.sonar.cxx.squidbridge.annotations.AnnotationBasedRulesDefinition.setupSqaleModel(AnnotationBasedRulesDefinition.java:184)
	at org.sonar.cxx.squidbridge.annotations.AnnotationBasedRulesDefinition.addRuleClasses(AnnotationBasedRulesDefinition.java:102)
	at org.sonar.cxx.squidbridge.annotations.AnnotationBasedRulesDefinition.addRuleClasses(AnnotationBasedRulesDefinition.java:88)
	at org.sonar.plugins.cxx.CxxRuleRepository.define(CxxRuleRepository.java:34)
	at org.sonar.server.rule.RuleDefinitionsLoader.load(RuleDefinitionsLoader.java:53)
	at org.sonar.server.rule.RegisterRules.start(RegisterRules.java:117)
	at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.access$001(PlatformLevelStartup.java:49)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:87)
	at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:45)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:84)
	at org.sonar.server.platform.PlatformImpl.executeStartupTasks(PlatformImpl.java:198)
	at org.sonar.server.platform.PlatformImpl$1.lambda$doRun$1(PlatformImpl.java:122)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:370)
	at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:122)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:354)
	at java.base/java.lang.Thread.run(Thread.java:834)
2021.08.26 14:04:34 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2021.08.26 14:04:34 INFO  web[][o.s.s.n.NotificationDaemon] Notification service stopped
  • steps to reproduce
  1. enable Embedded Database in sonar.properties;
  2. run .\StartSonar.bat by admin of Windows OS;
  • potential workaround

P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour

Hey there.

Based on the logs:

This is strictly related to SonarOpenCommunity/sonar-cxx (a third-party plugin not developed, maintained or supported by SonarSource or this community), I would recommend raising with the maintainer for support.