Real-Time SonarQube Questions: Production Fixes (2027)
40 real-time SonarQube interview questions on live troubleshooting: scanner errors, stuck quality gates, logs, Elasticsearch, database and upgrades.
Real-time SonarQube interview questions test whether you can keep analysis running on a live pipeline: reading scanner errors, fixing tokens and certificates, tracing a stuck quality gate, sizing the Compute Engine, and recovering the server from Elasticsearch, database or upgrade problems. Interviewers want the log you would open first and the exact property you would change.
This page collects 40 production troubleshooting questions with direct answers, grouped by experience level. It is part of our SonarQube interview series. For concepts and setup, start with the 90+ SonarQube interview questions keeper page. For team adoption and process scenarios, read the scenario-based SonarQube questions. This page stays with the hands-on side: what breaks, where it shows up, and how you fix it. Property names, defaults and log files below were checked against the SonarQube Server 2026.5 documentation in November 2026.
Key takeaways
- Most scanner failures fall into five groups: authentication (
sonar.token), network or TLS (PKIX path building failed), memory (OutOfMemoryError), Git history (shallow clones) and scope (wrongsonar.sources). - The server writes separate logs:
sonar.logfor the main process,web.log,ce.logfor background tasks,es.logfor Elasticsearch andaccess.logfor HTTP requests. Name the right one in your answer. sonar.qualitygate.wait=truemakes the scanner fail the build when the gate fails. Its timeout,sonar.qualitygate.timeout, defaults to 300 seconds.- In Jenkins,
waitForQualityGateneedswithSonarQubeEnvplus a webhook to<jenkins>/sonarqube-webhook/. Missing the webhook is the classic cause of a pipeline that waits forever. - On Linux the server needs
vm.max_map_countof at least 524288,fs.file-maxof at least 131072, and a user limit of 131072 open files and 8192 threads. - Elasticsearch locks indices read-only at 95% disk use. Freeing disk is not enough; you must restart SonarQube Server as well.
Where to look first: symptom to log map
A strong real-time answer starts by saying where the evidence lives. The table below maps common symptoms to the first place to check.
| Symptom | First place to check | Typical cause |
|---|---|---|
| Scanner exits with 401 or "Not authorized" | CI job log with sonar.verbose=true | Expired or wrong token, missing Execute Analysis permission |
PKIX path building failed | CI job log | Server uses a self-signed or private CA certificate the scanner JVM does not trust |
| Analysis uploaded but results never appear | Administration > Projects > Background tasks, then ce.log | Failed or queued Compute Engine task |
| Pipeline hangs at the quality gate step | Project webhook deliveries, Jenkins log | Webhook missing, wrong URL, or Jenkins unreachable from SonarQube |
| Server will not start | sonar.log, then es.log | Kernel limits, ES data directory permissions, port in use |
| Search and issue pages error out | es.log, disk usage | Elasticsearch indices read-only after the 95% watermark |
| Login works, pages slow | web.log, access.log, api/system/health | Web heap too small, slow database |
Real-time questions for freshers
1. A scan fails with "Not authorized. Please check the user token". What do you check?
Check that the pipeline passes a valid token in sonar.token or the SONAR_TOKEN environment variable, that the token has not expired or been revoked, and that the user or project token has the Execute Analysis permission. sonar.login and sonar.password are deprecated, so an old pipeline that still uses them is a likely suspect. Do not print the token in logs while debugging.
2. The scanner says it cannot reach the server. What is your first step?
Confirm the value of sonar.host.url (or SONAR_HOST_URL). Newer scanners (CLI from v6.0, Maven from v5.0, Gradle from v6.0, .NET from v7.0, NPM from v4.0, and the Python scanner) default to https://sonarcloud.io when the URL is not set, while older ones default to http://localhost:9000. A missing variable can send a self-hosted analysis to the wrong place. Then test the URL with curl from the build agent.
3. How do you get more detail from a failing analysis?
Add -Dsonar.verbose=true, which turns on DEBUG logging for the scanner, or set sonar.log.level to DEBUG or TRACE. Sonar warns that verbose mode can expose sensitive values stored in environment variables, so turn it off again and avoid sharing raw logs publicly.
sonar-scanner -Dsonar.projectKey=payments-api -Dsonar.verbose=true
4. The analysis fails with java.lang.OutOfMemoryError: GC overhead limit exceeded. How do you fix it?
Give the scanner process a bigger heap with -Xmx. For SonarScanner CLI from v6.0, Maven from v5.0, Gradle from v6.0 and NPM from v4.0, the scanner engine runs in a separate JVM, so set SONAR_SCANNER_JAVA_OPTS (for example -Xmx4g). Also check whether generated or vendored files are inflating the scope.
5. The error is PKIX path building failed. What does it mean?
The server runs HTTPS with a certificate that the scanner's Java truststore does not trust, usually a self-signed or internal CA certificate. Import the certificate into the truststore the scanner uses. The scanner reads sonar.scanner.truststorePath, which defaults to <sonar.userHome>/ssl/truststore.p12. With the GitHub Action, set SONAR_ROOT_CERT.
6. Every file shows as new code and blame data is missing. Why?
The CI checkout is shallow. Errors such as "Missing blame information" or "Could not find ref" come from partial or shallow clones and from Git submodules. Fetch full history: fetch-depth: 0 in GitHub Actions and GIT_DEPTH: "0" in GitLab CI/CD.
- uses: actions/checkout@v6
with:
fetch-depth: 0
7. Coverage shows 0% although tests ran. What do you check?
SonarQube does not run tests. It imports a report that your build produced. Check that the report exists before the scan step, that the path property matches it (for Java with JaCoCo, sonar.coverage.jacoco.xmlReportPaths; for JavaScript, sonar.javascript.lcov.reportPaths; for Python, sonar.python.coverage.reportPaths) and that the paths inside the report match the analyzed sources.
8. How do you check whether the server itself is healthy?
Call api/system/health with an account allowed to see system information, and look at the System page under Administration. If the API returns errors or the page will not load, go to the server logs.
9. Name the server log files and what each one holds.
sonar.log covers the main process that starts the others. web.log covers the database connection, migrations, reindexing and HTTP request handling. ce.log covers background task processing. es.log holds Elasticsearch operations such as startup and health changes. access.log records HTTP access unless sonar.web.accessLogs.target is set to console.
10. Large minified files are slowing the scan. Which settings help?
Exclude them with sonar.exclusions. SonarQube also discards files over sonar.filesize.limit (20 MB by default), and sonar.javascript.maxFileSize (1000 KB by default) drops large JavaScript and TypeScript files. Files ignored by Git are excluded too, unless sonar.scm.exclusions.disabled is true.
11. A developer runs the scanner on Windows and it fails immediately. Their username ends with "!". Is that related?
Yes. Sonar documents that a Windows username ending in a special character breaks analysis. Either change the username or set sonar.userHome to a path without special characters.
Real-time questions for 2 to 5 years of experience
12. The Jenkins pipeline hangs at waitForQualityGate. What is wrong?
Usually SonarQube never told Jenkins the task finished. The step needs three things: analysis run inside withSonarQubeEnv so Jenkins knows the task ID, a project or global webhook pointing to <yourJenkinsInstance>/sonarqube-webhook/, and network access from SonarQube to Jenkins. Check the webhook's recent deliveries in SonarQube and wrap the step in a timeout so a lost webhook fails the build instead of blocking it.
stage('Quality gate') {
steps {
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true
}
}
}
13. How do you make a GitLab or CLI scan fail the job when the gate fails?
Pass -Dsonar.qualitygate.wait=true. The scanner then polls the server until the report is processed and returns a failing exit code if the gate fails. Sonar's GitLab examples use exactly this flag.
14. The scanner times out waiting for the gate on busy days. What do you change?
First find out why processing is slow, because the timeout only hides the queue. Then, if the delay is expected, raise sonar.qualitygate.timeout from its 300 second default. Sonar lists quality gate timeouts as one symptom of a Compute Engine that cannot keep up.
15. A background task failed. How do you investigate?
Open Administration > Projects > Background tasks, filter by status, and open the failed task to see the error and its stack trace. Then find the same task in ce.log around that timestamp. Common causes are database errors, Elasticsearch problems and memory pressure on the Compute Engine.
16. The error says "a newer report has already been processed". What happened?
Several analyses of the same project ran in parallel and shared a commit SHA, so one report was rejected. Sonar gives the GitHub matrix job example, where one GITHUB_SHA is shared. Run those analyses sequentially (for example max-parallel: 1), split them into separate jobs, and make sure sonar.branch.name matches the real branch.
17. The SonarQube webhook to an external system fails. How do you debug it?
Look at the delivery history of the webhook in project or global settings, which shows the response code and payload of recent calls. Check that the receiver is reachable from the SonarQube host, not only from your laptop. If a webhook secret is set, the receiver must check the HMAC-SHA256 signature using the same secret.
18. You need to see which properties the scanner actually used. How?
Use sonar.scanner.internal.dumpToFile with a file path. The CLI, Gradle, Maven and NPM scanners write every property they collected from the command line, configuration files and environment variables. The older name sonar.scanner.dumpToFile is deprecated.
19. A build runs behind a corporate proxy and cannot download plugins. What do you set?
Set sonar.scanner.proxyHost and sonar.scanner.proxyPort (or the matching SONAR_SCANNER_PROXY_* environment variables), plus user and password for an authenticated proxy. If plugin downloads are slow, sonar.plugins.download.timeout controls the wait (300 seconds by default).
20. Analysis fails with read timeouts on large uploads. Which scanner timeouts exist?
sonar.scanner.connectTimeout (5 seconds default), sonar.scanner.socketTimeout (60 seconds) and sonar.scanner.responseTimeout (60 seconds). They apply to the newer scanner versions listed in the docs. Raise them only after checking that a proxy or load balancer is not cutting the connection.
21. A Kubernetes deployment fails to download a regulatory report. What do you check?
The ingress. Sonar's fix for this case is to raise the NGINX ingress body size and timeouts, for example nginx.ingress.kubernetes.io/proxy-body-size: "64m" and read and connect timeouts of 300 seconds.
22. How do you change the server log level without a restart?
Use the log level control on Administration > System. The change lasts until the next restart. For a permanent change set sonar.log.level in conf/sonar.properties, or a per-process key such as sonar.log.level.ce or sonar.log.level.web. Switch back to INFO soon, because DEBUG and TRACE logs grow very quickly.
23. The server's search pages break and es.log shows disk watermark warnings. What now?
Elasticsearch warns at 85% and 90% disk use and locks indices read-only at 95%. Free disk space, then restart SonarQube Server so the indices return to read-write. On Data Center Edition, restart all application nodes. If data still looks inconsistent, stop the server, delete the data/es8 directory and start again to rebuild the indices.
24. After a PostgreSQL upgrade, CPU spikes and scans hang with no response. What is the documented fix?
Reindex the issues, rules and components tables in the database. Sonar lists this for the "no response from server" case and also suggests reindexing when performance drops after a PostgreSQL upgrade.
25. The server logs permission denied for schema public on PostgreSQL. How do you fix it?
Give ownership of the database to the SonarQube database user:
ALTER DATABASE sonarqube OWNER TO mySonarUser;
26. Connections to the database drop at random through a firewall. What do you tune?
Firewalls can cut idle connections. Sonar recommends HikariCP settings such as sonar.jdbc.idleTimeout=600000, sonar.jdbc.keepaliveTime=300000, sonar.jdbc.maxLifetime=1800000 and sonar.jdbc.validationTimeout=5000. Other HikariCP properties use the pattern sonar.jdbc.{property}.
Real-time questions for senior and lead roles
27. The server will not start on a new Linux VM and es.log complains about limits. What do you set?
Set the kernel and user limits Sonar requires: vm.max_map_count at least 524288, fs.file-max at least 131072, and a SonarQube user that can open at least 131072 files and 8192 threads. These apply on the host for every installation type, containers included.
# /etc/sysctl.d/99-sonarqube.conf
vm.max_map_count=524288
fs.file-max=131072
# /etc/security/limits.d/99-sonarqube.conf
sonarqube - nofile 131072
sonarqube - nproc 8192
28. Background tasks are queuing for a long time. How do you diagnose it?
Check the Background tasks page for pending count, wait time and failure rate, then look in ce.log for slow steps. Sonar says that steps taking more than a few minutes there point to the database. Fixes include faster Elasticsearch storage, shorter housekeeping retention, a smaller analysis scope and, from Enterprise Edition, more Compute Engine workers with a heap sized to match.
29. How are the server's three Java processes sized?
Each has its own heap property: sonar.web.javaOpts, sonar.ce.javaOpts and sonar.search.javaOpts. Setting one replaces its default flags, so include every flag you need, or use the matching javaAdditionalOpts property to add flags. Sonar notes that 2026.5 raised the web and Compute Engine defaults, so a container with a fixed memory limit may need more memory after an upgrade.
30. How do you monitor SonarQube in production?
Poll api/system/health, watch CPU, memory and disk for the web, Compute Engine and Elasticsearch processes, and read the JMX MBeans for background task counts and processing time. On Kubernetes, Sonar provides a Prometheus integration. Alert on disk usage before the Elasticsearch 85% warning, not after 95%.
31. Which Java version does a ZIP installation need?
The 2026.5 server host requirements list Java 21 or Java 25 for ZIP installations, preferably a critical patch update release. Container images bring their own runtime. Sonar also says ZIP installation will be removed in a future release, so new installs should prefer containers.
32. Explain how you would upgrade across several versions safely.
Read the LTA to LTA release notes for removals and changed defaults, back up the database, test the upgrade on a copy of production data, and follow the documented update path, which may require stopping at an LTA release. After the upgrade, expect database migration and a reindex, and watch web.log and es.log until the instance reports healthy.
33. Analyses for one project are suddenly much slower. Where do you look?
Compare scanner logs before and after the change. Common causes are a new folder of generated code in scope, sonar.scm.forceReloadAll=true left on (it loads blame for all files), lost scanner caches in CI, or a new language analyzer starting to scan files. Cache .sonar/cache between runs, as Sonar's CI examples do.
34. An auditor asks you to tie each analysis to a build. How?
Pass sonar.buildString with the build ID. It is stored with the analysis and returned by api/project_analyses/search. You can also add custom context with sonar.analysis.<key>=<value>, which is passed to webhooks.
35. Logs must go to a central system from a container. What do you configure?
Send logs to standard output for the platform to collect, and use sonar.web.accessLogs.target with console or both for the access log. An unsupported value stops the server from starting, so check the spelling in configuration review.
36. Analyses get stuck after a node in a Data Center Edition cluster ran out of disk. What is different from a single server?
On DCE, one or more nodes can hit the 95% watermark and lock some or all indices. After freeing space, restart all application nodes. If you need a full rebuild, stop the whole cluster, delete data/es8 on every search node and restart the cluster.
37. A team says SonarQube flags too many issues in tests and generated code after a migration. How do you fix scope at scale?
Set sonar.sources and sonar.tests explicitly, because no code counts as test code unless sonar.tests is set. Add exclusions at project or global level for generated folders, and keep the settings in a shared template or pipeline library so 100 repositories do not drift.
Live incident scenarios
38. Monday 9 a.m.: every pipeline fails at the SonarQube step. Walk through your first ten minutes.
Check whether the failures share an error. If every job shows connection errors, call api/system/health and check the host: process status, disk, and the latest lines of sonar.log and es.log. If the server is up but jobs fail on authentication, check whether a shared token expired or was revoked. If jobs fail on TLS, check whether a certificate was renewed with a new CA. Post a status note for developers, then fix the cause and rerun one pipeline before announcing recovery.
39. Releases are blocked because quality gate checks time out after an upgrade. What do you do?
Look at the background task queue. If it is backed up, check ce.log for slow steps and the server for memory pressure, because the upgrade may have raised the default heaps beyond the container limit. Restore capacity first. Raise sonar.qualitygate.timeout only as a temporary measure, and tell release managers which builds need a rerun.
40. A token leaked in a public CI log. What actions do you take?
Revoke the token in SonarQube at once and issue a new one stored as a masked CI secret. Check the access log for use of the leaked token, remove or restrict the exposed log, and turn off sonar.verbose if that is what printed it. Then review which permissions the token had and move to project tokens where a global token was not needed.
How this page differs from the other SonarQube pages
| Page | Focus |
|---|---|
| 90+ SonarQube questions | Concepts, setup and quality gates (main page) |
| Most asked SonarQube questions | Basics for freshers |
| Scenario-based questions | Team, adoption and process decisions |
| Advanced questions | Deeper architecture topics |
| This page | Live troubleshooting of scanners, pipelines and the server |
For wider pipeline debugging, see 12 common CI/CD pipeline failures and fixes, and for where SonarQube sits among other scanners, read 12 DevSecOps tools for secure CI/CD. If you want guided practice on pipelines with quality gates, our DevSecOps training covers SonarQube inside Jenkins and GitLab pipelines.
FAQ
What are real-time SonarQube interview questions?
They are questions about running SonarQube in production: failing scans, stuck quality gates, slow background tasks, Elasticsearch and database errors, and upgrades. Interviewers expect you to name the log file, setting or command you would use.
Which log shows why a SonarQube analysis failed on the server side?
ce.log, together with the failed task on the Background tasks page. Scanner-side errors appear in the CI job log.
How do I fail a pipeline when the SonarQube quality gate fails?
Use sonar.qualitygate.wait=true for scanner-based jobs, or waitForQualityGate in Jenkins with a webhook to /sonarqube-webhook/.
What is the default sonar.qualitygate.timeout?
300 seconds.
Why does SonarQube fail to start on Linux?
Often because Elasticsearch prerequisites are not met. Set vm.max_map_count to at least 524288 and fs.file-max to at least 131072, and allow the user 131072 open files and 8192 threads.
How do I fix Elasticsearch read-only indices in SonarQube?
Free disk space below the 95% watermark and restart SonarQube Server. If problems remain, stop the server, delete data/es8 and restart to rebuild the indices.
Why does every file look new in my CI analysis?
The checkout is shallow. Fetch full Git history so the scanner can read blame data.
References
- SonarQube Server: Server logs
- SonarQube Server: Elasticsearch-related issues
- SonarQube Server: Database-related issues
- SonarQube Server: Performance issues
- SonarQube Server: Troubleshooting the analysis
- SonarQube Server: Parameters not settable in the UI
- SonarQube Server: On Linux systems
- SonarQube Server: Setting up a pause in Jenkins pipeline
- SonarQube Server: Monitoring the instance
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0