Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin installed, still sonarq reports "Current edition does not support branch feature" #663

Closed
heidricha opened this issue Aug 25, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@heidricha
Copy link

heidricha commented Aug 25, 2022

Describe the bug
plugin installed, but still got the msg: "Current edition does not support branch feature"
To Reproduce
Steps to reproduce the behavior:
run scanner job in gitlab auto-added project.
job def is

  script:
    - if [ -n "${CI_MERGE_REQUEST_ID}" ]
    - then
    - MAVEN_OPTS="-Dsonar.pullrequest.key=${CI_MERGE_REQUEST_ID} -Dsonar.pullrequest.branch=${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} -Dsonar.pullrequest.base=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
    - else
    - MAVEN_OPTS="-Dsonar.branch.name=${CI_COMMIT_REF_NAME}"
    - fi
    - docker run
      --rm
      --user $(id -u):$(getent group docker|cut -d':' -f3)
      -v /var/run/docker.sock:/var/run/docker.sock
      -e HOME=/src
      -e MAVEN_OPTS="${MAVEN_OPTS} -DskipTests -Dsonar.scm.disabled=true -Duser.home=/src -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN}"
      -w /src/sms-root
      -v $PWD:/src
      --add-host "sonar:${GITLAB_IP}"
      --add-host "nexus:${GITLAB_IP}"
      ${DOCKER_REGISTRY}scom/maven:3.8.4-jdk-11-scom
      mvn verify sonar:sonar -Dsonar.projectKey=powergrid_sms-root_AYLVYM-DvHLQOFc4oNtb

Expected behavior
sonar scan should be uploaded and accounted under the branch name
Software Versions

  • SonarQube Version: 9.6.0.59041
  • Plugin Version: 1.12.0

Additional context

[admin@swarm1 sonar]$ grep javaagent volumes/conf/sonar.properties 
sonar.web.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=web
sonar.ce.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=ce

services:
sonar:
image: sonarqube:9-community
restart: always
hostname: sonar-srv
extra_hosts:
- 'gitlab:${GITLAB_IP}'
- 'sonar:${GITLAB_IP}'
environment:
http_proxy: http://${GITLAB_IP}:8080
https_proxy: http://${GITLAB_IP}:8080
no_proxy: gitlab,sonar,${GITLAB_IP}
SONARQUBE_JDBC_URL: jdbc:postgresql://postgres/sonar-7-5
SONAR_JDBC_URL: jdbc:postgresql://postgres/sonar-7-5
SONAR_JDBC_USERNAME: ...
SONAR_JDBC_PASSWORD: ...
SONARQUBE_WEB_JVM_OPTS: "-Djavax.net.ssl.trustStore=/etc/ssl/sagemcom.jks -Djavax.net.ssl.trustStorePassword=..."
security_opt:
- "seccomp=default.json"
volumes:
- ./sagemcom.jks:/etc/ssl/sagemcom.jks
- ./volumes/conf:/opt/sonarqube/conf
- ./volumes/data:/opt/sonarqube/data
- ./volumes/extensions:/opt/sonarqube/extensions
ports:
- "9000:9000"
links:
- postgres
command: -Dhttp.proxyHost=${GITLAB_IP} -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts="gitlab|sonar|${GITLAB_IP}" -Dhttps.proxyHost=${GITLAB_IP}-Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts="gitlab|sonar|${GITLAB_IP}"

...
sonar_1     | 2022.08.25 15:39:33 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[COMPUTE_ENGINE] from [/opt/sonarqube]: /usr/lib/jvm/java-11-openjdk/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=ce -Dhttp.proxyHost=${GITLAB_IP} -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=gitlab|sonar|${GITLAB_IP}|${GITLAB_IP} -Dhttps.proxyHost=${GITLAB_IP} -Dhttps.proxyPort=8080 -cp ./lib/sonar-application-9.6.0.59041.jar:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.4.0.jar org.sonar.ce.app.CeServer /opt/sonarqube/temp/sq-process14749720744453834730properties
sonar_1     | 15:39:34.239 [main] INFO com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Loading agent
sonar_1     | 15:39:34.266 [main] DEBUG com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Transforming class org.sonar.core.platform.PlatformEditionProvider
sonar_1     | 2022.08.25 15:39:34 INFO  ce[][o.s.p.ProcessEntryPoint] Starting Compute Engine
sonar_1     | 2022.08.25 15:39:34 INFO  ce[][o.s.ce.app.CeServer] Compute Engine starting up...
sonar_1     | 2022.08.25 15:39:35 INFO  ce[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://postgres/sonar-7-5
sonar_1     | 2022.08.25 15:39:36 INFO  ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
sonar_1     | 2022.08.25 15:39:36 INFO  ce[][o.s.c.e.CoreExtensionsLoader] Loaded core extensions: Community Branch Plugin
sonar_1     | 2022.08.25 15:39:36 INFO  ce[][o.s.c.c.CePluginRepository] Load plugins
sonar_1     | 2022.08.25 15:39:38 INFO  ce[][o.s.c.c.ComputeEngineContainerImpl] Running Developer edition
sonar_1     | 2022.08.25 15:39:38 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is started
sonar_1     | 2022.08.25 15:39:38 INFO  app[][o.s.a.SchedulerImpl] Process[ce] is up
sonar_1     | 2022.08.25 15:39:38 INFO  app[][o.s.a.SchedulerImpl] SonarQube is operational
sonar_1     | 2022.08.25 15:40:44 ERROR web[AYLVqYOrTvjLW6MjAAAz][o.s.s.w.WebServiceEngine] Fail to process request http://sonar/api/ce/submit?projectKey=powergrid_sms-root_AYLVYM-DvHLQOFc4oNtb&projectName=SMS%20-%20Root&characteristic=pullRequest%3D3917
sonar_1     | java.lang.IllegalStateException: Current edition does not support branch feature
[admin@swarm1 sonar]$ md5sum volumes/extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar 
a054c5dcf67425709d8525158f9e395f  volumes/extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar
[INFO] Load project settings for component key: 'powergrid_sms-root_AYLVYM-DvHLQOFc4oNtb'
[INFO] Load project settings for component key: 'powergrid_sms-root_AYLVYM-DvHLQOFc4oNtb' (done) | time=108ms
[INFO] Load project branches
[INFO] Load project branches (done) | time=65ms
[INFO] Load project pull requests
[INFO] Load project pull requests (done) | time=32ms
[INFO] Load branch configuration
[INFO] Load branch configuration (done) | time=2ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=144ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=2772ms
[INFO] Load analysis cache
[INFO] Load analysis cache | time=23ms
[INFO] Pull request 3917 for merge into develop from feature-Sonar9
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=52ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] Indexing files of module 'common-message'
[INFO]   Base dir: /src/sms-root/common-message
[INFO]   Source paths: pom.xml, src/main/java
[INFO] Indexing files of module 'sms'
[INFO]   Base dir: /src/sms-root/sms
[INFO]   Source paths: pom.xml, src/main/java
[INFO]   Test paths: src/test/java
[INFO] Indexing files of module 'SMS - Root'
[INFO]   Base dir: /src/sms-root
[INFO]   Source paths: pom.xml
[INFO] 117 files indexed
[INFO] Quality profile for java: Sagemcom-Szeged way
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module common-message
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=53ms
[INFO] Sensor JavaSensor [java]
[INFO] Configured Java source version (sonar.java.source): 11
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=2ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=1ms
[INFO] The Java analyzer is running in a context where unchanged files can be skipped. Full analysis is performed for changed files, optimized analysis for unchanged files.
[INFO] Server-side caching is enabled. The Java analyzer was able to leverage cached data from previous analyses for 63 out of 63 files. These files will not be parsed.
[INFO] No "Main" source files to scan.
[INFO] No "Test" source files to scan.
[INFO] No "Generated" source files to scan.
[INFO] Sensor JavaSensor [java] (done) | time=63ms
[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] Sensor CSS Rules is restricted to changed files only
[INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] Sensor CSS Rules [javascript] (done) | time=2ms
[INFO] Sensor C# Project Type Information [csharp]
[INFO] Sensor C# Project Type Information [csharp] (done) | time=0ms
[INFO] Sensor C# Analysis Log [csharp]
[INFO] Sensor C# Analysis Log [csharp] (done) | time=15ms
[INFO] Sensor C# Properties [csharp]
[INFO] Sensor C# Properties [csharp] (done) | time=0ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/src/sms-root/common-message/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=2ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML is restricted to changed files only
[INFO] Sensor HTML [web] (done) | time=3ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor is restricted to changed files only
[INFO] Sensor XML Sensor [xml] (done) | time=1ms
[INFO] Sensor Text Sensor [text]
[INFO] 64 source files to be analyzed
[INFO] 64/64 source files have been analyzed
[INFO] Sensor Text Sensor [text] (done) | time=44ms
[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=21ms
[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] ------------- Run sensors on module sms
[INFO] Sensor JavaSensor [java]
[INFO] Configured Java source version (sonar.java.source): 11
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=7ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=6ms
[INFO] The Java analyzer is running in a context where unchanged files can be skipped. Full analysis is performed for changed files, optimized analysis for unchanged files.
[INFO] Server-side caching is enabled. The Java analyzer was able to leverage cached data from previous analyses for 51 out of 51 files. These files will not be parsed.
[INFO] No "Main" source files to scan.
[INFO] No "Test" source files to scan.
[INFO] No "Generated" source files to scan.
[INFO] Sensor JavaSensor [java] (done) | time=45ms
[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] Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=78ms
[INFO] Sensor CSS Rules [javascript]
[INFO] Sensor CSS Rules is restricted to changed files only
[INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] Sensor CSS Rules [javascript] (done) | time=0ms
[INFO] Sensor C# Project Type Information [csharp]
[INFO] Sensor C# Project Type Information [csharp] (done) | time=0ms
[INFO] Sensor C# Analysis Log [csharp]
[INFO] Sensor C# Analysis Log [csharp] (done) | time=0ms
[INFO] Sensor C# Properties [csharp]
[INFO] Sensor C# Properties [csharp] (done) | time=0ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/src/sms-root/sms/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=1ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML is restricted to changed files only
[INFO] Sensor HTML [web] (done) | time=0ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor is restricted to changed files only
[INFO] Sensor XML Sensor [xml] (done) | time=1ms
[INFO] Sensor Text Sensor [text]
[INFO] 52 source files to be analyzed
[INFO] 52/52 source files have been analyzed
[INFO] Sensor Text Sensor [text] (done) | time=12ms
[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=0ms
[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] ------------- Run sensors on module SMS - Root
[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=0ms
[INFO] Sensor CSS Rules [javascript]
[INFO] Sensor CSS Rules is restricted to changed files only
[INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] Sensor CSS Rules [javascript] (done) | time=0ms
[INFO] Sensor C# Project Type Information [csharp]
[INFO] Sensor C# Project Type Information [csharp] (done) | time=0ms
[INFO] Sensor C# Analysis Log [csharp]
[INFO] Sensor C# Analysis Log [csharp] (done) | time=1ms
[INFO] Sensor C# Properties [csharp]
[INFO] Sensor C# Properties [csharp] (done) | time=0ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML is restricted to changed files only
[INFO] Sensor HTML [web] (done) | time=0ms
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor is restricted to changed files only
[INFO] Sensor XML Sensor [xml] (done) | time=1ms
[INFO] Sensor Text Sensor [text]
[INFO] 1 source file to be analyzed
[INFO] 1/1 source file has been analyzed
[INFO] Sensor Text Sensor [text] (done) | time=2ms
[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=0ms
[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] ------------- 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=1ms
[INFO] Sensor Java CPD Block Indexer
[INFO] Sensor Java CPD Block Indexer (done) | time=54ms
[INFO] SCM Publisher is disabled
[INFO] CPD Executor 67 files had no CPD blocks
[INFO] CPD Executor Calculating CPD for 42 files
[INFO] CPD Executor CPD calculation finished (done) | time=27ms
[INFO] Analysis report generated in 65ms, dir size=120.5 kB
[INFO] Analysis report compressed in 96ms, zip size=51.7 kB
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for SMS - Root 1.0.43:
[INFO] 
[INFO] SMS - Root ......................................... FAILURE [ 12.858 s]
[INFO] common-message ..................................... SUCCESS [  9.182 s]
[INFO] sms ................................................ SUCCESS [ 15.259 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.404 s
[INFO] Finished at: 2022-08-25T15:40:44Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1[746](https://gitlab/powergrid/sms-root/-/jobs/136353#L746):sonar (default-cli) on project sms-root: Failed to upload report: Error 500 on https://sonar/api/ce/submit?projectKey=powergrid_sms-root_AYLVYM-DvHLQOFc4oNtb&projectName=SMS%20-%20Root&characteristic=pullRequest%3D3917 : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]} -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
@heidricha heidricha added the bug Something isn't working label Aug 25, 2022
@heidricha
Copy link
Author

heidricha commented Aug 26, 2022

I found a few stuff later, so I copied the plugin into plugins/lib/common too (now I have got two of them)
also reverted the sonar.properties to default and use environment variables from the compose file

services:
        sonar:
                image: sonarqube:9-community
                restart: always
                hostname: sonar-srv
                extra_hosts: 
                  - 'gitlab:${GITLAB_IP}'
                  - 'sonar:${GITLAB_IP}'
                environment:
                  http_proxy: http://${GITLAB_IP}:8080
                  https_proxy: http://${GITLAB_IP}:8080
                  no_proxy: gitlab,sonar,${GITLAB_IP}
                  SONARQUBE_JDBC_URL: jdbc:postgresql://postgres/sonar-7-5
                  SONAR_JDBC_URL: jdbc:postgresql://postgres/sonar-7-5
                  #SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
                  SONAR_JDBC_USERNAME: ...
                  SONAR_JDBC_PASSWORD: ...
                  SONARQUBE_WEB_JVM_OPTS: "-Djavax.net.ssl.trustStore=/etc/ssl/sagemcom.jks -Djavax.net.ssl.trustStorePassword=changeit"
                  SONAR_WEB_JAVAADDITIONALOPTS: "-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=web"
                  SONAR_CE_JAVAADDITIONALOPTS: "-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=ce"
                security_opt:
                  - "seccomp=default.json"
                volumes:
                  - ./sagemcom.jks:/etc/ssl/sagemcom.jks
                  # - ./volumes/conf:/opt/sonarqube/conf
                  - ./volumes/data:/opt/sonarqube/data
                  - ./volumes/extensions:/opt/sonarqube/extensions

[admin@swarm1 sonar]$ docker-compose exec sonar ls -lR /opt/sonarqube/extensions/
/opt/sonarqube/extensions/:
total 0
drwx------    1 sonarqub sonarqub         0 Aug 25 08:15 downloads
drwx------    1 sonarqub sonarqub        94 Aug 26 07:51 plugins

/opt/sonarqube/extensions/downloads:
total 0

/opt/sonarqube/extensions/plugins:
total 12232
drwx------    1 sonarqub sonarqub        12 Aug 26 07:51 lib
-rwx------    1 sonarqub sonarqub  12523181 Aug 25 11:17 sonarqube-community-branch-plugin-1.12.0.jar

/opt/sonarqube/extensions/plugins/lib:
total 0
drwx------    1 sonarqub sonarqub        88 Aug 26 08:56 common

/opt/sonarqube/extensions/plugins/lib/common:
total 12232
-rwx------    1 sonarqub sonarqub  12523181 Aug 26 08:56 sonarqube-community-branch-plugin-1.12.0.jar

now ce loads the plugin, and reports "running Developer edition", but the web component ignores everything

sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.s.RegisterPlugins] Register plugins
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.SonarLintConnectionFilter@45d8786b [pattern=UrlPattern{inclusions=[/api/*], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceFilter@309c0bea [pattern=UrlPattern{inclusions=[/api/issues/delete_comment.*, ...], exclusions=[/api/authentication/login.*, ...]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.platform.web.WebServiceReroutingFilter@4eec5f46 [pattern=UrlPattern{inclusions=[/api/components/bulk_update_key, ...], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.DefaultAdminCredentialsVerifierFilter@4f1410d9 [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@49893270 [pattern=UrlPattern{inclusions=[/sessions/init/*], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@199aa3f0 [pattern=UrlPattern{inclusions=[/oauth2/callback/*], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ResetPasswordFilter@3520c9ea [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LoginAction@20a3204d [pattern=UrlPattern{inclusions=[/api/authentication/login], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LogoutAction@7e4b6efd [pattern=UrlPattern{inclusions=[/api/authentication/logout], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.ValidateAction@58d12fbc [pattern=UrlPattern{inclusions=[/api/authentication/validate], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.user.ws.ChangePasswordAction@5add854f [pattern=UrlPattern{inclusions=[/api/users/change_password], exclusions=[]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.plugins.PluginsRiskConsentFilter@5ac726d6 [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.q.ProjectsInWarningDaemon] Counting number of projects in warning is not started as there are no projects in this situation.
sonar_1     | 2022.08.26 09:04:01 INFO  web[][o.s.s.p.p.PlatformLevelStartup] Running Community Edition
sonar_1     | 2022.08.26 09:04:02 INFO  web[][o.s.s.p.Platform] Web Server is operational
sonar_1     | 2022.08.26 09:04:02 INFO  app[][o.s.a.SchedulerImpl] Process[web] is up
sonar_1     | 2022.08.26 09:04:02 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[COMPUTE_ENGINE] from [/opt/sonarqube]: /usr/lib/jvm/java-11-openjdk/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=ce -Dhttp.proxyHost=10.254.138.80 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=gitlab|sonar|10.254.138.88|10.254.138.80 -Dhttps.proxyHost=10.254.138.80 -Dhttps.proxyPort=8080 -cp ./lib/sonar-application-9.6.0.59041.jar:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.4.0.jar org.sonar.ce.app.CeServer /opt/sonarqube/temp/sq-process14072364967126418186properties
sonar_1     | 09:04:02.494 [main] INFO com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Loading agent
sonar_1     | 09:04:02.514 [main] DEBUG com.github.mc1arke.sonarqube.plugin.CommunityBranchAgent - Transforming class org.sonar.core.platform.PlatformEditionProvider
sonar_1     | 2022.08.26 09:04:02 INFO  ce[][o.s.p.ProcessEntryPoint] Starting Compute Engine
sonar_1     | 2022.08.26 09:04:02 INFO  ce[][o.s.ce.app.CeServer] Compute Engine starting up...
sonar_1     | 2022.08.26 09:04:03 INFO  ce[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://postgres/sonar-7-5
sonar_1     | 2022.08.26 09:04:04 INFO  ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
sonar_1     | 2022.08.26 09:04:05 INFO  ce[][o.s.c.e.CoreExtensionsLoader] Loaded core extensions: Community Branch Plugin
sonar_1     | 2022.08.26 09:04:05 INFO  ce[][o.s.c.c.CePluginRepository] Load plugins
sonar_1     | 2022.08.26 09:04:06 INFO  ce[][o.s.c.c.ComputeEngineContainerImpl] Running Developer edition
sonar_1     | 2022.08.26 09:04:06 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is started

@heidricha
Copy link
Author

heidricha commented Aug 26, 2022

OK, I solved it finally...
looks like sonar.web.javaAdditionalOpts is ignored by web starter

the solution became:

        sonar:
                image: sonarqube:9-community
                restart: always
                hostname: sonar-srv
                extra_hosts: 
                  - 'gitlab:${GITLAB_IP}'
                  - 'sonar:${GITLAB_IP}'
                environment:
                  http_proxy: http://${GITLAB_IP}:8080
                  https_proxy: http://${GITLAB_IP}:8080
                  no_proxy: gitlab,sonar,${GITLAB_IP}
                  SONARQUBE_JDBC_URL: jdbc:postgresql://postgres/sonar-7-5
                  SONAR_JDBC_URL: jdbc:postgresql://postgres/sonar-7-5
                  #SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
                  SONAR_JDBC_USERNAME: ...
                  SONAR_JDBC_PASSWORD: ...
                  SONAR_WEB_JVM_OPTS: "-Djavax.net.ssl.trustStore=/etc/ssl/sagemcom.jks -Djavax.net.ssl.trustStorePassword=changeit"
                  SONAR_WEB_JAVAOPTS: "-Djavax.net.ssl.trustStore=/etc/ssl/sagemcom.jks -Djavax.net.ssl.trustStorePassword=changeit -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=web"
                  SONAR_CE_JAVAADDITIONALOPTS: "-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=ce"
                security_opt:
                  - "seccomp=default.json"
                volumes:
                  - ./sagemcom.jks:/etc/ssl/sagemcom.jks
                  # - ./volumes/conf:/opt/sonarqube/conf
                  - ./volumes/data:/opt/sonarqube/data
                  - ./volumes/extensions:/opt/sonarqube/extensions
                ports:
                  - "9000:9000"
                links:
                  - postgres
                command: -Dhttp.proxyHost=${GITLAB_IP} -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts="gitlab|sonar|${GITLAB_IP}" -Dhttps.proxyHost=${GITLAB_IP} -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts="gitlab|sonar|${GITLAB_IP}"

@heidricha
Copy link
Author

Solved it myself

@MingGH
Copy link

MingGH commented Mar 16, 2023

If you deployed Sonarqube using Docker and don't want to delete the container (perhaps you have forgotten the startup command), you can modify the parameters in the following way:
Enter the container:
docker exec -it sonarqube /bin/bash
find the sonar.properties file in the conf directory and make the following changes:

sonar.web.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=web
sonar.ce.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.12.0.jar=ce

The effect will be the same.

@ThePresence
Copy link

Hi @MingGH I'm facing the same issue. but when I go into docker exec -it sonarqube /bin/bash and sonar.properties I don't find any config which I've passed to docker-compose file, but I can see that plugin is installed under available plugin. What maybe the issue?

@MingGH
Copy link

MingGH commented May 3, 2023

Hi @MingGH I'm facing the same issue. but when I go into docker exec -it sonarqube /bin/bash and sonar.properties I don't find any config which I've passed to docker-compose file, but I can see that plugin is installed under available plugin. What maybe the issue?

I have an idea. After you enter the container using docker exec -it sonarqube /bin/bash you can directly search for the configuration file path within the container using find / -name 'sonar.properties'. This might be helpful

@ThePresence
Copy link

Hi @MingGH I'm facing the same issue. but when I go into docker exec -it sonarqube /bin/bash and sonar.properties I don't find any config which I've passed to docker-compose file, but I can see that plugin is installed under available plugin. What maybe the issue?

I have an idea. After you enter the container using docker exec -it sonarqube /bin/bash you can directly search for the configuration file path within the container using find / -name 'sonar.properties'. This might be helpful

I do find file called sonar.properties but in that file I don't see the values I've passed.

@MingGH
Copy link

MingGH commented May 4, 2023

Hi @MingGH I'm facing the same issue. but when I go into docker exec -it sonarqube /bin/bash and sonar.properties I don't find any config which I've passed to docker-compose file, but I can see that plugin is installed under available plugin. What maybe the issue?

I have an idea. After you enter the container using docker exec -it sonarqube /bin/bash you can directly search for the configuration file path within the container using find / -name 'sonar.properties'. This might be helpful

I do find file called sonar.properties but in that file I don't see the values I've passed.

If you don't find the corresponding configuration, add the configuration directly, and then try restart sonarqube, it may be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants