Out of memory and cannot create report.txt file when running SonarQube as Jenkins plugin

Hello,

I’m pretty new to both SonarQube and Jenkins, and I’m trying to run SonarQube on the Spring Petclinic application (https://github.com/spring-projects/spring-petclinic). Jenkins and SonarQube themselves are running on a Vagrant VM which is port-forwarded to my local browser. I have configured a freestyle project job in Jenkins and added running sonar scanner as a build step. This is my configuration for sonar scanner as entered into the Jenkins job configuration:

sonar.projectKey=Petclinic
sonar.projectName=Petclinic
sonar.projectVersion=1.0
sonar.host.url=http://localhost:9000/
sonar.login=admin
sonar.password=admin
sonar.sources=/home/vagrant/spring-petclinic/src
sonar.links.scm=https://github.com/spring-projects/spring-petclinic.git

I am running the sonar.sh server from my VM as follows:

vagrant@vagrant : ~/sonarqube-7.1/bin/linux-x86-64 $ sudo sysctl -w vm.max_map_count=56214400

vm.max_map_count = 56214400

vagrant@vagrant : ~/sonarqube-7.1/bin/linux-x86-64 $ ./sonar.sh console -Dsonar.analysis.mode=

and among other standard-looking output I am getting this output when running sonar.sh:

jvm 1 | 2020.02.22 17:33:28 INFO app[o.s.a.p.ProcessLauncherImpl] Launch process[[key=‘ce’, ipcIndex=3, logFilenamePrefix=ce]] from [/home/vagrant/sonarqube-7.1]: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/home/vagrant/sonarqube-7.1/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:/home/vagrant/sonarqube-7.1/lib/jdbc/h2/h2-1.3.176.jar org.sonar.ce.app.CeServer /home/vagrant/sonarqube-7.1/temp/sq-process5439947615056572162properties

jvm 1 | 2020.02.22 17:33:45 INFO app[o.s.a.SchedulerImpl] Process[ce] is up

jvm 1 | 2020.02.22 17:33:45 INFO app[o.s.a.SchedulerImpl] SonarQube is up

I am able to log into SonarQube on localhost:9000, but I am not sure what the +HeapDumpOnOutOfMemoryError means.

The main problem I have is that when I click on “build now” in my Jenkins job for petclinic, I’m getting

library initialization failed - unable to allocate file descriptor table - out of memoryWARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeeded?
ERROR: SonarQube scanner exited with non-zero code: 134
Finished: FAILURE

I have tried adding login credentials (before I didn’t have them) in the sonar scanner configuration, adding the host url, playing with the source directories, allocating more memory (via sudo sysctl -w vm.max_map_count=56214400) to the java heap…and none of them have solved this issue for the report-task.txt.

I am using SonarQube version 7.1 and Jenkins blueocean (running from the docker image on dockerhub). The VM I am running all of this on is a Linux Ubuntu x86 64 bit.

Does anyone have any ideas on this? I’m really stuck…

Thanks!

Hi,

Welcome to the community!

Whoo! You’ve got a lot going on here. I suggest you strip it down to essentials. Dump the Vagrant VMs: just spin SonarQube up directly on your box. Then, don’t bother with Jenkins, just run your analysis command (whether that’s Maven, Gradle, or vanilla CLI directly from the command line.

See how that goes and then if you really need to you can layer in the other stuff later.

 
HTH,
Ann

I think it got resolved actually by redoing the setup of the entire VM, thanks for the response though!