Running SonarQube analysis via jenkins throwing StackOverFlow error for Spark Scala code

I have a spark scala application which runs fine without any issues in the jenkins build as well as local build. For one of the method we are using 160 withColumn for adding columns to the dataframe. We have a request for adding two more additional columns. When I added it, everything runs fine from local as well as from EMR, but sonar analysis is throwing stackoverflow error when added those two columns. If I remove it there is no issues. Not sure if the jenkins container has enough resources or not. Tried with different sonar-scanner versions, all are failing, but unit testing, code coverage works fine from local and jenkins, only sonar-scanner is failing.

  • versions used
    SonarScanner - 4.6.1.2450
    Scala - 2.12
    sbt - 1.4.6

  • Error observed (wrap logs/code around triple quote ``` for proper formatting)

07:58:53  INFO: Load project pull requests
07:58:53  INFO: Load project pull requests (done) | time=79ms
07:58:53  INFO: Load branch configuration
07:58:53  INFO: Load branch configuration (done) | time=2ms
07:58:53  INFO: Load quality profiles
07:58:53  INFO: Load quality profiles (done) | time=99ms
07:58:53  INFO: Detected Jenkins
07:58:53  INFO: Load active rules
07:58:56  INFO: Load active rules (done) | time=2432ms
07:58:56  WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
07:58:56  INFO: Branch name: new_mktr_test, type: short living
07:58:56  INFO: Indexing files...
07:58:56  INFO: Project configuration:
07:58:56  INFO: 378 files indexed
07:58:56  INFO: Quality profile for scala: Sonar way
07:58:56  INFO: Quality profile for xml: Sonar way
07:58:56  INFO: ------------- Run sensors on module siteanalytics-data-pipeline
07:58:56  INFO: Load metrics repository
07:58:56  INFO: Load metrics repository (done) | time=76ms
07:58:57  WARNING: An illegal reflective access operation has occurred
07:58:57  WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/home/git/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
07:58:57  WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
07:58:57  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
07:58:57  WARNING: All illegal access operations will be denied in a future release
07:58:58  INFO: Sensor Scala Sensor [sonarscala]
07:58:58  INFO: 18 source files to be analyzed
07:58:58  INFO: Load project repositories
07:58:58  INFO: Load project repositories (done) | time=83ms
07:59:00  INFO: ------------------------------------------------------------------------
07:59:00  INFO: EXECUTION FAILURE
07:59:00  INFO: ------------------------------------------------------------------------
07:59:00  INFO: Total time: 19.391s
07:59:00  INFO: Final Memory: 32M/120M
07:59:00  INFO: ------------------------------------------------------------------------
07:59:00  ERROR: Error during SonarScanner execution
07:59:00  java.lang.StackOverflowError
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
07:59:00  	at scala.meta.Term$Interpolate$TermInterpolateImpl.args(Trees.scala:75)
  • steps to reproduce - Run sonar-scanner with scoverage.xml
  • potential workaround - If I remove those two extra columns then it is working fine

Hi,

Welcome to the community!

That stacktrace doesn’t look like it was produced by SonarSource code. Do you have a 3rd-party plugin loaded to analyze Scala?

 
HTH,
Ann

Hi Ann, There is no much error logs as it was running inside jenkins instance, also reached out to jenkins team, they also cannot find anything. No, I don’t have any third party plugins. Do you know is there anything we can do to check the scoverage.xml file to analyze the issues ? Because the error is thrown while just running sonar-scanner command with scoverage.xml file, and its failing within 1 minute.

Hi,

I’m really not sure what to tell you. That really doesn’t look to me like a stacktrace produced by SonarSource code.

 
:woman_shrugging:
Ann

Hi @tahaso,

It has been a long time, but thanks for reporting the issue.

Are you still experiencing the same issue these days?