Sonar not working when connected to database and throwing following error

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) sonarqube-9.5.0.56709 (developer Edition)
  • what are you trying to achieve
    i am trying to connect a database to my sonarqube. until yesterday our database was connected to sonar itself. since this afternoon we are getting a different behavior. sonar is running when database is not connected and when database is connected sonar is throwing maintenance page
  • what have you tried so far to achieve this
    i tried changing ports for both sonar.web and elasticsearch
    i tried creating new Empty data database and attached to sonar.

Error: from UI: The specified CGI application encountered an error and the server terminated the process

Error from sonar http platform log files:

2022.07.20 07:18:56 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50438]
jvm 1    | 2022.07.20 07:18:57 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\home\site\wwwroot\sonarqube-9.5.0.56709\elasticsearch]: C:\Program Files\Java\microsoft-jdk-11.0.13.8\bin\java -XX:+UseG1GC -Djava.io.tmpdir=C:\home\site\wwwroot\sonarqube-9.5.0.56709\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djna.tmpdir=C:\home\site\wwwroot\sonarqube-9.5.0.56709\temp -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=COMPAT -Dcom.redhat.fips=false -Des.enforce.bootstrap.checks=true -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\home\site\wwwroot\sonarqube-9.5.0.56709\elasticsearch -Des.path.conf=C:\home\site\wwwroot\sonarqube-9.5.0.56709\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2022.07.20 07:18:57 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | Picked up _JAVA_OPTIONS: -javaagent:'C:\Program Files (x86)\SiteExtensions\JavaApplicationInsightsAgent\3.2.11\java\applicationinsights-agent-codeless.jar'
jvm 1    | 2022.07.20 07:19:05 ERROR app[][o.s.a.p.EsManagedProcess] Failed to check status
jvm 1    | org.elasticsearch.ElasticsearchException: java.util.concurrent.ExecutionException: java.net.SocketException: Permission denied: no further information
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2695)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2171)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:2137)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:2105)
jvm 1    | 	at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:151)
jvm 1    | 	at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:64)
jvm 1    | 	at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:92)
jvm 1    | 	at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:77)
jvm 1    | 	at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:62)
jvm 1    | 	at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:223)
jvm 1    | 	at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:288)
jvm 1    | Caused by: java.util.concurrent.ExecutionException: java.net.SocketException: Permission denied: no further information
jvm 1    | 	at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.getValue(BaseFuture.java:257)
jvm 1    | 	at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:244)
jvm 1    | 	at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:75)
jvm 1    | 	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2692)
jvm 1    | 	... 10 common frames omitted
jvm 1    | Caused by: java.net.SocketException: Permission denied: no further information
jvm 1    | 	at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)

Hi,

Welcome to the community!

Are there errors in any of your other server logs, or just this?

I see that you’re on Windows. Is it possible that some “helpful” process has shut down SonarQube’s permissions to its directories & files?

 
Ann

Thanks for your Reply Ann

i am seeing es.log and sonar.log files

the error i posted is from sonar.log file,

let me get es.log file

this is what i am seeing in es.log file

and to be more specific i am using azure app service and azure sql database

2022.07.20 19:10:39 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2022.07.20 19:10:39 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2022.07.20 19:10:39 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2022.07.20 19:10:39 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2022.07.20 19:10:39 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2022.07.20 19:10:39 INFO  es[][o.e.p.PluginsService] no plugins loaded
2022.07.20 19:10:39 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[Windows (C:)]], net usable_space [13.5gb], net total_space [59.5gb], types [NTFS]
2022.07.20 19:10:39 INFO  es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2022.07.20 19:10:41 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [nprEhIhfRuCOfcfht3UPhg], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2022.07.20 19:10:53 INFO  es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
2022.07.20 19:10:53 INFO  es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2022.07.20 19:10:54 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2022.07.20 19:10:55 INFO  es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2022.07.20 19:10:56 INFO  es[][o.e.n.Node] initialized
2022.07.20 19:10:56 INFO  es[][o.e.n.Node] starting ...
2022.07.20 19:10:56 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:50472}, bound_addresses {127.0.0.1:50472}
2022.07.20 19:10:58 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2022.07.20 19:10:58 INFO  es[][o.e.c.c.Coordinator] cluster UUID [Uqb_nkVSQRaK6DvAjrIyFg]
2022.07.20 19:10:58 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{nprEhIhfRuCOfcfht3UPhg}{GNLkzGFkSa6Phq--IPIp9Q}{127.0.0.1}{127.0.0.1:50472}{cdfhimrsw} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 324, version: 6534, delta: master node changed {previous [], current [{sonarqube}{nprEhIhfRuCOfcfht3UPhg}{GNLkzGFkSa6Phq--IPIp9Q}{127.0.0.1}{127.0.0.1:50472}{cdfhimrsw}]}
2022.07.20 19:10:59 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{nprEhIhfRuCOfcfht3UPhg}{GNLkzGFkSa6Phq--IPIp9Q}{127.0.0.1}{127.0.0.1:50472}{cdfhimrsw}]}, term: 324, version: 6534, reason: Publication{term=324, version=6534}
2022.07.20 19:10:59 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2022.07.20 19:10:59 INFO  es[][o.e.n.Node] started
2022.07.20 19:10:59 INFO  es[][o.e.g.GatewayService] recovered [7] indices into cluster_state
2022.07.20 19:11:23 INFO  es[][o.e.c.r.a.AllocationService] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[components][3], [components][2], [metadatas][0]]]).

Latest log from web.log

2022.07.20 19:11:26 INFO  web[][o.s.p.ProcessEntryPoint] Starting Web Server
2022.07.20 19:11:32 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.5.0.56709 / 3185a5669fdfaf7e4fa6dc7876e0b0dfd5d2aae7
2022.07.20 19:11:32 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://mysqlser.database.windows.net:1433;database=mydatabase;user=myuser@mysqlservername;password=mysqlserver_password;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
2022.07.20 19:11:37 INFO  web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: C:\home\site\wwwroot\sonarqube-9.5.0.56709
2022.07.20 19:11:37 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2022.07.20 19:11:38 INFO  web[][o.s.c.e.CoreExtensionsLoader] Loaded core extensions: developer-edition, developer-scanner, developer-server, license, monitoring
2022.07.20 19:11:39 WARN  web[][o.s.s.p.DatabaseServerCompatibility] The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy ABAP Code Quality and Security / 3.10.0.3628 / 81de0cd6517fb9d5b38f340c6e3ef4639471547d
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Azure Active Directory (AAD) Authentication Plug-in for SonarQube / 1.2.0 / null
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy C# Code Quality and Security / 8.40.0.48530 / 1032f59c84b83ac511bb0ddce6be4e53590df0f3
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy CFamily Code Quality and Security / 6.34.0.48468 / 27072cc5cc92793e7058aeb33b104330a06f65c8
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Configuration detection fot Code Quality and Security / 1.2.0.267 / 4f37ba9ffb37a96d5883e52ad392ed32c5c6eaab
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Dataflow Bug Detection / 1.2.2.1720 / 0
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Dataflow Bug Detection Rules for Java / 1.2.2.1720 / 0
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Flex Code Quality and Security / 2.7.0.2865 / 9e61d9774455b25eefd0b71bf8903cb030641864
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Go Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy HTML Code Quality and Security / 3.6.0.3106 / 963bdc9f051f5dcb698b418790364231aeea04f2
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy IaC Code Quality and Security / 1.7.0.2012 / a006dbf717537ce3a87bb2b6b088597ead3273d1
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy JaCoCo / 1.1.1.1157 / 83478572b9f23efac29de15e30c7758bbb0c0e47
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Java Code Quality and Security / 7.12.0.29739 / 0d02c81aa01624ff348b01257ecf7288bbbe0a16
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy JavaScript/TypeScript/CSS Code Quality and Security / 9.3.0.18033 / 8fd364274dc85afd7e70fe8d86b7427b3f8fe3a9
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Kotlin Code Quality and Security / 2.9.0.1147 / 6ce439214a685d4aabde6461fd609a9a9c1df1c6
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy PHP Code Quality and Security / 3.23.1.8766 / db197ac9daccf3d305ad5e40618a65a95f3d5dde
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy PL/SQL Code Quality and Security / 3.7.0.4372 / 7568b0df0f13d6cc5bdeed885f28bb0297e27d8b
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Python Code Quality and Security / 3.13.0.9611 / 59566828fb593103a5b39147d918b1314561b0e4
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Ruby Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Scala Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Swift Code Quality and Security / 4.6.0.5406 / ec19de464370e5a6b8e80447a10cce67f4553e5f
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy T-SQL Code Quality and Security / 1.6.0.4844 / dc972d64dd69ca1dc9f6a932de729ae0f4e94baf
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Text file Code Quality and Security / 1.1.0.282 / a90347d77706f598413780a08442deec4ae68f4e
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy VB.NET Code Quality and Security / 8.40.0.48530 / 1032f59c84b83ac511bb0ddce6be4e53590df0f3
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Vulnerability Analysis / 9.5.1.16463 / af41e165eb05fe8b32b5698055799293f8ad3037
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Vulnerability Rules for C# / 9.5.1.16463 / af41e165eb05fe8b32b5698055799293f8ad3037
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Vulnerability Rules for JS / 9.5.1.16463 / af41e165eb05fe8b32b5698055799293f8ad3037
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Vulnerability Rules for Java / 9.5.1.16463 / af41e165eb05fe8b32b5698055799293f8ad3037
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Vulnerability Rules for PHP / 9.5.1.16463 / af41e165eb05fe8b32b5698055799293f8ad3037
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy Vulnerability Rules for Python / 9.5.1.16463 / af41e165eb05fe8b32b5698055799293f8ad3037
2022.07.20 19:11:45 INFO  web[][o.s.s.p.ServerPluginManager] Deploy XML Code Quality and Security / 2.5.0.3376 / 3b089c16cf0736c56f4fdb2fc88ddad59e7ca45d
2022.07.20 19:12:15 INFO  web[][o.s.s.p.d.m.c.MssqlCharsetHandler] Verify that database collation is case-sensitive and accent-sensitive
2022.07.20 19:12:15 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://127.0.0.1:9001]
2022.07.20 19:12:17 WARN  web[][o.s.a.s.w.WebService$Action] Description is not set on action api/monitoring/metrics
2022.07.20 19:12:17 WARN  web[][o.s.a.s.w.WebService$Action] Since is not set on action api/monitoring/metrics
2022.07.20 19:12:17 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/monitoring/metrics
2022.07.20 19:12:17 WARN  web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness
2022.07.20 19:12:17 INFO  web[][o.s.s.p.Platform] Database needs to be migrated. Please refer to https://docs.sonarqube.org/latest/setup/upgrading
2022.07.20 19:12:17 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@3dbb3fb7 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/components/update_key, ...]}]
2022.07.20 19:12:17 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 24544

after multiple retries, i found that 9.5 version is not supported for azure app service i guess, so i moved back to my original version 9.0 and my sonar is up now

Hi,

Could you point me to your resource for this, please?

 
Thx,
Ann