Concerning the error you got, would it be possible to have the full stack trace? It will help me precisely localize where the error occurs in the code.
Concerning the warning about git, I have the feeling that this is more a problem of permission rather than a problem directly with our tool, but the stack trace asked above could help.
Indeed, pysonar-scanner is deprecated. It shouldn’t impact the results that you see in SonarQube but it is not maintained anymore, so it might break at anytime.
thanks for the reply. Please find the log below. Please be aware that I have replaced all confidential information, so this is not a verbatim copy.
Curiously, when I only replace pysonar-scanner with pysonar (nothing else changes, esp. the docker image is the same), I don’t get a warning about missing /usr/bin/git.
Running with gitlab-runner 18.8.0 (9ffb4aa0)
on build_server_21 xxxxxxxx, system ID: xxxxxxxxxxxxxx
Preparing the “docker” executor 00:01
Using Docker executor with image python:3.14.3-trixie …
Using effective pull policy of \[if-not-present\] for container python:3.14.3-trixie
Using locally found image version due to “if-not-present” pull policy
Using docker image sha256:xxxxx for python:3.14.3-trixie with digest python@sha256:xxxx …
Preparing environment 00:01
Using effective pull policy of \[if-not-present\] for container sha256:xxxx
Running on runner-xxxxxxxx-project-xxxxxxxx-concurrent-3 via build_server_21…
Getting source from Git repository 00:05
Gitaly correlation ID: xxxxxxxx-MUC
Fetching changes…
Initialized empty Git repository in /builds/group1/group2/my-project/.git/
Created fresh repository.
Checking out 352fad73 as detached HEAD (ref is refs/merge-requests/108/head)…
Skipping Git submodules setup
Restoring cache 00:01
Checking cache for sonarqube-check-protected…
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
WARNING: Cache file does not exist
Failed to extract cache
Executing “step_script” stage of the job script 01:10
Using effective pull policy of \[if-not-present\] for container python:3.14.3-trixie
Using docker image sha256:xxxxxx for python:3.14.3-trixie with digest python@sha256:xxxxxx …
…
$ pip3 install uv --break-system-packages
Collecting uv
Downloading uv-0.10.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Downloading uv-0.10.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.4/23.4 MB 12.6 MB/s 0:00:01
Installing collected packages: uv
Successfully installed uv-0.10.9
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv . Use the --root-user-action option if you know what you are doing and want to suppress this warning.
\[notice\] A new release of pip is available: 25.3 → 26.0.1
\[notice\] To update, run: pip install --upgrade pip
$ uv venv
Using CPython 3.14.3 interpreter at: /usr/local/bin/python3.14
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
$ uv pip install pysonar
Resolved 12 packages in 413ms
Prepared 12 packages in 170ms
warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
If the cache and target directories are on different filesystems, hardlinking may not be supported.
If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.
Installed 12 packages in 32ms
>
* certifi==2026.2.25
* charset-normalizer==3.4.5
* idna==3.11
* jproperties==2.1.2
* pyfakefs==5.9.3
* pysonar==1.3.0.4086
* pyyaml==6.0.3
* requests==2.32.5
* responses==0.25.8
* six==1.17.0
* tomli==2.2.1
* urllib3==2.6.3
$ uv run pysonar -Dsonar.host.url=“$SONAR_HOST_URL” -Dsonar.login=“$SONAR_TOKEN”
Building project-name @ file:///builds/group1/group2/my-project
Downloading pyside6-essentials (73.5MiB)
Downloading fonttools (4.7MiB)
Downloading scipy (33.4MiB)
Downloading matplotlib (9.4MiB)
Downloading pillow (6.7MiB)
Downloading numpy (15.8MiB)
Downloading pyside6-addons (162.8MiB)
Downloading opencv-python (69.5MiB)
Downloading kiwisolver (1.4MiB)
Downloaded kiwisolver
Built project-name @ file:///builds/group1/group2/my-project
Downloaded fonttools
Downloaded pillow
Downloaded matplotlib
Downloaded numpy
Downloaded scipy
Downloaded opencv-python
Downloaded pyside6-essentials
Downloaded pyside6-addons
warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
If the cache and target directories are on different filesystems, hardlinking may not be supported.
If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.
Installed 17 packages in 580ms
INFO: Starting the analysis…
INFO: Starting SonarScanner Engine…
INFO: Java 17.0.13 Eclipse Adoptium (64-bit)
INFO: Load global settings
INFO: Load global settings (done) | time=2877ms
INFO: Server id: xxxx
INFO: Loading required plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=26ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=2318ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Process project properties (done) | time=0ms
INFO: Project key: xxxx
INFO: Base dir: /builds/group1/group2/my-project
INFO: Working dir: /builds/group1/group2/my-project/.sonar
INFO: Load project settings for component key: ‘xxxx’
INFO: Load project settings for component key: ‘xxxx’ (done) | time=42ms
INFO: Load project branches
INFO: Load project branches (done) | time=26ms
INFO: Load branch configuration
INFO: Detected branch/PR in ‘GitLab’
INFO: Auto-configuring pull request ‘108’
INFO: Load branch configuration (done) | time=4ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=87ms
INFO: Auto-configuring with CI ‘Gitlab CI’
INFO: Load active rules
INFO: Load active rules (done) | time=418ms
INFO: Load analysis cache
INFO: Load analysis cache (404) | time=20ms
INFO: Pull request 108 for merge into master from use-uv-docker
WARNING: The property ‘sonar.login’ is deprecated and will be removed in the future. Please use the ‘sonar.token’ property instead when passing a token.
INFO: Preprocessing files…
WARNING: Cannot run program “/usr/bin/git” (in directory “/usr/bin”): error=2, No such file or directory
INFO: 1 language detected in 75 preprocessed files
INFO: 6 files ignored because of scm ignore settings
INFO: Loading plugins for detected languages
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=1ms
ERROR: Error during SonarScanner Engine execution
ERROR: java.lang.IllegalStateException: Fail to create temp file in /builds/group1/group2/my-project/.sonar/\_tmp
at org.sonar.scanner.bootstrap.PluginFiles.newTempFile(PluginFiles.java:163)
at org.sonar.scanner.bootstrap.PluginFiles.download(PluginFiles.java:97)
at org.sonar.scanner.bootstrap.PluginFiles.get(PluginFiles.java:89)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins(ScannerPluginInstaller.java:123)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installPlugins(ScannerPluginInstaller.java:102)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installPluginsForLanguages(ScannerPluginInstaller.java:83)
at org.sonar.scanner.bootstrap.ScannerPluginRepository.installPluginsForLanguages(ScannerPluginRepository.java:104)
at org.sonar.scanner.scan.SpringProjectScanContainer.installPluginsForLanguages(SpringProjectScanContainer.java:87)
at org.sonar.scanner.scan.SpringProjectScanContainer.doBeforeStart(SpringProjectScanContainer.java:81)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:224)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:350)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:151)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
Caused by: java.nio.file.NoSuchFileException: /builds/group1/group2/my-project/.sonar/\_tmp/fileCache7227077821045593226.tmp
at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(Unknown Source)
at java.base/java.nio.file.Files.newByteChannel(Unknown Source)
at java.base/java.nio.file.Files.createFile(Unknown Source)
at java.base/java.nio.file.TempFileHelper.create(Unknown Source)
at java.base/java.nio.file.TempFileHelper.createTempFile(Unknown Source)
at java.base/java.nio.file.Files.createTempFile(Unknown Source)
at org.sonar.scanner.bootstrap.PluginFiles.newTempFile(PluginFiles.java:161)
… 19 common frames omitted
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
Hello @pasbi!
Thanks for sharing the logs, and sorry to come back to you with so much delay.
I think I have all the information to investigate. I ll come back to you shortly
Your issue might be related to this thread.
TLDR: can you try to set the variable -Dsonar.userHome so it won’t use the default value, like -Dsonar.userHome=.scannerwork?