SonarScanner - version 4.0.0.1744 returns no results (but runs successfully) (golang)

versions

  • SonarQube version: 7.7.0.23042
  • SonarScanner works: sonar-scanner-3.3.0.1492-macosx
  • SonarScanner fails: sonar-scanner-4.0.0.1744-macosx and sonar-scanner-4.0.0.1744-linux

I’m trying to run a branch analysis on some go repo. The master branch has already been analysed and loaded into sonarqube.

The analysis runs successfully (locally on mac os, or in bitbucket pipelines). Once complete, when looking in sonarQube, there are no results in the ‘code’ or ‘measures’ tab for that pull request.

Using the old version of the scanner (version 3.3…) locally works correctly and the code and measures can be navigated.

here’s the command being excecuted:

sonar-scanner -Dproject.settings=sonar-scanner.properties -Dsonar.login=<login_token> -Dsonar.pullrequest.key="test_pr_key" -Dsonar.pullrequest.branch="test_pr_branch" -Dsonar.pullrequest.base="master" -Dsonar.pullrequest.repository=<my repo>

and my properties file:

sonar.projectKey=<my_sonar_project>
sonar.host.url=https://sonarqube.<my_team>.satalia.io
sonar.sourceEncoding=utf-8
sonar.sources=.
sonar.exclusions=**/*_test.go,**/*.pb.go,tests/**/*,resources/**/*
sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.test.exclusions=tests/**/*

The only difference in the logs are:

  1. the below warnings
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=66ms		INFO: Load metrics repository (done) | time=73ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/Users/jonasdebeukelaer/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
  1. the difference in java versions
  2. and the size of the output at the end
    1. v3.3 INFO: Final Memory: 27M/429M
    2. v4.0 INFO: Final Memory: 21M/84M

I appreciate any ideas you might have to help, thanks!

just realised I’m an idiot and these tabs are not populated if there is no change to any of the tracked files :face_palm: :face_palm:

maybe a helpful message could be added to make this clear?