- SonarQube Server (Developer)
- pysonar: 1.1.0.2035
- how is SonarQube deployed: Helm
- what are you trying to achieve: scan
Additional:
- Using in GitLab CI/CD
- refactored our Python GitLab CI/CD component and upgraded from pysonar-scanner 0.1.0.340
As you can see in the log we can create the directory path .sonar/_tmp
but pysonar (actually, SonarScanner) can’t create the temp file.
$ id
uid=1000710000(1000710000) gid=0(root) groups=0(root),1000710000
$ mkdir -p .sonar/_tmp
$ pwd
/builds/sysdev/devops/pipeline-tools/container-file-creator
$ ls -la
total 24
drwxrwsrwx. 9 1000710000 1000710000 4096 Aug 7 13:26 .
drwxrwsrwx. 4 1000710000 1000710000 70 Aug 7 13:25 ..
drwxrwsrwx. 6 1000710000 1000710000 113 Aug 7 13:25 .git
-rw-rw-rw-. 1 1000710000 1000710000 212 Aug 7 13:25 .gitlab-ci.yml
drwxr-sr-x. 3 1000710000 1000710000 18 Aug 7 13:26 .sonar
-rw-rw-rw-. 1 1000710000 1000710000 335 Aug 7 13:25 README.md
drwxr-xr-x. 2 1000710000 1000710000 64 Aug 7 13:25 build
drwxrwsrwx. 3 1000710000 1000710000 20 Aug 7 13:26 cloned_repos
drwxrwsrwx. 2 1000710000 1000710000 84 Aug 7 13:25 containerbuild
-rw-rw-rw-. 1 1000710000 1000710000 1682 Aug 7 13:25 pyproject.toml
-rw-rw-rw-. 1 1000710000 1000710000 179 Aug 7 13:25 renovate.json5
-rw-r--r--. 1 1000710000 1000710000 96 Aug 7 13:24 sonar-project.properties
drwxrwsrwx. 3 1000710000 1000710000 36 Aug 7 13:25 src
drwxrwsrwx. 4 1000710000 1000710000 35 Aug 7 13:25 tests
$ pysonar --sonar-qualitygate-wait --sonar-sources src --sonar-tests tests --sonar-python-xunit-report-path build/junit.xml --sonar-python-coverage-report-paths build/coverage.xml --sonar-python-flake8-report-paths build/flake8.report
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=502ms
INFO: Server id: 671E7C50-AXuyyDQiased6qMiZ54M
INFO: Loading required plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=45ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=2085ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Process project properties (done) | time=12ms
INFO: Project key: sysdev_devops_pipeline-tools_deploy-utils_cfceda2e-82ca-4fcd-98b1-19ac4f45c6b4
INFO: Base dir: /builds/sysdev/devops/pipeline-tools/container-file-creator
INFO: Working dir: /builds/sysdev/devops/pipeline-tools/container-file-creator/.sonar
INFO: Load project settings for component key: 'sysdev_devops_pipeline-tools_deploy-utils_cfceda2e-82ca-4fcd-98b1-19ac4f45c6b4'
INFO: Load project settings for component key: 'sysdev_devops_pipeline-tools_deploy-utils_cfceda2e-82ca-4fcd-98b1-19ac4f45c6b4' (done) | time=36ms
INFO: Load project branches
INFO: Load project branches (done) | time=39ms
INFO: Load branch configuration
INFO: Detected branch/PR in 'GitLab'
INFO: Auto-configuring branch 'feature/test_feature/13_allow-us-to-build-for-the-latest-version-of-python'
INFO: Load branch configuration (done) | time=4ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=95ms
INFO: Auto-configuring with CI 'Gitlab CI'
INFO: Load active rules
INFO: Load active rules (done) | time=724ms
INFO: Load analysis cache
INFO: Load analysis cache | time=71ms
INFO: Branch name: feature/test_feature/13_allow-us-to-build-for-the-latest-version-of-python
INFO: Preprocessing files...
WARNING: Cannot run program "/usr/bin/git" (in directory "/usr/bin"): error=2, No such file or directory
INFO: 4 languages detected in 17 preprocessed files
INFO: 0 files ignored because of scm ignore settings
INFO: Loading plugins for detected languages
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=0ms
ERROR: Error during SonarScanner Engine execution
ERROR: java.lang.IllegalStateException: Fail to create temp file in /builds/sysdev/devops/pipeline-tools/container-file-creator/.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:90)
at org.sonar.scanner.scan.SpringProjectScanContainer.doBeforeStart(SpringProjectScanContainer.java:84)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:225)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:339)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
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/sysdev/devops/pipeline-tools/container-file-creator/.sonar/_tmp/fileCache6738046257763295766.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