Take an hour to startup SonarQube when configured to Oracle external database

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Version 7.9.3
  • what are you trying to achieve
    To start up sonarqube as soon as possible
  • what have you tried so far to achieve this
    Previously, the sonarqube docker used to startup with bundled H2 database within 5 mins.
    When I tried to startup sonarqube docker with configured Oracle external database, it takes me a hour to startup. In the beginning, I just wonder if schema is required to setup for initialization. When I restart the docker and it startup in a hour. When I search the log, most of the time is spending on Register rules(taking 40 mins).

May I know any ways to boot the startup time? Or even no register rules again when startup(suppose the rules are setup during first start up)?
Here is the full log

2020.04.27 01:35:50 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2020.04.27 01:35:50 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process
2020.04.27 01:37:49 INFO web[o.s.p.ProcessEntryPoint] Starting web
2020.04.27 01:37:53 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2020.04.27 01:38:00 INFO web[o.e.p.PluginsService] no modules loaded
2020.04.27 01:38:00 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2020.04.27 01:38:00 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2020.04.27 01:38:00 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.04.27 01:38:14 INFO web[o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2020.04.27 01:38:14 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 7.9.3.33349 / ded65927f38a2b43427165f32243223c10bd415c
2020.04.27 01:38:14 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:oracle:thin:@9.46.72.166:1521/aadb
2020.04.27 01:38:28 INFO web[o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2020.04.27 01:38:28 INFO web[o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.8.0.1574 / aec3dc8f5228aabd218e1cd31ac6e6515a43715d
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin GitHub Authentication for SonarQube / 1.5.0.870 / 153f7c7af7a264adb0fcbe5fee87bdd140a6a3a1
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin JaCoCo / 1.0.2.475 / b79a4724f3a9af1051266b4f8ca0460977295ead
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin LDAP / 2.2.0.608 / 79dc3fa4393a29667673c70182f3016288b548b7
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SAML 2.0 Authentication for SonarQube / 1.1.0.181 / 16fcb5be2d3bcfee8920b29cd758d8b957a18acb
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarC# / 7.15.0.8572 / e0ad49e38a28a8fc333ba746fc998e48678f6a8b
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarCSS / 1.1.1.1010 / 365e21fd0cb9035669fc59f6fec7c8fd28a7303b
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarFlex / 2.5.1.1831 / a0c44437f6abb0feec76edd073f91fec64db2a6c
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarGo / 1.1.1.2000 / 40d55921c7a63b67386a053490d17b6723a46cd5
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarHTML / 3.1.0.1615 / 4181edb5eff5605bec82dc0aa15ecd70eaa5857f
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 5.2.1.7778 / 49f34eaeaad59868d4353d89b1fc5c02bbe51976
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava / 5.13.1.18282 / 568f8ed2349f48e250a9329895b9a870100dfbeb
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarKotlin / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP / 3.2.0.4868 / ec66bd5f8490677eb0ebae82aa17c2a5d9c0e5e7
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython / 1.14.1.3143 / eed7b315b6116fe462a19c771013bf3891c92a97
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarRuby / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarScala / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 1.9.0.3766 / 4a4080b78001a78d758d1d0fa0190fb9496b6f57
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarVB / 7.15.0.8572 / e0ad49e38a28a8fc333ba746fc998e48678f6a8b
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML / 2.0.1.2020 / c5b84004face582d56f110e24c29bf9c6a679e69
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Svn / 1.9.0.1295 / 942e075773975354e32691a60bfd968065703e04
2020.04.27 01:39:27 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin bitegarden Report / 2.0 / 36558ad85930e2ec71d42d04c74ddcabbd373542
2020.04.27 01:39:57 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@48e411db [pattern=UrlPattern{inclusions=[/api/system/migrate_db., …], exclusions=[/api/properties, …]}]
2020.04.27 01:39:57 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2020.04.27 01:40:20 INFO web[o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy)
2020.04.27 01:40:41 INFO web[o.s.s.s.LogServerId] Server ID: 05178AC4-AXG3BZ4K7T5w_kamXEb8
2020.04.27 01:40:44 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.
2020.04.27 01:40:46 WARN web[o.s.a.s.w.WebService$Action] The response example is not set on action api/plugins/download
2020.04.27 01:40:46 WARN web[o.s.a.s.w.WebService$Action] The response example is not set on action api/permissions/search_templates
2020.04.27 01:40:46 WARN web[o.s.a.s.w.WebService$Action] The response example is not set on action api/bitegarden/report/pdf
2020.04.27 01:40:46 WARN web[o.s.a.s.w.WebService$Action] The response example is not set on action api/bitegarden/report/page
2020.04.27 01:40:46 WARN web[o.s.a.s.w.WebService$Action] The response example is not set on action api/bitegarden/report/odt
2020.04.27 01:40:49 INFO web[o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled.
2020.04.27 01:40:49 INFO web[o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.)
2020.04.27 01:40:49 INFO web[o.s.s.s.GeneratePluginIndex] Generate scanner plugin index
2020.04.27 01:40:49 INFO web[o.s.s.s.RegisterPlugins] Register plugins
2020.04.27 01:40:51 INFO web[o.s.s.s.RegisterMetrics] Register metrics
2020.04.27 01:41:52 INFO web[o.s.s.r.RegisterRules] Register rules
2020.04.27 02:21:29 INFO web[o.s.s.q.BuiltInQProfileRepositoryImpl] Load quality profiles
2020.04.27 02:24:52 INFO web[o.s.s.q.RegisterQualityProfiles] Register quality profiles
2020.04.27 02:24:54 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile css/Sonar way
2020.04.27 02:24:59 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile scala/Sonar way
2020.04.27 02:25:05 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile jsp/Sonar way
2020.04.27 02:25:05 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile kotlin/Sonar way
2020.04.27 02:25:12 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile go/Sonar way
2020.04.27 02:25:17 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile js/Sonar way Recommended
2020.04.27 02:25:36 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile js/Sonar way
2020.04.27 02:25:55 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile py/Sonar way
2020.04.27 02:26:05 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile ruby/Sonar way
2020.04.27 02:26:12 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile cs/Sonar way
2020.04.27 02:26:45 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile java/Sonar way
2020.04.27 02:27:36 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile web/Sonar way
2020.04.27 02:27:40 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile xml/Sonar way
2020.04.27 02:27:42 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile flex/Sonar way
2020.04.27 02:27:50 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile php/Sonar way
2020.04.27 02:28:07 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile php/PSR-2
2020.04.27 02:28:14 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile php/Drupal
2020.04.27 02:28:21 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile vbnet/Sonar way
2020.04.27 02:28:36 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile ts/Sonar way
2020.04.27 02:28:46 INFO web[o.s.s.q.RegisterQualityProfiles] Update profile ts/Sonar way recommended
2020.04.27 02:29:02 INFO web[o.s.s.s.RegisterPermissionTemplates] Register permission templates
2020.04.27 02:29:04 INFO web[o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys
2020.04.27 02:29:11 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@511d089b [pattern=UrlPattern{inclusions=[/api/issues/delete_comment., …], exclusions=[/api/properties, …]}]
2020.04.27 02:29:11 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.DeprecatedPropertiesWsFilter@4ddb01a9 [pattern=UrlPattern{inclusions=[/api/properties/], exclusions=[]}]
2020.04.27 02:29:11 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceReroutingFilter@51d41caf [pattern=UrlPattern{inclusions=[/api/components/bulk_update_key, …], exclusions=[]}]
2020.04.27 02:29:11 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@2d0068aa [pattern=UrlPattern{inclusions=[/sessions/init/
], exclusions=}]
2020.04.27 02:29:11 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@88b279e [pattern=UrlPattern{inclusions=[/oauth2/callback/*], exclusions=}]
2020.04.27 02:29:11 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LoginAction@5e44b85c [pattern=UrlPattern{inclusions=[/api/authentication/login], exclusions=}]
2020.04.27 02:29:11 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LogoutAction@2d206134 [pattern=UrlPattern{inclusions=[/api/authentication/logout], exclusions=}]
2020.04.27 02:29:11 INFO web[o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.ValidateAction@5822dcb7 [pattern=UrlPattern{inclusions=[/api/authentication/validate], exclusions=}]
2020.04.27 02:29:12 INFO web[o.s.s.q.ProjectsInWarningDaemon] Counting number of projects in warning is not started as there are no projects in this situation.
2020.04.27 02:29:12 INFO web[o.s.s.p.p.PlatformLevelStartup] Running Community Edition
2020.04.27 02:29:12 INFO web[o.s.s.p.Platform] WebServer is operational

Hello @Stanley_Tam,

You could turn logs to DEBUG or even TRACE to have more info (check here how to do that). But my guess is that you have an issue with your Oracle DB:

  • either a network/accessibility issue. Is your Oracle DB also runs on Docker? If so, what’s the network driver?
  • or an issue with your Oracle DB itself

Maybe you have some logs on the Oracle side to understand more? You could also ping Oracle from the SQ docker container to see if there is a performance issue at this stage already.