SonarQube 7.9 Azure App Service Deployment - Cannot Load Site

I installed SonarQube 7.9 in an Azure App Service according to: https://github.com/vanderby/SonarQube-AzureAppService

Initially, I had no issues (2 weeks ago). However, starting yesterday, the site times out and I get one of a litany of errors. As of this moment, I am receiving: “500 - The request timed out. The web server failed to respond within the specified time.”

I began receiving yesterday and then this morning, the issue disappeared (not sure if this is related to other work in this tenant, perhaps an app gateway?). However, I was unable to login, no matter the account I attempted. I figured it must be related to a plug-in for Azure AD or a mis config on my part. So, I decided to delete and redeploy.

The initial version of SonarQube was 7.8. Now, after rerunning the installation, I see version 7.9. not sure if that is relevant at all. Regardless, I am not a developer and JUST stepped into a devops role (curse me). I am at my wits’ end with this damn install and I am about to punt and download the vm from Marketplace. But, I HAD IT WORKING the day before yesterday! I ran scans and connected SonarQube to a build pipeline and initiated a scan, now, as we are beginning to roll SonarQube scanning out to my development team, I am dead in the water and look like an ID-10-T.

I don’t know which logs to look into, I started the log streaming service from Azure Web App blade and see the following (it appears to be html meant to be posted in a browser):

2019-07-25T20:14:23 No new trace in the past 3 min(s).IIS Detailed Error - 502.3 - Bad Gateway

HTTP Error 502.3 - Bad Gateway

There was a connection error while trying to route the request.

Most likely causes:

  • The CGI application did not return a valid set of HTTP errors.
  • A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.

Things you can try:

  • Use DebugDiag to troubleshoot the CGI application.
  • Determine if a proxy or gateway is responsible for this error.

Detailed Error Information:

Module    httpPlatformHandler
Notification    ExecuteRequestHandler
Handler    httpplatformhandler
Error Code    0x8007042b
Requested URL    https://SonarQubeAppService:80/
Physical Path    D:\home\site\wwwroot
Logon Method    Anonymous
Logon User    Anonymous

More Information:

This error occurs when a CGI application does not return a valid set of HTTP headers, or when a proxy or gateway was unable to send the request to a parent gateway. You may need to get a network trace or contact the proxy server administrator, if it is not a CGI problem.

View more information »

Microsoft Knowledge Base Articles:

Not sure if the msg is a red-herring, in that it specifies a bad gateway (don’t want to start pointing fingers prematurely).

I also see the following in the sonar.log:

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.

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
java.lang.IllegalStateException: SonarQube requires Java 11+ to run
at org.sonar.application.App.checkJavaVersion(App.java:93)
at org.sonar.application.App.start(App.java:56)
at org.sonar.application.App.main(App.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
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.

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
java.lang.IllegalStateException: SonarQube requires Java 11+ to run
at org.sonar.application.App.checkJavaVersion(App.java:93)
at org.sonar.application.App.start(App.java:56)
at org.sonar.application.App.main(App.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
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.

Ok, after posting I see, in the first error log (posted above) the request url is:
Requested URL https://SonarQubeAppService:80/

Which… is not correct, it should be :443. Any suggestions on how/where to fix?

OK, I have updated the Custom Domain setting in Azure App Service to force https. Trying to load site again…

Greetings!

Thanks for the detailed post. Even if you’re just making a move into a DevOps role, keep making reports like this and you’ll find plenty of people happy to help across the different technologies you’re being introduced to. :slight_smile:

I know nothing about Azure App Service, and you probably won’t find anybody SonarSource-side who does. :frowning: Your best bet might be opening an issue on https://github.com/vanderby/SonarQube-AzureAppService, since they have put this together. At SonarSource, we currently support a more traditional deployment model for production deployments (with Docker coming soon!)… but people can do what they want with SonarQube binaries.

This error…

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
java.lang.IllegalStateException: SonarQube requires Java 11+ to run
at org.sonar.application.App.checkJavaVersion(App.java:93)
at org.sonar.application.App.start(App.java:56)
at org.sonar.application.App.main(App.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped

Pretty cut and dry means SonarQube won’t start – so any proxying that’s being done is going to fail because… the underlying service is down.

The error implies that the version of Java that SonarQube is being starting with (either the default Java for the system or the value defined in conf/wrapper.conf is not a Java 11 JVM. SonarQube v7.9 (note, not 7.8, which is what you were working with before) requires a Java 11 runtime environment.

The README on the SonarQube-AzureAppService says

It also writes the java.exe location to the wrapper.conf file.

So maybe something is breaking down there

Thank you dear baby jesus!

So, yes, the git repo was updated with a new azuredeploy.json with “Java ver 11”…

I am now at least redeployed and the site is up… Thanks for your reply Colin! (stay tuned, now that I have successfully received a reply from the forum, I might be a regular)