SonarQube on FreeBSD 14.1

Hi everyone,

I have been using SonarQube for some time now on FreeBSD and we never had an issue with the Server nor the sonar-scanner (cli). Always installing and upgrading both packages from the FreeBSD pkg system.

This week we have upgraded to the latest release of SonarQube ( Community Edition v10.7 (96327)) and Scanner (SonarScanner CLI 6.2.1.461) and we lost the ability to connect from FreeBSD light-containers ( jails) using the scanner to the server.

There are two issues, one the scanner complains it cannot detect the OS ( before is was possible to specific -Dsonar.scanner.os=“freebsd” to overcome this, and the second issue is that the server replies that is an unsupported os.

10:24:36.800 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Error status returned by url [http://192.168.Y.X:9000/api/v2/analysis/jres?os=freebsd&arch=amd64]: 400

i have checked the release notes and i cannot see any note regarding this, anyhow, seems a bit unfortunate as for the scanner-agent should be much magic and it should be treated as Unix. Not sure whats the logic of creating a barrier there…

Thanks for your time.

1 Like

Hi,

Welcome to the community!

We don’t maintain those FreeBSD distros, so I’m sorry but we can’t answer for changes in them.

 
Ann

Hi Ann, is not a distro, is an OS like MacOS. The packages are generated directly from Sonar ( I mean the code, as we don’t change it), hence there must be a change where FreeBSD support was removed.

see https://<yoursonarhost>/web_api_v2#/analysis/jres--get

The problem lies in the new JRE provisioning feature, as Sonarqube 10.7 doesn’t ship
with a JRE for OS freebsd.

Sonarqube 10.7.0 has

Deactivating the JRE provisioning via
Scanner property sonar.scanner.skipJreProvisioning=true
or set the environment variable SONAR_SCANNER_SKIP_JRE_PROVISIONING to true

should fix your problem.
for the documentation see

2 Likes

sonar.scanner.skipJreProvisioning=true didn’t help. Setting the path to the local java executable via -Dsonar.scanner.javaExePath=/usr/local/bin/java made it work (“java” is in the path, so you seem to have a bug there). This doesn’t fix it completely, the kubernetes sensor triggers in e.g. the wordpress source and fails as it doesn’t respect the sonar.scanner.os setting.

See the discussion I opened for this here in the forum.

Thanks a lot for you information here, it helped to find a suitable workaround.

FYI:
FreeBSD is compatible enough with sonar.scanner.os=linux to have it working just fine in the past. There are traces back to sonarqube cummunity edition 6 working just fine and currently sonarqube community edition 10.7 also works just fine except for what is presented here (this is a recent regression compared to a lot of years where it simply worked). A part of the regression is now fixed in the FreeBSD port by a simple shell-wrapper script for the sonar scanner to set the path to java (so that it doesn’t need to be set per project).

FreeBSD ships “ports” (= automated installation of 3rd party software) of the community edition (downloads your zip for linux and has a dependency on the openjdk to that this is automatically installed too, and provides integration in the FreeBSD service startup framework – init.d or systemd config if you want to compare it to a similar linux feature) for years. Great for those of us who want to deliver good quality when contributing to open source projects or want to learn about sonarqube and want to play around more freely with it than what people at work allow to do with the enterprise edition.