SonarQube 6.7.4 Upgrade to 8.9.6 LTS inclluding MYSQL to Postgres migration

Yes, everything will be copied over. You are welcome to keep backup copies at each LTS version migration and verify before upgrading again.

Nothing else is needed. Just upgrade and test and then you’re ready.

Thank you!

Is sonar-web-plugin has been replaced by sonar-html-plugin?

I upgraded sonarqube from 6.7.4 to 7.9, but I am getting a failure in jenkins pipeline while trying to scan:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project idsp-platform-parent: Unable to load component class org.sonar.scanner.scan.ProjectLock: Unable to load component class org.sonar.api.batch.fs.internal.DefaultInputProject: Unable to load component class org.sonar.scanner.scan.ProjectBuildersExecutor: Unable to load component class com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder: com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder has unsatisfied dependency ‘class com.talanlabs.sonar.plugins.gitlab.CommitFacade’ for constructor ’

I have SonarQube Scanner for Jenkins 2.14. Should I upgrade this plugin?

Yes.

You are using a third-party plugin, which SonarSource doesn’t support. Please check the maintainer of that sonar-gitlab-plugin or uninstall it. I see similar reports of your issue here: Error caused by: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency · Issue #213 · gabrie-allaigre/sonar-gitlab-plugin · GitHub

No, that is the latest version and it’s backwards compatible, so that’s ok.

Thank you for your reply. I don’t have any gitlab plugin installed in Jenkins. Here is the maven command for scanning:
mvn -B -s /prod/.m2/settings.xml org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar -Dmaven.repo.local=.repository -Dsonar.sources=src/main,pom.xml -Dsonar.host.url=(/ -Dsonar.projectKey=cipher -Dsonar.projectName=p -Dsonar.branch=develop

No, that gitlab plugin is on your SonarQube instance. Try removing it from SonarQube, restart it, then scan your project again.

Thank you! It worked by removing giltab plugin.
Now I am testing my plugin, I noticed sonarqube maven plugin The ‘sonar.branch’ parameter is no longer supported. I am on community edition.
What is the workaround.
Here the existing parameter: Dsonar.projectKey=cipher -Dsonar.projectName=p -Dsonar.branch=develop
How can I maintain having separate projects for each branch.

Also as 7.9 is on my migration path and my goal is 8.9LTS, do you think I should continue to upgrade to 8.9 and then resolve the plugin compatibility issues?

Awesome!

This is why we sell Developer Edition, which can do branch analysis. Community only does one branch. See here for feature comparisons: Download | SonarQube

By plugin, are you talking about SonarQube plugins? I suggest removing that plugin and upgrading to 8.9LTS, and then adding back whatever plugin you want to test with.

Thank you for your reply. About the sonar.branch deprecation, I am trying to see if there is work around. I need to know if I set projectKey=+ will give the same result. We want to capture the analysis for each branch separately. I just tried this workaround, and created a project with the given. Do you think this will give me the desired outcome? I am not sure if this impacts the DB size.

About the last question, I meant is it better I don’t try to get plugins working in SonarQube 7.9, including SonarScanner , but continue upgrading to 8.9LTS and then test the plugins and try to make necessary upgrades. It seems a lot of plugins are already bundled in 8,9.

Your workaround idea will work, but you will duplicate all that data in your database, which definitely artificially increases its size. You should consider Developer Edition license to get multi-branch analysis.

Precisely, lots of plugins are already bundled, glad you know about that already. Agree, yes that’s a good idea. Don’t worry about plugins and just get to SQ 8.9LTS first.

Hi Joe,
Thank you for reply. As you suggested, I am going to upgrade to 8.9. I looked at 8.9 requirements for SonarScanner JDK 8 and 11 shown as supported, however there is warning when I scan the project in 7,9,
[WARNING] SonarScanner will require Java 11 to run starting in SonarQube 8.x

So does it mean that JDK8 won’t be supported in future?
For now I need to stick with JDK8.

Also for PostGres I am on 9.6 and it is still supported in 8.9, so I don’t have to upgrade at this point. Is that right?

Correct, in SonarQube 9.0 and up, you must use JDK11 for Sonar analysis, but that doesn’t stop you from using JDK8 to build the project. Please review https://docs.sonarqube.org/latest/analysis/analysis-with-java-11/.

Thank you!

PostGres 9.6 shown as supported in SQ 8.9, so I don’t have to upgrade at this point. Is that right?

1 Like

Correct, see our docs: Prerequisites and overview

Thank you again for all valuable information. I was able to upgrade to 8,9, and now trying to get the plugins to work.
The Sonar for Bitbucket plugin is not working after the upgrade. This allows to see the SQ analysis for a branch on pull request page. In 7.9 I got it to work partially but in 8.9 I cannot even configure it. No Sonar project is found and I get JSON related error. I have BB v4.14.12 and Sonar for BB plugin 2.2.2. Does this plugin work with SQ 8.9?

Glad you made it to SQ 8.9! Welcome!

About this Sonar for BB plugin, I’m not sure which plugin you are speaking of. Do you have a link to it?

Hi Joe,
This is Sonar for Bitbucket plugin which allows BB to pull in sonar analysis and displays on BB pull request page. Anyhow I found my answer. We need to upgrade BB and the plugin to higher version.
However I am dealing with another issue. We are trying to scan a large ant project using SonarScanner plugin (v4.2.0) in jenkins. Due to sonar.branch property deprecated, I had to remove this property from sonar.properties and changed it to projectkey = :. Same trick worked on the Maven side.
In order to split the projects into modules for analysis, we have created the property file as displayed below by specifying the configuration for each module.
With the old SQ, each module was analyzed separately, but as soon as I removed
branch property and named project key as : it caused the whole
project to be analyzed as whole. I have attached snippet of the log file Please review it.

sonarqubeissue.txt (2.5 KB)

sonar.projectName=trt-all
sonar.projectVersion=build-354
sonar.language=java
sonar.sources=

sonar.modules=batchfeeder,restricted,

sonar.exclusions=…

configuration for each module

batchfeeder.sonar.projectName=batchfeeder
batchfeeder.sonar.sources=/…
batchfeeder.sonar.tests=/…
batchfeeder.sonar.junit.reportsPath=/work/…
batchfeeder.sonar.cobertura.reportPath=/work…

configuration for restricted

batchsystem2.sonar.projectName=restricted
batchsystem2.sonar.sources=/work/production/…

Hi @zservati ,

I’m glad you got your answer about the BB plugin; it sounds like you were referring to the Mibex Sonar for Bitbucket plugin.

Regarding your latest error:

16:04:27 java.lang.OutOfMemoryError: GC overhead limit exceeded

Please create a new thread with the entire stack trace shown. You cut off some of it so its hard to check what could have caused it.

For any new questions, please start a new topic since your upgrade is complete. This allows us to ensure each Community thread has the right topic with the right solution.