Must-share information (formatted with Markdown):
- Enterprise Edition
- v2025.1.1 (104738)
- SonarQube Server
- Helm deployment
- Trying to perform static code analysis and line coverage on a typescript angular repo
Using sonarsource/sonar-scanner-cli:5.0.1
I have a multi-step pipeline.. In the step prior to running sonarscan, I run unit tests and line coverage in karma.. this spits out an lcov.info file which I’m passing into the sonar exec cmd.
The sonar process seems to run ok.. I’ve checked the logs and the only “issues” I can see are where it attempts to relocate the node runtime to /root/.sonar.
ERROR: Error relocating /opt/sonar-scanner/.sonar/js/node-runtime/node: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE15_M_replace_coldEPcmPKcmm: symbol not found
It suggests it will default to /opt/sonar-scanner/.sonar/js/node-runtime
Then I get this
Failed to determine the version of Node.js, exit value 127. Executed: '/opt/sonar-scanner/.sonar/js/node-runtime/node -v'
It does however fallback as expected and reports on the version -
DEBUG: Using Node.js v18.20.1
There are no other errors in the log.
Then we get towards the end of the run.. The report is uploaded to SQ OK, the worker is shutdown, there’s some rule details in a table.. then the following -
16:43:04.655 DEBUG: The worker thread exited with code 0
16:43:04.657 DEBUG: The bridge server shut down
16:43:04.658 INFO: Rule | Time (ms) | Relative
16:43:04.658 INFO: :----|----------:|--------:
16:43:04.692 INFO: ------------------------------------------------------------------------
16:43:04.692 INFO: EXECUTION FAILURE
16:43:04.692 INFO: ------------------------------------------------------------------------
16:43:04.693 INFO: Total time: 57.379s
16:43:04.824 INFO: Final Memory: 143M/508M
16:43:04.824 INFO: ------------------------------------------------------------------------
16:43:04.824 ERROR: Error during SonarScanner execution
QUALITY GATE STATUS: FAILED - View details on https://<our-sq-instance>/dashboard?id=mqube-client-interface&pullRequest=2090
My execution cmd is
sonar-scanner -X \
-Dsonar.projectKey="$REPO_NAME" \
-Dsonar.sources=src \
-Dsonar.host.url=https://<our-sq-instance> \
-Dsonar.token="$TOKEN" \
-Dsonar.pullrequest.base="$PULL_BASE_REF" \
-Dsonar.pullrequest.key="$PULL_NUMBER" \
-Dsonar.pullrequest.branch="$(git rev-parse --abbrev-ref HEAD)" \
-Dsonar.scm.revision="$PULL_PULL_SHA" \
-Dsonar.verbose=true \
-Dsonar.qualitygate.wait=true \
-Dsonar.exclusions=coverage/**,charts/** \
-Dsonar.javascript.lcov.reportPaths=coverage/$REPO_NAME/lcov.info
One thing I notice is that there are a lot of files missing from the SQ analysis.
I have tried to use a more recent docker image but I have some permission issues due to the scanner-cli user..
Could you help me diagnose the issue here please? Are there other sections of the logs I could share? There are multiple refs to repos which I would need to redact so wherever possible if I could share sections rather than the whole log that would be good..
Many thanks
Tony