Must-share information (formatted with Markdown):
-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Community Edition; Version 10.3 (build 82913) -
how is SonarQube deployed: zip, Docker, Helm
Docker
version: "3"
services:
sonarqube:
image: sonarqube:latest
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.sonarqube.rule=Host(`sonarqube.--REDACTED--`)"
- "traefik.http.routers.sonarqube.tls=true"
- "traefik.http.routers.sonarqube.entrypoints=web-secure"
- "traefik.http.services.sonarqube.loadbalancer.server.port=9000"
depends_on:
- db
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: --REDACTED--
SONAR_JDBC_PASSWORD: --REDACTED--
SONAR_CORE_SERVERBASEURL: https://sonarqube.--REDACTED--
volumes:
- ./sonar.properties:/opt/sonarqube/conf/sonar.properties
- ./.dockerdata/sonarqube_data:/opt/sonarqube/data
- ./.dockerdata/sonarqube_extensions:/opt/sonarqube/extensions
- ./.dockerdata/sonarqube_logs:/opt/sonarqube/logs
db:
image: postgres:12
restart: always
environment:
POSTGRES_USER: --REDACTED--
POSTGRES_PASSWORD: --REDACTED--
volumes:
- ./.dockerdata/postgresql:/var/lib/postgresql
- ./.dockerdata/postgresql_data:/var/lib/postgresql/data
networks:
default:
external:
name: traefik_proxy
sonar.properties
# all commented before this
sonar.web.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.16.1.jar=web
sonar.ce.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.16.1.jar=ce
-
what are you trying to achieve
Caching, is there avaiable for community edition ? where do I find this docs / feature comparison. This caching is specifically for PHP and JS Scanner, because I always get
INFO: The PHP analyzer was able to leverage cached data from previous analyses for 0 out of 23 files. These files were not parsed.
this seems it doesnt leverage some cache ? which is presumably available ? or is it only available for developer(or higher) / sonarcloud ? -
what have you tried so far to achieve this
Searching for feature “Sonar Cache” and “sonar.sensor.cache.project.enable” which is not available on my setup but its indeed show in sonarcloud
I’m also aware of:
- Sonar’s analysis performance targets | Sonar
- Sonar scanner performance - #5 by Roger_Oberg
- SonarCloud not leveraging cached data - #7 by shane.findley
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
Full logs for sonar scanner pHP
$ cat sonar-project.properties
sonar.sources=app/
sonar.tests=tests/
sonar.coverage.exclusions=app/OpenApi/**
sonar.projectKey=unpad-pena-services-templates-laravel
sonar.qualitygate.wait=true
sonar.projectVersion=
$ sonar-scanner | grep -e "INFO" -e "ERROR"
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/unpad/pena/services/templates/laravel/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.8 Alpine (64-bit)
INFO: Linux 5.10.0-21-amd64 amd64
INFO: User cache: /builds/unpad/pena/services/templates/laravel/.sonar/cache
INFO: Analyzing on SonarQube server 10.0.0.68432
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=138ms
INFO: Server id: 243B8A4D-AX8GkSOzv3K7C8Obt8W1
INFO: User cache: /builds/unpad/pena/services/templates/laravel/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=70ms
INFO: Load/download plugins (done) | time=1835ms
INFO: Process project properties
INFO: Process project properties (done) | time=14ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: unpad-pena-services-templates-laravel
INFO: Base dir: /builds/unpad/pena/services/templates/laravel
INFO: Working dir: /builds/unpad/pena/services/templates/laravel/.scannerwork
INFO: Load project settings for component key: 'unpad-pena-services-templates-laravel'
INFO: Load project settings for component key: 'unpad-pena-services-templates-laravel' (done) | time=18ms
INFO: Load project branches
INFO: Load project branches (done) | time=19ms
INFO: Load branch configuration
INFO: Auto detected BRANCH configuration with source pipeline-tester using com.github.mc1arke.sonarqube.plugin.scanner.autoconfiguration.GitlabCiAutoConfigurer
INFO: Load branch configuration (done) | time=3ms
INFO: Auto-configuring with CI 'Gitlab CI'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=52ms
INFO: Load active rules
INFO: Load active rules (done) | time=1350ms
INFO: Load analysis cache
INFO: Load analysis cache (8.1 kB) | time=22ms
INFO: Branch name: pipeline-tester
INFO: Load project repositories
INFO: Load project repositories (done) | time=22ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources for coverage: app/OpenApi/**
INFO: Excluded sources for duplication: app/Models/**
INFO: 23 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for php: Unpad
INFO: ------------- Run sensors on module unpad-pena-services-templates-laravel
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=25ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor CSS Rules [javascript]
INFO: 19 source files to be analyzed
INFO: 19/19 source files have been analyzed
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor CSS Rules [javascript] (done) | time=8151ms
INFO: Sensor C# Project Type Information [csharp]ERROR: An error occurred when reading report file '/builds/unpad/pena/services/templates/laravel/report.xml', nothing will be imported from this report. IOException: /builds/unpad/pena/services/templates/laravel/report.xml (No such file or directory)
ERROR: An error occurred when reading report file '/builds/unpad/pena/services/templates/laravel/coverage.xml', nothing will be imported from this report. IOException: /builds/unpad/pena/services/templates/laravel/coverage.xml (No such file or directory)
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=16ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=31ms
INFO: Sensor PHP sensor [php]
INFO: Starting PHP symbol indexer
INFO: 23 source files to be analyzed
INFO: 23/23 source files have been analyzed
INFO: Cached information of global symbols will be used for 0 out of 23 files. Global symbols were recomputed for the remaining files.
INFO: Starting PHP rules
INFO: 23 source files to be analyzed
INFO: 23/23 source files have been analyzed
INFO: The PHP analyzer was able to leverage cached data from previous analyses for 0 out of 23 files. These files were not parsed.
INFO: Importing /builds/unpad/pena/services/templates/laravel/report.xml
INFO: Importing /builds/unpad/pena/services/templates/laravel/coverage.xml
INFO: Sensor PHP sensor [php] (done) | time=972ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=2ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: 23 source files to be analyzed
INFO: 23/23 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=28ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=20ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor (done) | time=2ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=86ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=8ms
INFO: CPD Executor 9 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 9 files
INFO: CPD Executor CPD calculation finished (done) | time=9ms
INFO: Load New Code definition
INFO: Load New Code definition (done) | time=10ms
INFO: Analysis report generated in 80ms, dir size=159.3 kB
INFO: Analysis report compressed in 121ms, zip size=58.3 kB
INFO: Analysis report uploaded in 69ms
INFO: ------------- Check Quality Gate status
INFO: Waiting for the analysis report to be processed (max 300s)
INFO: QUALITY GATE STATUS: PASSED - View details on https://sonarqube.unpad.dev/dashboard?id=unpad-pena-services-templates-laravel&branch=pipeline-tester
INFO: Analysis total time: 26.087 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 30.576s
INFO: Final Memory: 25M/120M
INFO: ------------------------------------------------------------------------
Full logs for sonar scanner JS
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/unpad/ui-alchemist/pimnas-app/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.8 Alpine (64-bit)
INFO: Linux 5.10.0-21-amd64 amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Analyzing on SonarQube server 10.0.0.68432
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=148ms
INFO: Server id: 243B8A4D-AX8GkSOzv3K7C8Obt8W1
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=63ms
INFO: Load/download plugins (done) | time=1813ms
INFO: Process project properties
INFO: Process project properties (done) | time=0ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: unpad-ui-alchemist-pimnas-app
INFO: Base dir: /builds/unpad/ui-alchemist/pimnas-app
INFO: Working dir: /builds/unpad/ui-alchemist/pimnas-app/.scannerwork
INFO: Load project settings for component key: 'unpad-ui-alchemist-pimnas-app'
INFO: Load project settings for component key: 'unpad-ui-alchemist-pimnas-app' (done) | time=26ms
INFO: Load project branches
INFO: Load project branches (done) | time=18ms
INFO: Load branch configuration
INFO: Auto detected BRANCH configuration with source main using com.github.mc1arke.sonarqube.plugin.scanner.autoconfiguration.GitlabCiAutoConfigurer
INFO: Load branch configuration (done) | time=2ms
INFO: Auto-configuring with CI 'Gitlab CI'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=56ms
INFO: Load active rules
INFO: Load active rules (done) | time=1174ms
INFO: Load analysis cache
INFO: Load analysis cache | time=52ms
INFO: Branch name: main
INFO: Load project repositories
INFO: Load project repositories (done) | time=20ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources for duplication: app/Models/**
INFO: 289 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for css: Sonar way
INFO: Quality profile for js: Sonar way
INFO: Quality profile for json: Sonar way
INFO: Quality profile for ts: Sonar way
INFO: ------------- Run sensors on module unpad-ui-alchemist-pimnas-app
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=21ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=23ms
INFO: Sensor IaC Kubernetes Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=10ms
INFO: Sensor JavaScript analysis [javascript]
INFO: Creating TypeScript program
INFO: TypeScript configuration file /builds/unpad/ui-alchemist/pimnas-app/.scannerwork/.sonartmp/3399724408287112789.tmp
INFO: 9 source files to be analyzed
INFO: Creating TypeScript program (done) | time=629ms
INFO: Starting analysis with current program
INFO: Analyzed 9 file(s) with current program
INFO: 9/9 source files have been analyzed
INFO: Hit the cache for 0 out of 9
INFO: Miss the cache for 9 out of 9: ANALYSIS_MODE_INELIGIBLE [9/9]
INFO: Sensor JavaScript analysis [javascript] (done) | time=8551ms
INFO: Sensor TypeScript analysis [javascript]
INFO: Found 1 tsconfig.json file(s): [/builds/unpad/ui-alchemist/pimnas-app/tsconfig.json]
INFO: Creating TypeScript program
INFO: TypeScript configuration file /builds/unpad/ui-alchemist/pimnas-app/tsconfig.json
INFO: 196 source files to be analyzed
INFO: Creating TypeScript program (done) | time=976ms
INFO: Starting analysis with current program
INFO: 130/196 files analyzed, current file: /builds/unpad/ui-alchemist/pimnas-app/services/helpers/DateFormatter.tsx
INFO: Analyzed 196 file(s) with current program
INFO: 196/196 source files have been analyzed
INFO: Hit the cache for 0 out of 196
INFO: Miss the cache for 196 out of 196: ANALYSIS_MODE_INELIGIBLE [196/196]
INFO: Sensor TypeScript analysis [javascript] (done) | time=19316ms
INFO: Sensor CSS Rules [javascript]
INFO: 17 source files to be analyzed
INFO: 17/17 source files have been analyzed
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor CSS Rules [javascript] (done) | time=636ms
INFO: Sensor CSS Metrics [javascript]
INFO: Sensor CSS Metrics [javascript] (done) | time=98ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=32ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=7ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: 228 source files to be analyzed
INFO: 228/228 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=344ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=14ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor (done) | time=1ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=83ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=57ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 5 source files to be analyzed
INFO: SCM Publisher 5/5 source files have been analyzed (done) | time=287ms
INFO: CPD Executor 17 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 188 files
INFO: CPD Executor CPD calculation finished (done) | time=148ms
INFO: Load New Code definition
INFO: Load New Code definition (done) | time=10ms
INFO: Analysis report generated in 178ms, dir size=2.4 MB
INFO: Analysis report compressed in 1137ms, zip size=1.5 MB
INFO: Analysis report uploaded in 126ms
INFO: ------------- Check Quality Gate status
INFO: Waiting for the analysis report to be processed (max 300s)
INFO: QUALITY GATE STATUS: PASSED - View details on https://sonarqube.unpad.dev/dashboard?id=unpad-ui-alchemist-pimnas-app&branch=main
INFO: Analysis total time: 48.007 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 52.360s
INFO: Final Memory: 22M/96M
INFO: ------------------------------------------------------------------------