Sonarqube integration error in azure pipelines

How can we resolve this issue run code analysis is getting failed . using ngrok we are accessing the sonarqube .

Hey there.

It depends where the 500 is coming from – if it’s ngrok or SonarQube. The latter we can help with… the former you would need to ask ngrok.

  • Do you see the 500 error in your SonarQube instance’s access.log file? See the documentation on troubleshooting.
  • While you’re there, it’s worth checking the other log files (like web.log) to see if there’s any clear error

Ngrok issue has been resolved but it is still popping up with this below issue .
below are the logs.

023-06-23T10:16:53.5869404Z ##[section]Starting: SonarQubeAnalyze
2023-06-23T10:16:53.5872861Z ==============================================================================
2023-06-23T10:16:53.5872988Z Task : Run Code Analysis
2023-06-23T10:16:53.5873056Z Description : Run scanner and upload the results to the SonarQube server.
2023-06-23T10:16:53.5873177Z Version : 5.15.0
2023-06-23T10:16:53.5873238Z Author : sonarsource
2023-06-23T10:16:53.5873301Z Help : Version: 5.15.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

More Information
2023-06-23T10:16:53.5873536Z ==============================================================================
2023-06-23T10:16:53.7809917Z [command]/home/vsts/work/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/5.15.0/sonar-scanner/bin/sonar-scanner
2023-06-23T10:16:54.8823796Z INFO: Scanner configuration file: /home/vsts/work/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/5.15.0/sonar-scanner/conf/sonar-scanner.properties
2023-06-23T10:16:54.8825312Z INFO: Project root configuration file: NONE
2023-06-23T10:16:55.0496565Z INFO: SonarScanner 4.8.0.2856
2023-06-23T10:16:55.0502746Z INFO: Java 11.0.19 Eclipse Adoptium (64-bit)
2023-06-23T10:16:55.0503325Z INFO: Linux 5.15.0-1040-azure amd64
2023-06-23T10:16:56.0827276Z INFO: User cache: /home/vsts/.sonar/cache
2023-06-23T10:17:53.2152244Z INFO: Analyzing on SonarQube server 10.0.0.68432
2023-06-23T10:17:53.2159986Z INFO: Default locale: “en”, source code encoding: “UTF-8” (analysis is platform dependent)
2023-06-23T10:17:54.3757625Z INFO: Load global settings
2023-06-23T10:17:54.7448229Z INFO: Load global settings (done) | time=370ms
2023-06-23T10:17:54.7466245Z INFO: Server id: 147B411E-AYiuCMb3hmJpgyhluvAA
2023-06-23T10:17:54.7527796Z INFO: User cache: /home/vsts/.sonar/cache
2023-06-23T10:17:54.7553313Z INFO: Load/download plugins
2023-06-23T10:17:54.7553921Z INFO: Load plugins index
2023-06-23T10:17:54.8855206Z INFO: Load plugins index (done) | time=123ms
2023-06-23T10:23:20.9727515Z INFO: Load/download plugins (done) | time=326216ms
2023-06-23T10:23:22.0666321Z INFO: Process project properties
2023-06-23T10:23:22.0745031Z INFO: Process project properties (done) | time=8ms
2023-06-23T10:23:22.0771490Z INFO: Execute project builders
2023-06-23T10:23:22.0787118Z INFO: Execute project builders (done) | time=2ms
2023-06-23T10:23:22.0919377Z INFO: ------------------------------------------------------------------------
2023-06-23T10:23:22.0922610Z INFO: EXECUTION FAILURE
2023-06-23T10:23:22.0925416Z INFO: ------------------------------------------------------------------------
2023-06-23T10:23:22.0929914Z INFO: Total time: 6:27.275s
2023-06-23T10:23:22.1192871Z INFO: Final Memory: 8M/34M
2023-06-23T10:23:22.1193798Z INFO: ------------------------------------------------------------------------
2023-06-23T10:23:22.1313486Z ##[error]ERROR: Error during SonarScanner execution
ERROR: Validation of project failed:
o To use the property “sonar.branch.name” and analyze branches, Developer Edition or above is required. See Branch analysis for more information.
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
2023-06-23T10:23:22.1320798Z ERROR: Error during SonarScanner execution
2023-06-23T10:23:22.1321018Z ERROR: Validation of project failed:
2023-06-23T10:23:22.1321655Z o To use the property “sonar.branch.name” and analyze branches, Developer Edition or above is required. See Branch analysis for more information.
2023-06-23T10:23:22.1322268Z ERROR:
2023-06-23T10:23:22.1322541Z ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
2023-06-23T10:23:22.4569679Z ##[error]The process ‘/home/vsts/work/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/5.15.0/sonar-scanner/bin/sonar-scanner’ failed with exit code 2
2023-06-23T10:23:22.4615643Z ##[section]Finishing: SonarQubeAnalyze

If you are using Community Edition, make sure you’re scanning the default branch of your project (as seen in Azure DevOps). Branch analysis is supported starting in Developer Edition.

Thank you