SonarQube EE and Azure DevOps integration- PAT is not getting accepted

We have SonarQube EE trail version (i.e,10.1.0.73491) installed and trying to integrate it with Azure DevOps.

We are facing issue while configuring Azure DevOps in SonarQube server. We are providing correct Azure DevOps Organization URL and PAT with code → read&write permissions, PAT generator has project collection administrator access and still it is unable to connect or fetch repo details and getting below error.
Any assistance would be really helpful.

Error : “Invalid Azure URL or Personal Access Token”

Hey there.

Is there any additional information in the logs?

Hi Colin,

Thanks for the reply. Please find the attached log file.
web.log (47.4 KB)

It looks like your SonarQube server is unable to access both Azure DevOps and update.sonarsource.org

2023.08.23 06:41:15 ERROR web[][o.s.a.c.a.AzureDevOpsHttpClient] Unable to contact Azure DevOps server for request [https://dev.azure.com/*******/_apis/projects?api-version=3.0]: [Failed to connect to dev.azure.com/<IP addres>:443]

2023.08.23 06:32:37 ERROR web[AYohF5pjIJfrG/izAAAu][o.s.s.p.UpdateCenterClient] Fail to connect to update center
org.sonar.api.utils.SonarException: Fail to download: https://update.sonarsource.org/update-center.properties

Does your SonarQube server have access to the internet?

No, sonar server does not have full access to internet. It would be restricted for certain sites.
Is it required to have full internet? Any workaround available?

Thank,
Iliyas

Well… if it’s going to get in touch with Azure DevOps for integration (project onboarding, reporting pull request status)… it’s going to have to have access to Azure DevOps.

Hi Colin,

We are able to open/hit above URLs from the browser.
https://update.sonarsource.org/update-center.properties directly on Sonar Server, in such case i am unsure why is it not hitting through Sonar"*

What about https://dev.azure.com?

Yeah we are able to open dev.azure.com as well. Not sure why we got unable to connect log in sonar.

Can we integrate Azure DevOps in Sonar Enterprise trail edition?

Hey there.

Please don’t share screenshots of logs – instead pasting/formatting the logs, including the full stacktrace.

Sure Colin, Let me reply with logs in a better way.

ERROR web[o.s.s.p.w.PlatformServletContextListener] Web server startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.server.platform.db.EmbeddedDatabaseFactory’: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Unable to start database

we are unable to start sonar… Getting above error.

That doesn’t look like the full stacktrace, just a few lines. Take a look at the documentation on Understanding the logs.

Hi Colin,
I have tried after doing small workaround like changing sonar.web.javaOpts to Xmx2g, and from the troubleshooting doc I have removed data/es8 directiories. Both ways didnt work, still facing same below error.

app[o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [C:\SonarQube Setup\sonarqube-enterprise\sonarqube-10.1.0.73491]: C:\Program Files\Java\jdk-17\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\SonarQube Setup\sonarqube-enterprise\sonarqube-10.1.0.73491\temp -XX:-OmitStackTraceInFastThrow --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 --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx2G -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-10.1.0.73491.jar;C:\SonarQube Setup\sonarqube-enterprise\sonarqube-10.1.0.73491\lib\jdbc\h2\h2-2.1.214.jar org.sonar.server.app.WebServer C:\SonarQube Setup\sonarqube-enterprise\sonarqube-10.1.0.73491\temp\sq-process14959511126258774603properties
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/C:/SonarQube%20Setup/sonarqube-enterprise/sonarqube-10.1.0.73491/lib/sonar-application-10.1.0.73491.jar)

Hi Colin,

your assistance will help us a lot. Let us know if we can take any further steps.

How about zipping up your /logs/ directory and attaching it here? I don’t think we’re getting anywhere with snippets of log files.

It was due to proxy enabled in VM. We have resolved this. Thanks for the support.