Vague message: "received `killed` signal" killing build

docker
cci-20

#1

When we try to run Sonar Scanner to send quality analysis reports to SonarCloud, we receive a random “Received killed signal” halfway through the sonar-scanner command, killing the build.

I do not receive the same error when SSHing into the build container and running the same command by hand.

Our base image is actually Lambda https://github.com/lambci/docker-lambda since we’re building a Lambda app, however, it works through Docker on our machines and it works when manually running the command via SSH. I have tried increasing the heap size and fiddling around with other memory options (as specified in similar bug reports) to no avail.

This is the relevant section of our config.yml:

  - run: 
      name: Run Sonarqube Code Quality Analysis and Dump Coverage/Execution Reports There # for some reason the npm install of sonar-scanner doesn't work
      command: | # @todo: cache this? use curl rather than installing wget? 
        export MAVEN_OPTS="-Xms256m -Xmx1024m"
        export SONAR_RUNNER_OPTS="-Xms256m -Xmx1024m"
        export SONAR_VER=3.0.3.778-linux
        wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_VER.zip
        unzip sonar-scanner-cli-$SONAR_VER.zip;
        mv sonar-scanner-$SONAR_VER/ /root/;
        /root/sonar-scanner-$SONAR_VER/bin/sonar-scanner -Dsonar.login=$SONAR_LOGIN -X;

Any ideas on how to fix this?

https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner


#2

It turns out that RAM usage was indeed the culprit, and I was using the wrong environment variable to limit Sonar Scanner’s RAM usage. It’s export SONAR_SCANNER_OPTS="-Xmx1024m", not SONAR_RUNNER_OPTS.

This also works in CICI if you use the NPM version of SonarScanner and if you set SONAR_SCANNER_OPTS using the Web UI instead of in a config.yml.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.