Code Monkey home page Code Monkey logo

sonarqube-azureappservice's People

Contributors

akuryan avatar blburgess avatar caosborn avatar chiticariu avatar egoremeliyanov avatar epsmae avatar maxipe avatar ricksbrown avatar vanderby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonarqube-azureappservice's Issues

Setting the azure sql settings in the web app settings, yet sonarcube keeps using h2

Hi,
Not sure what is done wrong, but even after setting sonar.jdbc.url sonar.jdbc.password and sonar.jdbc.username in the connection strings settings section and restarting the app, sonarqube continues to start using the embedded database.

I look in sonar.properties, and everything is still in the initial state. Nothing was changed.

Any ideas?

Here is the output when I run HttpPlatformHandlerStartup.ps1 manually

6:16:24 PM Starting HttpPlatformHandler Script
6:16:26 PM Searching for sonar.properties file
6:16:55 PM File found at: D:\home\site\wwwroot\sonarqube-8.3.0.34182\conf\sonar.properties
6:16:55 PM Resetting properties.
6:16:55 PM Updating sonar.properties based on environment/application settings.
6:16:55 PM HTTP_PLATFORM_PORT is:
6:16:55 PM Updating sonar.web.port to
6:16:55 PM Saving updated sonar.properties contents
6:16:55 PM Searching for wrapper.conf file
6:17:01 PM File found at: D:\home\site\wwwroot\sonarqube-8.3.0.34182\conf\wrapper.conf
6:17:01 PM Writing to wrapper.conf file
6:17:01 PM Searching for duplicate plugins.
6:17:01 PM Searching for StartSonar.bat
6:17:07 PM File found at: D:\home\site\wwwroot\sonarqube-8.3.0.34182\bin\windows-x86-64\StartSonar.bat
6:17:07 PM Executing StartSonar.bat
wrapper | Unable to set the process priority: Access is denied. (0x5)
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 | 2020.05.06 18:17:18 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\home\site\wwwroot\sonarqube-8.3.0.34182\temp
jvm 1 | 2020.05.06 18:17:18 ERROR app[][o.s.application.App] Startup failure
jvm 1 | java.nio.file.FileSystemException: D:\home\site\wwwroot\sonarqube-8.3.0.34182\temp\ce-exploded-plugins\csharp\sonar-csharp-plugin-8.6.1.17183.jar: The process cannot access the file because it is being used by another process.
jvm 1 |
jvm 1 | at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
jvm 1 | at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
jvm 1 | at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
jvm 1 | at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:270)
jvm 1 | at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
jvm 1 | at java.base/java.nio.file.Files.delete(Files.java:1141)
jvm 1 | at org.sonar.process.FileUtils2$DeleteRecursivelyFileVisitor.visitFile(FileUtils2.java:192)
jvm 1 | at org.sonar.process.FileUtils2$DeleteRecursivelyFileVisitor.visitFile(FileUtils2.java:186)
jvm 1 | at java.base/java.nio.file.Files.walkFileTree(Files.java:2724)
jvm 1 | at java.base/java.nio.file.Files.walkFileTree(Files.java:2796)
jvm 1 | at org.sonar.process.FileUtils2.deleteDirectoryImpl(FileUtils2.java:148)
jvm 1 | at org.sonar.process.FileUtils2.deleteDirectory(FileUtils2.java:121)
jvm 1 | at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:117)
jvm 1 | at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:101)
jvm 1 | at java.base/java.nio.file.Files.walkFileTree(Files.java:2724)
jvm 1 | at org.sonar.application.AppFileSystem.createOrCleanTempDirectory(AppFileSystem.java:96)
jvm 1 | at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:62)
jvm 1 | at org.sonar.application.App.start(App.java:63)
jvm 1 | at org.sonar.application.App.main(App.java:98)
jvm 1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
jvm 1 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
jvm 1 | at java.base/java.lang.reflect.Method.invoke(Method.java:566)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1 | at java.base/java.lang.Thread.run(Thread.java:834)
wrapper | <-- Wrapper Stopped

How to increase max request length ?

Hi,

We're using your (great) code to deploy our Sonarqube in Azure Webapp.

It works like a charm, except for one feature. When we analysed a project, we'd like to go to the window "measures" but when we get here, we only get some The request cannot be processed. Try again later.

sonar_issue

Actually, after some digging, it turns out this seems to be some kind of badly configuration set up.

But because I'm (really) not an expert in Azure web app, I don't know where to "increase this request size".

Could you help me on this ? May be you already have this kind of issue and I'm totally misunderstanding the problem

Best regards,

LvffY

Deploying with Private Repo

Hi
I'm trying to deploy SonarQube into Azure App service using the same scripts inside this repository. But for my use case, I want to deploy the code (scripts) directly from my Private Azure Repo instead of going through the Public GitHub repo as a value to the "repoUrl" parameters. Can you please help me with the same?

Error while starting sonarqube on Azure App Service

hi, i got a sonarqube community edition hosted on Azure Web App (S1 - Windows).
The HttpPlatformHandler fail at each start of the website and i got "The specified CGI application encountered an error and the server terminated the process" message on the website.

The Azure Web App is set to work on https only.

I try to find informations in the log.
I was able to get this file.

8:56:40 AM Starting HttpPlatformHandler Script
8:56:41 AM Searching for sonar.properties file
8:56:45 AM File found at: C:\home\site\wwwroot\sonarqube-9.0.1.46107\conf\sonar.properties
8:56:45 AM Resetting properties.
8:56:45 AM Updating sonar.properties based on environment/application settings.
8:56:45 AM Setting sonar.jdbc.password to XXXXX
8:56:45 AM Setting sonar.jdbc.url to XXXXX
8:56:45 AM Setting sonar.jdbc.username to XXXXX
8:56:45 AM HTTP_PLATFORM_PORT is: 1994
8:56:45 AM Updating sonar.web.port to 1994
8:56:45 AM Saving updated sonar.properties contents
8:56:45 AM Searching for wrapper.conf file
8:56:48 AM File found at: C:\home\site\wwwroot\sonarqube-9.0.1.46107\conf\wrapper.conf
8:56:48 AM Writing to wrapper.conf file
8:56:48 AM Searching for duplicate plugins.
Compare-Object : Cannot bind argument to parameter 'ReferenceObject' because 
it is null.
At C:\home\site\wwwroot\HttpPlatformHandlerStartup.ps1:97 char:47
+ $duplicates = Compare-Object -ReferenceObject $uniquePlugins -Differe ...
+                                               ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Compare-Object], ParameterBind 
   ingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,M 
   icrosoft.PowerShell.Commands.CompareObjectCommand
 
8:56:48 AM Searching for StartSonar.bat
8:56:51 AM File found at: C:\home\site\wwwroot\sonarqube-9.0.1.46107\bin\windows-x86-64\StartSonar.bat
8:56:51 AM Executing StartSonar.bat
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Error: Could not find or load main class Main
jvm 1    | Caused by: java.lang.ClassNotFoundException: Main
wrapper  | JVM exited while loading the application.
wrapper  | Launching a JVM...
jvm 2    | Error: Could not find or load main class Main
jvm 2    | Caused by: java.lang.ClassNotFoundException: Main
wrapper  | JVM exited while loading the application.
wrapper  | Launching a JVM...
jvm 3    | Error: Could not find or load main class Main
jvm 3    | Caused by: java.lang.ClassNotFoundException: Main
wrapper  | JVM exited while loading the application.
wrapper  | Launching a JVM...
jvm 4    | Error: Could not find or load main class Main
jvm 4    | Caused by: java.lang.ClassNotFoundException: Main
wrapper  | JVM exited while loading the application.
wrapper  | Launching a JVM...
jvm 5    | Error: Could not find or load main class Main
jvm 5    | Caused by: java.lang.ClassNotFoundException: Main
wrapper  | JVM exited while loading the application.
wrapper  | There were 5 failed launches in a row, each lasting less than 300 seconds.  Giving up.
wrapper  |   There may be a configuration problem: please check the logs.
wrapper  | <-- Wrapper Stopped
Press any key to continue . . . 
8:57:17 AM Exiting HttpPlatformHandler Script

If you need more information i will be happy to provide more files or informations.

sonar.properties and wrapper.conf grows large with repetition

I have some JDBC settings in the App Service configuration, which gets injected into sonar.properties correctly..... except it seems to replicate the whole file contents a few hundred times. A fresh install is 21kb, but after starting up it grows to 42201kb! It's the same 400 lines (with the right replacements) copied repeatedly.

Same thing with the wrapper.conf - it grows to 14114kb

I was under the impression the HttpPlatformHandler.ps1 file replaces the content rather than appends it to the end. I did not change the script at all from the latest master copy.

The file seems to be capped at that size. It doesn't double every time I restart the Web App either. Weird!

Anyone else having this issue?

Sonarqube 9.2.4 upgrade

So we upgraded to Sonarqube version 9.2.4 and everything appeared to work until we run our first build and it errored out on the analysis with the error

ERROR: Error during SonarScanner execution
java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Anyone successfully get version 9.2.4 running in an app service? My web app is configured for Java 11 and minor is 11 with auto upgrade. Any thoughts?

Can't start sonarqube and getting the specified CGI application encountered an error and the server terminated the process.

Sonarqube version : Developer edition 9.7.1.62403

I've successfully run it on another App service but I want to move it to another resource group. After I clone the app, I can't run it and always got this error.
The specified CGI application encountered an error and the server terminated the process.

Here is the sonar.log
image

Here is the web.log
image

Can anyone please help for this issue? I've been googling for past few hours and try different things like changing ports but still can't make it works. It looks like permission denied error but I have no idea what is that, I can run it in another app service. I always stop other app service before running another to make sure only 1 sonarqube server is running.

Thank you in advance.

SQ comments all lines in sonar.properties when restarted

Hello
Thank you for great config.
I have very strange case.
i update sonar.properties. (sql connection info), restart SQ (both as web app from azure portal or from SQ UI)
and it just comments my string. not replaces, but comment. every time i restart SQ
Can you please help me in fixing that?

Ghost duplicated

I’ve tried to deploy sonarqube, and it follows the following error
"status": "Failed",
"error": {
"code": "Conflict",
"message": "Website with given name SonarQubeAppService already exists.", "details": [
{ "message": "Website with given name SonarQubeAppService already exists." },
{ "code": "Conflict" },
{}
]
}}
But when I go to the webapp list “SonarQubeAppService” doesn’t show up

Access denied error when starting the Web App

I've used this ARM template succesfully in the past but somehow I'm now seeing the following in the logs after deployment:

5:13:06 PM Starting HttpPlatformHandler Script
5:13:06 PM HTTP_PLATFORM_PORT is: 20471
5:13:06 PM Searching for sonar.properties file
5:13:14 PM File found at: D:\home\site\wwwroot\sonarqube-7.7\conf\sonar.properties
5:13:14 PM Writing to sonar.properties file
5:13:14 PM Searching for wrapper.conf file
5:13:15 PM File found at: D:\home\site\wwwroot\sonarqube-7.7\conf\wrapper.conf
5:13:15 PM Writing to wrapper.conf file
5:13:15 PM Searching for StartSonar.bat
5:13:16 PM File found at: D:\home\site\wwwroot\sonarqube-7.7\bin\windows-x86-64\StartSonar.bat
5:13:16 PM Executing StartSonar.bat
wrapper  | Unable to set the process priority:  Access is denied. (0x0)
wrapper  | Attempt to set the console title failed: The handle is invalid. (0x6)
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
wrapper  | Startup failed: Timed out waiting for a signal from the JVM.
wrapper  | JVM did not exit on request, terminated
wrapper  | JVM Restarts disabled.  Shutting down.
wrapper  | <-- Wrapper Stopped
Press any key to continue . . . 

Any idea what's going on? I've googled for the issue but haven't found a solution yet.

Thanks,
Wouter

ZipDeploy Deletes Files From Deploy To Azure

Zip deploy deletes the project files deployed through Deploy To Azure. This is because the files are flagged as from a deployment so they are removed when the zip is uploaded.

How to upgrade this solution to solve the Log4J security issue?

Since a few months there is a Log4J bug which concerns the current SonarQube production instance. I want to upgrade the Azure app service and the only thing I found was a comment about a deployment slot on SonarQube Hosted On Azure App Service. However since that information does not help very much, I created a deployment slot using the External Git repo variant. The deployment succeeded but the SonarQube instnce does not come up (The specified CGI application encountered an error and the server terminated the process). SonarQube logs do not really help neither. So I can not upgrade this way. Did I do something wrong or is there another way?

By the way, the SonarQube production version is 9.2.1 (build 49989). The upgrade version is 9.2.4, build 50792.

Elastic Search permission denied

Hello, I'm seeing some issues trying set up a new App Service. There is an existing database I'm attempting to connect to. My SQL Server and App Service are set up on the same v-net and I've tested their connection through the App Service network troubleshooting. Here's the logs I'm seeing:

10:18:37 PM Starting HttpPlatformHandler Script
10:18:37 PM Searching for sonar.properties file
10:18:38 PM File found at: D:\home\site\wwwroot\sonarqube-9.5.0.56709\conf\sonar.properties
10:18:38 PM Resetting properties.
10:18:38 PM Updating sonar.properties based on environment/application settings.
10:18:38 PM Setting sonar.jdbc.password to XXXXXXXXXX
10:18:38 PM Setting sonar.jdbc.url to jdbc:sqlserver://XXXXXXXXXX:1433;database=sonarqube;encrypt=true;
10:18:38 PM Setting sonar.jdbc.username to sonar-admin
10:18:38 PM HTTP_PLATFORM_PORT is: 6226
10:18:38 PM Updating sonar.web.port to 6226
10:18:38 PM Saving updated sonar.properties contents
10:18:38 PM Searching for wrapper.conf file
10:18:39 PM File found at: D:\home\site\wwwroot\sonarqube-9.5.0.56709\conf\wrapper.conf
10:18:39 PM Writing to wrapper.conf file
10:18:39 PM Searching for duplicate plugins.
Compare-Object : Cannot bind argument to parameter 'ReferenceObject' because 
it is null.
At D:\home\site\wwwroot\HttpPlatformHandlerStartup.ps1:97 char:47
+ $duplicates = Compare-Object -ReferenceObject $uniquePlugins -Differe ...
+                                               ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Compare-Object], ParameterBind 
   ingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,M 
   icrosoft.PowerShell.Commands.CompareObjectCommand
 
10:18:39 PM Searching for StartSonar.bat
10:18:40 PM File found at: D:\home\site\wwwroot\sonarqube-9.5.0.56709\bin\windows-x86-64\StartSonar.bat
10:18:40 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    | 2022.07.11 22:18:45 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\home\site\wwwroot\sonarqube-9.5.0.56709\temp
jvm 1    | 2022.07.11 22:18:45 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50606]
jvm 1    | 2022.07.11 22:18:46 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [D:\home\site\wwwroot\sonarqube-9.5.0.56709\elasticsearch]: D:\Program Files\Java\microsoft-jdk-11.0.13.8\bin\java -XX:+UseG1GC -Djava.io.tmpdir=D:\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=D:\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=D:\home\site\wwwroot\sonarqube-9.5.0.56709\elasticsearch -Des.path.conf=D:\home\site\wwwroot\sonarqube-9.5.0.56709\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2022.07.11 22:18:46 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2022.07.11 22:18:51 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)
jvm 1    | 	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777)
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:829)
jvm 1    | 2022.07.11 22:18:51 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

Pointing Sonarqube to another DB

How do we update the app service to point to a different DB? Are their environment variables we would update with the new DB url, password, schema etc

Error while deploying sonarqube on Azure App Service

I am trying to deploy sonarqube on azure web app enterprise version 9.1.0.47736. Following this article (GitHub - vanderby/SonarQube-AzureAppService: Instructions and files to host SonarQube on an Azure App Service without a container.). 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.

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

Terraform deployment script

Hey guys,
this looks like an amazing project! Thank you for this.

Could you provide a terraform version of the deployment script as well?

Kind regards

Deployment failing

Hi,

Deployment seems to be failing due to the fact that Deploy-SonarQubeAzureAppService.ps1 can't list the necessary image within sonarsource s3 bucket

Error: Invoke-WebRequest : The remote server returned an error: (404) Not Found.\r\nAt C:\home\site\repository\Deploy-SonarQubeAzureAppService.ps1:83 char:25\r\n+ ... llDownloads = Invoke-WebRequest -Uri $downloadSource -UseBasicParsing\r\n+

Logs :
log.log

Upon further inspection the when script tries to get $downloadSource it returns an empty object

Scaling down the App Service Plan

Is it possible to scale down the service plan that the app uses to the F1 (Free) sku?

I have been using your solution for a while now and it works great. One of the niggles I have is to look into being able to power it down when it is not needed. I ran into a wall quickly trying to set the Service Plan to the free sku as the app has the 'Always On' set to True so i added to my todo list.
Looking at your script, it looks like the 'Always on' property is set based on the environment variable Env:WEBSITE_SCM_ALWAYS_ON_ENABLED.

When i set it to false in general settings for the app, a quick refresh puts it back again and i assume this is because the environment is overwritten somehow?

I can sort of achieve what i want by issuing the following shell commands:

az webapp config set --name myapp --resource-group myapp-rg --always-on false
az appservice plan update --name myapp-asp --resource-group myapp-rg --sku F1
az appservice plan update --name myapp-asp --resource-group myapp-rg --sku S1

but when i issue the first one, Sonarqube stops working as again, i assume i have changed something directly that the environment doesnt like and there is some refreshing going on.

you'll have to forgive me because I am not that familiar with the process that is going on, i have tried various other solutions as well so i know more than i want about a lot of different solutions (docker containers, azure container instances, azure repo with custom docker, the problems with the elastic search etc. etc.) and all i want to do is get SQ up and running centrally but with the ability to scale up / down quickly as part of a build in Devops or via turned on in the working day for review of the current analysis.

I would be just as happy with a solution like yours that ran on linux and was able to run the later versions of SQ for the latest fixes / rules and I already have a database with analysis in

stopping and starting the app service

Firstly,
I would like to say that this is great when working however,
whenever I attempt to update the marketplace plugins within SonarQube, (azure AD, SonarQube Gateway and rule update, etc)

the app restart but hits 502/404/400 error....even after restarting the box several times.

I'm using the S2 and P1
because it seems to be complaining about memory and high CPU.

image

I;ve been tempted to not do any updates to SonarQube because we need static code analyzing in place asap.

any ideas?

Works wth 7.9.1 or 8.0?

does this work with the latest LTS release or 8.0? We tried to run the docker container as an app service but this failed as soon as we switched to an SQL database because elastic search needed settings to vm.max_map_count which isn't possible for an container app service. Could you confirm this solution doesn't have this restriction? Running as an app service would have some advantages for us.

Deploy to azure button not working?

ATM the deploy to azure button doesn't let me create the app service in an existing resource group.

image

I do have contributor rights on that resource group and i am able to create resources in it via the azure portal.

Any hints?

SonarQube 504 Gateway Timeout Error

I'm using this app service setup to run SonarQube. As of late, we have been experiencing outages with the error 504 Gateway Timeout. I have reached out to SonarQube and they informed me to reach out to you guys since you are the maintainers. It is causing our pipelines to fail and we can't open our SonarQube site. Any idea why this keep happening? Is there anything we need/can to do to prevent these types of interruptions going forward?

Developer Edition

Hi @vanderby ,

I have tried to deploy the Sonarqube developer edition to azure web service, but I couldn't achieve that. I have selected the sonarqube version as the developer edition on the "deploy azure" menu, but my sonarqube service still community edition.

Could you please help me with this issue? Is there a point I missed?

Thanks,
Burak

SonarQube has stopped working

This has been up and running without issue for a couple of months which was great. I recently found that a couple of builds had failed due to SonarQube self updating, no big issue I thought I'll just give it time but it now appears to have stopped working completely and I get 502 (502 - Web server received an invalid response while acting as a gateway or proxy server.), I have no idea how I can fix it as my only access was to the site dashboard, can anyone suggest anything or have faced the same issue over the past week?
Will I have to face the pain of simply re-deploying a new instance?

wrapper.conf & sonar.properties get 0-byted

Hey Vanderby,
Not sure the root cause of this, but hoping you have an idea...
We note from time to time that wrapper.conf &/or sonar.properties become 0-bytes, which obviously breaks everything.

Trying find the root cause, we are wondering if it is the httpplatformhandler script is the cause (get-content followed by set-content - if the file is still locked?)
If so, why would that be? Could the script be made a bit more robust around this problem?

Cheers!

App service unable to launch with Azure SQL

Hello Vanderby,

This is a simple integration with Azure SQL but unfortunately not working for me. JDBC settings are updated per instructions and can see reflecting in sonar.properties file as well.

It always return generic errors either
"502 - Web server received an invalid response while acting as a gateway or proxy server." or
"The specified CGI application encountered an error and the server terminated the process."

No firewall configured for Azure SQL server and verified as I'm able to connect to Azure SQL db using SSMS.

Enabled app insights and log analytics but no hint. I can see that every time I restart app service, all steps in powershell run and logged properly.

Could you please help. Thanks.

Deploying with existing App Service Plan

Is this a supported scenario? I already have several App Services running in an existing App Service Plan, thus it would not make much sense to create a new one just for this one application. Did I miss something on how to re-use an existing App Service Plan?

HTTP Error 502.3 - Bad Gateway

I ran the script and everything reported success ..
When I try to browse to the provided URL in Azure I get the bad gateway error

HTTP Error 502.3 - Bad Gateway
There was a connection error while trying to route the request.

I'm not an Azure developer so I have no idea how to resolve this ...

Elastic Search Indexing failing

Hey. We deployed this as an app service on a shared app service plan (S2 I think)

It started to fail after a couple weeks with this issue
https://community.sonarsource.com/t/analysis-failed-with-unrecoverable-indexation-failures/12329/2

The log suggests that we've run out of space but the disk space on the service plan is 50GB with 47GB free

2020.04.15 11:09:51 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[Windows (D:)]], net usable_space [1.2gb], net total_space [31.6gb], types [NTFS]

Any idea why I'm running into this?

Could not find wrapper.conf in Sonarqube 9.6 version

Hello, When we are trying to deploy with Sonarqube version of 9.6 we are encountering below error. Seems like sonarqube has removed wrapper.conf file.

9:30:55 AM Updating sonar.web.port to 16316
9:30:55 AM Saving updated sonar.properties contents
9:30:55 AM Searching for wrapper.conf file
9:30:56 AM Could not find wrapper.conf

Here is the thread around the same -> https://community.sonarsource.com/t/wrapper-conf-missing-from-9-6-zip-files/70161

May be required HttpPlatformHandlerStartup.ps1 should be updated to be using the new way of launching sonarqube.

Problem with Azure SQL

When I initially deployed the site worked fine with internal database. I'm trying to change to use Azure SQL Server now. I've updated sonar.properties file to set sonar.jdbc.username, sonar.jdbc.password and sonar.jdbc.url. SonarQube connected to the database and created tables but I get following errors in sonar.log:

2019.07.04 05:49:29 WARN  app[][o.s.application.App] SonarQube will require Java 11+ starting on next version
2019.07.04 05:49:29 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\home\site\wwwroot\sonarqube-7.8\temp
2019.07.04 05:49:29 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.07.04 05:49:29 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [D:\home\site\wwwroot\sonarqube-7.8\elasticsearch]: D:\Program Files\Java\zulu8.31.0.2-jre8.0.181-win_x64\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -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 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=D:\home\site\wwwroot\sonarqube-7.8\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.enforce.bootstrap.checks=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=D:\home\site\wwwroot\sonarqube-7.8\elasticsearch -Des.path.conf=D:\home\site\wwwroot\sonarqube-7.8\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2019.07.04 05:49:29 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.07.04 05:49:30 INFO  app[][o.e.p.PluginsService] no modules loaded
2019.07.04 05:49:30 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Unable to set the process priority:  Access is denied. (0x0)
Attempt to set the console title failed: The handle is invalid. (0x6)
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

What do I need to do to fix this?

For Commercial editions

Hi, Will I be able to use commercial edition of sonarqube by just changing the default value of sonarqube edition in azuredeploy.json file ? or any additional steps will be required

upgrade versions in-place?

Per the title, is it possible to upgrade versions in place? Is it recommended?

Currently we've been using this at 8.7, and don't see any issues upgrading. The solution has treated us well so far, we're just trying to keep things up-to-date where we can.

Azure Sql database changes not working with Azure app service!! How to change Admin Password??

Hi Vanderby,
I have updated the sql database config changes in app settings. I restarted the azure app. Still it is showing unauthorized. I am using default sa user credentials. Could you please advice on the same.

2019.11.20 00:01:52 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\home\site\wwwroot\sonarqube-8.0\temp

WrapperSimpleApp: Encountered an error running main: java.nio.file.FileSystemException: D:\home\site\wwwroot\sonarqube-8.0\temp\ce-exploded-plugins\csharp\sonar-csharp-plugin-7.17.0.9346.jar: The process cannot access the file because it is being used by another process.

java.nio.file.FileSystemException: D:\home\site\wwwroot\sonarqube-8.0\temp\ce-exploded-plugins\csharp\sonar-csharp-plugin-7.17.0.9346.jar: The process cannot access the file because it is being used by another process.

at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.base/java.nio.file.Files.delete(Unknown Source)
at org.sonar.process.FileUtils2$DeleteRecursivelyFileVisitor.visitFile(FileUtils2.java:192)
at org.sonar.process.FileUtils2$DeleteRecursivelyFileVisitor.visitFile(FileUtils2.java:186)
at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
at org.sonar.process.FileUtils2.deleteDirectoryImpl(FileUtils2.java:148)
at org.sonar.process.FileUtils2.deleteDirectory(FileUtils2.java:121)
at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:117)
at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:101)
at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
at org.sonar.application.AppFileSystem.createOrCleanTempDirectory(AppFileSystem.java:96)
at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:62)
at org.sonar.application.App.start(App.java:62)
at org.sonar.application.App.main(App.java:98)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.base/java.lang.Thread.run(Unknown Source)

<-- Wrapper Stopped
Unable to set the process priority: Access is denied. (0x5)
Attempt to set the console title failed: The handle is invalid. (0x6)
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.

2019.11.20 00:03:12 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\home\site\wwwroot\sonarqube-8.0\temp
2019.11.20 00:03:13 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.11.20 00:03:14 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [D:\home\site\wwwroot\sonarqube-8.0\elasticsearch]: D:\Program Files\Java\zulu11.29.3-jre11.0.2-win_x64\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -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 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=D:\home\site\wwwroot\sonarqube-8.0\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.enforce.bootstrap.checks=true -Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=D:\home\site\wwwroot\sonarqube-8.0\elasticsearch -Des.path.conf=D:\home\site\wwwroot\sonarqube-8.0\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2019.11.20 00:03:14 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.11.20 00:03:15 INFO app[][o.e.p.PluginsService] no modules loaded
2019.11.20 00:03:15 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.11.20 00:04:10 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2019.11.20 00:04:10 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [D:\home\site\wwwroot\sonarqube-8.0]: D:\Program Files\Java\zulu11.29.3-jre11.0.2-win_x64\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\home\site\wwwroot\sonarqube-8.0\temp --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.|[::1] -cp ./lib/common/;D:\home\site\wwwroot\sonarqube-8.0\lib\jdbc\mssql\mssql-jdbc-7.2.2.jre11.jar org.sonar.server.app.WebServer D:\home\site\wwwroot\sonarqube-8.0\temp\sq-process6862961921063235828properties
2019.11.20 00:15:30 INFO app[][o.s.a.SchedulerImpl] Process[web] is up
2019.11.20 00:15:30 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='ce', ipcIndex=3, logFilenamePrefix=ce]] from [D:\home\site\wwwroot\sonarqube-8.0]: D:\Program Files\Java\zulu11.29.3-jre11.0.2-win_x64\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\home\site\wwwroot\sonarqube-8.0\temp --add-opens=java.base/java.util=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.|[::1] -cp ./lib/common/;D:\home\site\wwwroot\sonarqube-8.0\lib\jdbc\mssql\mssql-jdbc-7.2.2.jre11.jar org.sonar.ce.app.CeServer D:\home\site\wwwroot\sonarqube-8.0\temp\sq-process5618927092452894067properties
2019.11.20 00:15:49 INFO app[][o.s.a.SchedulerImpl] Process[ce] is up
2019.11.20 00:15:49 INFO app[][o.s.a.SchedulerImpl] SonarQube is up

Upgrading the SonarQube Server to a newer version

I just installed SonarQube using your work. I'm really impressed with the ease of the install as well as "moving" to a real database (Azure SQL) subsequently.

I've run into an issue with creating my own quality gate and the 7.9.1 version included a fix. Now, my challenge is upgrading the SonarQube instance.

I've read through the SonarQube guide, but I'm uncertain about how to "translate" that to upgrading the SonarQube instance I now have hosted in an Azure App Service. Any pointers are greatly appreciated.

Thanks,
Bjarne

Upgrading sonarqube running on azure web app

I have been reading up on how to update Sonarqube, we currently run v 9.5 and I need to go to v 9.9. I have read it several times and I am struggling to understand how to upgrade.

My configuration is currently running on Azure as an App service, to upgrade to v 9.9, I have added a configuration key & value called

[
{
"name": "SonarQubeEdition",
"value": "Community",
"slotSetting": false
},
{
"name": "SonarQubeOldVersion",
"value": "9.5.0.56709",
"slotSetting": false
},
{
"name": "SonarQubeVersion",
"value": "9.9.0.65466",
"slotSetting": false
}
]

The rest of the instructions isnt clear.

I have stopped the app as per 63196fe

Added update instructions in README.md by akuryan · Pull Request #78 · vanderby/SonarQube-AzureAppService
Instructions and files to host SonarQube on an Azure App Service without a container. - Added update instructions in README.md by akuryan · Pull Request #78 · vanderby/SonarQube-AzureAppService
github.com

However, its not clear where the powershell script should run or how to run it. Can someone please expand further with clear instructions.

SonarQube flood stage disk watermark [95%] exceeded on

I am raising this issue here as it is specific to the way Azure App Service allocates disk space on the D drive and D:/home folder. I have not been able to work around this and there are 1 or 2 posts online with the same issue with no robust resolution.

WARN es[][o.e.c.r.a.DiskThresholdMonitor] flood stage disk watermark [95%] exceeded on [0WrMWG4XSEObU4chJQUUvg][sonarqube][D:\home\site\wwwroot\sonarqube-7.9\data\es6\nodes\0] free: 1.2gb[3.9%], all indices on this node will be marked read-only

elastic/elasticsearch#53233

#35

The above post mentioned scaling up the App Service Plan but this doesn't work if your index is approaching 30GB and is marked as Closed.

The Elasticsearch index in SonarQube is set to a 95% disk threshold meaning that when used disk space is going to exceed 95% then Elasticsearch writes a warning in the es.log file and tries to write to another node. However there are no other nodes so the indexing enters an infinite loop. In Elasticsearch you can tweak these settings in the elasticsearch.yml file, e.g. you can turn this check off. However SonarQube seems to ignore this yml file and creates a temporary one on startup in a temp folder. I tried adding cluster.routing.allocation.disk.threshold_enabled: false to the yml file which was ignored on App Service restart. I did this to prevent Elasticsearch from checking disk space as I have allocated way more than enough in the App Service Plan.

The more canny might state well just add more disk space (if only it was that straight forward). Scaling up an App Service Plan adds more disk space to D:/home but not D:/ which seems to be the OS disk and is fixed around 32GB. D:/home is what looks like a symbol link or share which is actually a dedicated disk from the App Service Plan. I have the plan at 250GB which I can see in Kudu (Azure environment tool). It looks like Elasticsearch is using the free disk space on D: and not the folder where the index is stored e.g. D:/home/site/wwwroot/.../data.

I suspect this issue cannot be solved in Azure, SonarQube doesn't honour Elasticsearch settings and Elasticsearch just uses the Java libraries to check free disk space. What I am trying to say is I don't think any of the 3 would take ownership and solve this problem, rendering the App Service deployment only fit for small deployments with small indexes. This is a shame as in my opinion this deployment is the most manageable and robust option.

If anybody is able to tell me otherwise I would be delighted to see a resolution. Thank you.

Latest Version of Sonarqube is not downloaded

Assuming the user has:
SonarQubeVersion=Latest
SonarQubeEdition=Community

I noticed in Deploy-SonarQubeAzureAppService.ps1:

$sortedZipFiles = $zipFiles | Sort-Object -Property @{ Expression = { [Version]([RegEx]::Match($_.href, '\d+.\d+.?(\d+)?.zip').Value -Split ".zip")[0] } }
        $latestFile = $sortedZipFiles[-1]

$latestFile will turn out to be sonarqube-8.0.zip, which is incorrect. The latest version is: sonarqube-8.2.0.32929.zip.

Is it safe to say if you comment-out/remove the code above? Then change to:

$latestFile = $zipFiles[-1]

I believe it is safe to assume the webpage will always have the latest version at the bottom/end; hence there is no need to perform a sort on the zip files and grab the last item.

App service poor performance

We compared the performance of this solution against a vm approach. It took the sonarqube vm 3 minutes to analyze the scan results while the app service needed 1 hour and 3 minutes! Our app service is on a S1 plan and we analyzed a ~500k lines of coude project with several thousand warnings in the result.

Are there any settings we could make for the app service to increase performance? What would you say is the minimum sku to get a usable solution for medium to large projects?

Sonarqube are using Revisions in their version number, and it breaks the downloader

The downloader regex '\d+.\d+.?(\d+)?.zip' is expecting a version number in the style #.#.# but for the last two releases they have used a Revision number (#.#.#.# eg 8.2.0.32929).

I tweaked the regex for my install to '\d+(.\d+)*.zip' which seems to work for now, but I don't know if it robust to survive further combinations. You might want to double check my regex logic :)

My SonarQube Server is Saying UnderMaintainance

I have used the Direct Approach and Added the External Git url to my Azure App Service. It is working fine till last month but suddenly stopped working. So, i did sync and now its asking for upgrade. Can you please tell me what needs to be done for this.
image

Can you please suggest what needs to be done.

How to change the DB?

This deployment comes with embedded H2 database.
How can I change it to PostgreSQL?

I added the keys with appropriate values to Application Settings, but it still works on H2.

SONARQUBE_JDBC_USERNAME
SONARQUBE_JDBC_PASSWORD
SONARQUBE_JDBC_URL

Howto rescue admin password?

I deployed by oneclick last days ago, fantastic!
Today I tryed to relogin but... I forgotted the changed admin password :(

Before destroy and redeolpy all, there is any possibility to access to the db resources and configuration files?

Another question: is it possible to integrate AzureAD identity? In my on premise installation I'm using LDAP plugin.

Thanks in advance

Carlo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.