We are trying to set up SonarCloud with CircleCI for one of our iOS projects on a GitHub repository, but encountering some hard-to-resolve errors.
These are the steps we have taken so far:
- Since we are using CircleCI, naturally we chose to follow the instructions for analyzing with CircleCI.
- We have created a SonarCloud context and added a
SONAR_TOKEN
environment variable. - Since our project is in Swift, we selected “Other” to best describe our build.
- We have allowed our organization to use third-party orbs.
- Since the orb doesn’t support macOS, we chose to use the pre-built CircleCI base image
Here is what was added to our existing .circleci/config.yml
(stripped out our other jobs):
version: 2.1
orbs:
sonarcloud: sonarsource/sonarcloud@1.0.2
jobs:
sonar-cloud-orb:
docker:
- image: cimg/base:2021.04
steps:
- checkout
- sonarcloud/scan
workflows:
version: 2
build-and-deploy:
jobs:
- sonar-cloud-orb:
context: SonarCloud
filters:
branches:
only: develop
And when we push to develop branch we get the following error message (stripped out most of the stacktrace to keep within character limits):
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 47.388s
INFO: Final Memory: 55M/194M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.StackOverflowError
at java.base/java.util.stream.AbstractPipeline.wrapSink(Unknown Source)
[ ... ]
at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Unknown Source)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Exited with code exit status 1
CircleCI received exit code 1
Which doesn’t say that much to us what went wrong.
Not sure how to use the -X switch when using the orb but we did also try to manually download and run sonar-scanner
on the Linux image just so we could add the -X switch and get verbose logging. Alas, the same error was thrown without any useful logs or hints as to what is going on.
Any help with moving forward on this would be very appreciated as we are currently at a loss on how to fix it. Please let me know if any more information is needed to be able to investigate this.