- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube version: 9.9.1 - How is SonarQube deployed: zip, Docker, Helm
Docker - what are you trying to achieve
Integrating SonarQube with Self-hosted Gitlab - what have you tried so far to achieve this
I have configured DevOps Platform Integration. I created a new user on Gitlab with reporter permission and gave permission API to the token. Then I configured the DevOps platform integration where I provided the configuration name, Gitlab API URL, and Personal Access token, and it’s connected to my Gitlab because I can see the repositories here in SonarQube.
After that, I added the new project in the Sonarqube and chose the integration with GitLab CI, set up the project key for PHP, added the sonar-project.properties in the repository with values given by sonarqube, and then, saved the sonarqube token environment variable in the GitLab by following the screen instruction on SonarQube page, and then added the configuration file in the .gitlab-ci.yml file. After finishing this, when I checked the logs in Gitlab, I am facing the below error.
bash: line 143: sonar-scanner: command not found
Does anyone know why it is happening?
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
Gitlab logs
Running with gitlab-runner 16.0.1 (79704081)
on dev-server xUfb7Nzu, system ID: s_2193954a9440
Preparing the “shell” executor
Using Shell (bash) executor…
Preparing environment
Running on dev-server…
Getting source from Git repository
Fetching changes…
Reinitialized existing Git repository in /home/gitlab-runner/builds/xUfb7Nzu/0/project-name/repo-name/.git/
Checking out a368c059 as detached HEAD (ref is dev)…
Skipping Git submodules setup
Restoring cache
Checking cache for sonarqube-check-non_protected…
Runtime platform arch=amd64 os=linux pid=2014 revision=79704081 version=16.0.1
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
Executing “step_script” stage of the job script
$ sonar-scanner
bash: line 143: sonar-scanner: command not found
Cleaning up project directory and file based variables
ERROR: Job failed: exit status 1