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



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 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=
        unzip sonar-scanner-cli-$;
        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?


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.


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