简体   繁体   中英

Error while deploying sonarqube on Azure App Service

I am trying to deploy sonarqube on azure web app. Following this article SonarQube-AzureAppService . I have added sonar properties for sonar.jdbc.password, sonar.jdbc.url, sonar.jdbc.username. But looks like elastic search not reachable. I am able to deploy 8.3 version.

    9:04:06 PM Searching for StartSonar.bat
9:04:07 PM File found at: D:\home\site\wwwroot\sonarqube-9.1.0.47736\bin\windows-x86-64\StartSonar.bat
9:04:07 PM Executing StartSonar.bat
wrapper  | Attempt to set the console title failed: The handle is invalid. (0x6)
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    | 
jvm 1    | 2021.10.20 21:04:11 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\home\site\wwwroot\sonarqube-9.1.0.47736\temp
jvm 1    | 2021.10.20 21:04:11 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:49377]
jvm 1    | 2021.10.20 21:04:12 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [D:\home\site\wwwroot\sonarqube-9.1.0.47736\elasticsearch]: D:\Program Files\Java\zulu11.44.13-jre11.0.9-win_x64\bin\java -XX:+UseG1GC -Djava.io.tmpdir=D:\home\site\wwwroot\sonarqube-9.1.0.47736\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 -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 -Djava.locale.providers=COMPAT -Xmx2G -Xms2G -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=D:\home\site\wwwroot\sonarqube-9.1.0.47736\elasticsearch -Des.path.conf=D:\home\site\wwwroot\sonarqube-9.1.0.47736\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2021.10.20 21:04:13 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2021.10.20 21:04:39 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:2078)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1702)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1672)
jvm 1    |  at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:119)
jvm 1    |  at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:64)
jvm 1    |  at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:90)
jvm 1    |  at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:75)
jvm 1    |  at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:60)
jvm 1    |  at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:220)
jvm 1    |  at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:285)
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:262)
jvm 1    |  at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:249)
jvm 1    |  at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:76)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2075)
jvm 1    |  ... 10 common frames omitted
jvm 1    | Caused by: java.net.SocketException: Permission denied: no further information

es.log is also given here.

    2021.10.20 21:06:27 INFO  es[][o.e.n.Node] version[7.14.1], pid[7580], build[unknown/unknown/66b55ebfa59c92c15db3f69a335d500018b3331e/2021-08-26T09:01:05.390870785Z], OS[Windows Server 2016/10.0/amd64], JVM[Azul Systems, Inc./OpenJDK 64-Bit Server VM/11.0.9.1.101/11.0.9.1.101+5-LTS]
2021.10.20 21:06:27 INFO  es[][o.e.n.Node] JVM home [D:\Program Files\Java\zulu11.44.13-jre11.0.9-win_x64]
2021.10.20 21:06:27 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=D:\home\site\wwwroot\sonarqube-9.1.0.47736\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, -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, -Djava.locale.providers=COMPAT, -Des.enforce.bootstrap.checks=true, -Xmx2G, -Xms2G, -XX:+HeapDumpOnOutOfMemoryError, -Delasticsearch, -Des.path.home=D:\home\site\wwwroot\sonarqube-9.1.0.47736\elasticsearch, -Des.path.conf=D:\home\site\wwwroot\sonarqube-9.1.0.47736\temp\conf\es]
2021.10.20 21:06:39 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2021.10.20 21:06:39 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2021.10.20 21:06:39 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2021.10.20 21:06:39 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2021.10.20 21:06:39 INFO  es[][o.e.p.PluginsService] loaded module [runtime-fields-common]
2021.10.20 21:06:39 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2021.10.20 21:06:39 INFO  es[][o.e.p.PluginsService] no plugins loaded
2021.10.20 21:06:39 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[Windows (D:)]], net usable_space [4.2gb], net total_space [34.6gb], types [NTFS]
2021.10.20 21:06:39 INFO  es[][o.e.e.NodeEnvironment] heap size [2gb], compressed ordinary object pointers [true]
2021.10.20 21:06:40 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [2T87AeCgQn2PpKEsUMd1MQ], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2021.10.20 21:07:09 INFO  es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=elasticsearch_configured, chunk_size=256kb, suggested_max_allocation_size=256kb, factors={es.unsafe.use_netty_default_chunk_and_page_size=false, g1gc_enabled=true, g1gc_region_size=1mb}]
2021.10.20 21:07:09 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2021.10.20 21:07:12 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
2021.10.20 21:07:14 INFO  es[][o.e.n.Node] initialized
2021.10.20 21:07:14 INFO  es[][o.e.n.Node] starting ...
2021.10.20 21:07:15 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:49510}, bound_addresses {127.0.0.1:49510}
2021.10.20 21:07:18 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2021.10.20 21:07:18 INFO  es[][o.e.c.c.Coordinator] setting initial configuration to VotingConfiguration{2T87AeCgQn2PpKEsUMd1MQ}
2021.10.20 21:07:20 INFO  es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{2T87AeCgQn2PpKEsUMd1MQ}{d4JvEt_ZQdaWXkZPanuhjw}{127.0.0.1}{127.0.0.1:49510}{cdfhimrsw} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 1, version: 1, delta: master node changed {previous [], current [{sonarqube}{2T87AeCgQn2PpKEsUMd1MQ}{d4JvEt_ZQdaWXkZPanuhjw}{127.0.0.1}{127.0.0.1:49510}{cdfhimrsw}]}
2021.10.20 21:07:22 INFO  es[][o.e.c.c.CoordinationState] cluster UUID set to [dHye825KQiSkOeQAgKc4bw]
2021.10.20 21:07:23 INFO  es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{2T87AeCgQn2PpKEsUMd1MQ}{d4JvEt_ZQdaWXkZPanuhjw}{127.0.0.1}{127.0.0.1:49510}{cdfhimrsw}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
2021.10.20 21:07:23 INFO  es[][o.e.c.r.a.DiskThresholdMonitor] low disk watermark [85%] exceeded on [2T87AeCgQn2PpKEsUMd1MQ][sonarqube][D:\home\site\wwwroot\sonarqube-9.1.0.47736\data\es7\nodes\0] free: 4.2gb[12.2%], replicas will not be assigned to this node
2021.10.20 21:07:23 INFO  es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2021.10.20 21:07:23 INFO  es[][o.e.n.Node] started
2021.10.20 21:07:23 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state

It came up first time after I used S1 as BKU, so some progress. But later when I updated sonar.jdbc.url, sonar.jdbc.username, sonar.jdbc.password (Azure sql DB), It could not load with below errors, Even though es.log says es status is ok.

    2:36:39 PM Searching for StartSonar.bat
2:36:41 PM File found at: D:\home\site\wwwroot\sonarqube-9.1.0.47736\bin\windows-x86-64\StartSonar.bat
2:36:41 PM Executing StartSonar.bat
wrapper  | Attempt to set the console title failed: The handle is invalid. (0x0)
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    | 
jvm 1    | 2021.10.22 14:36:46 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\home\site\wwwroot\sonarqube-9.1.0.47736\temp
jvm 1    | 2021.10.22 14:36:48 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50400]
jvm 1    | 2021.10.22 14:36:49 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [D:\home\site\wwwroot\sonarqube-9.1.0.47736\elasticsearch]: D:\Program Files\Java\zulu11.44.13-jre11.0.9-win_x64\bin\java -XX:+UseG1GC -Djava.io.tmpdir=D:\home\site\wwwroot\sonarqube-9.1.0.47736\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 -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 -Djava.locale.providers=COMPAT -Des.enforce.bootstrap.checks=true -Xmx2G -Xms2G -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=D:\home\site\wwwroot\sonarqube-9.1.0.47736\elasticsearch -Des.path.conf=D:\home\site\wwwroot\sonarqube-9.1.0.47736\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2021.10.22 14:36:49 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2021.10.22 14:36:57 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:2078)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1702)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1672)
jvm 1    |  at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:119)
jvm 1    |  at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:64)
jvm 1    |  at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:90)
jvm 1    |  at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:75)
jvm 1    |  at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:60)
jvm 1    |  at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:220)
jvm 1    |  at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:285)
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:262)
jvm 1    |  at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:249)
jvm 1    |  at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:76)
jvm 1    |  at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2075)
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)
jvm 1    |  at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779)
jvm 1    |  at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
jvm 1    |  at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
jvm 1    |  at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
jvm 1    |  at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
jvm 1    |  at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
jvm 1    |  at java.base/java.lang.Thread.run(Thread.java:834)

I have tested deployed sample WebApp from the same repo and it appears to work without any modifications.

sonarqube 测试部署

测试部署

-To isolate the issue, you may first [test] deploy the WebApp and then try to apply the customization.

-If you haven't done this already, Access the log stream - You can also inspect the log files in a browser at https://.scm.azurewebsites.net/api/logs/docker Also, review - http://sitename.scm.azurewebsites.net/deploymentlogs/ logs.

-Check if removing the settings - WEBSITE_RUN_FROM_PACKAGE from "Application settings" helps.

App Service is a service running on top of the Azure PaaS (platform as a service) infrastructure. App Service runs on a sandboxed environment with restrictions to the underlying machine. Review the files/folder access restrictions: https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox

Note: I'm deleting the test WebApp after this repro.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM