Need to Upgrade 7.9.2 Sonarqube version deployed to EKS using stable/helmchart to 9.9 or latest now

Current Version : 7.9.2-Community

Database Used : Aurora Postgesql.

Deployed : Using stable/sonarqube helm charts in 2021 deployed to AWS EKS Cluster

Objective : Planned upgrade from 7.9.2 → 8.9.10 ( First ) then 8.9.10 → 9.9

Already taken a backup of everything.

Only changing the docker image version is enough and the DB migration ( setup ) would take care of rest of things or Do I need to take care of any other things while upgrade.

Let me know how to move further that makes upgrade so smooth.

Hi,

Welcome to the community!

It sounds like you’ve got this under control.

I would just add making a DB backup after your 8.9.10 migration. After all, if something happens in the upgrade to 9.9, you don’t want to have to start over at 7.9.2.

Note that by the time you get to 9.9, the envvar names have changed from SONARQUBE_* to SONAR_*.

You may find these resources helpful:

Unfortunately, I don’t have a summary of the changes from 7.9 to 8.9 for you.

 
HTH,
Ann

@ganncamp Also , I have few ext-plugins that we were running in old 7.9.2 like below.
Which we are mounting to a volume and attaching to container. If now , after upgrade to 8.9.10 , will there be any issue with scanning ( profiles & quality gates ).

List of plugins that we installing are below and copying to /extensions/plugins & also added some ldap properties for adding users and groups with LDAP.Everything will work if I remove all plugins and things. Becasue I read that we need to remove everything from extensions/plugins to upgrade to > 8.5 .

checkstyle-sonar-plugin-8.40.jar
qualinsight-sonarqube-smell-plugin-4.0.0.jar
sonar-cloudformation-plugin-2.0.10.jar
sonar-csharp-plugin-8.6.1.17183.jar
sonar-css-plugin-1.2.1.1602.jar
sonar-dependency-check-plugin-2.0.5.jar
sonar-findbugs-plugin-4.0.4.jar
sonar-groovy-plugin-1.7.jar
sonar-html-plugin-3.2.0.2082.jar
sonar-jacoco-plugin-1.1.0.898.jar
sonar-java-plugin-6.3.2.22818.jar
sonar-javascript-plugin-6.2.2.13315.jar
sonar-ldap-plugin-2.2.0.601.jar /
sonar-php-plugin-3.3.0.5166.jar
sonar-python-plugin-2.8.0.6204.jar
sonar-scm-git-plugin-1.12.1.2064.jar /
sonar-shellcheck-plugin-2.4.0.jar
sonar-typescript-plugin-2.1.0.4359.jar
sonar-webdriver-plugin-1.0.5.jar
sonar-xanitizer-plugin-2.2.0.jar
sonar-xml-plugin-2.0.1.2020.jar
sonar-yaml-plugin-1.6.0.jar

Hi,

SonarSource now bundles all its functionality, so we no longer provide “plugins”.

In general, for an upgrade you shouldn’t just copy your plugins anyway, but - as the upgrade instructions direct:

  1. If you’re using third-party plugins, Manually install plugins that are compatible with your version of SonarQube. Use the plugin version matrix to ensure that the versions you install are compatible with your server version. Simply copying plugins from the old server to the new is not recommended; incompatible or duplicate plugins could cause startup errors. Analysis of all languages provided by your edition is available by default without plugins.

 
HTH,
Ann

@ganncamp After DB migrate /setup . Do we need to run any commands on DB after reindexing and all happend or is it not needed for amazon aurora.

Hi,

Our recommendations are in the docs I’ve linked.

 
HTH,
Ann

@ganncamp I finished upgarde from 7.9.2 to 8.9.10 . Everything looks good.

But after I upgraded 8.9.10 to 9.9.1 ( I am unable to see the projects ). DB didn’t asked for migration. Its telling already DB is upto date.
logs.txt (5.6 KB)
Atached logs FYI

Hi,

I suspect your DB configuration is missing or incomplete. These aren’t full logs. If you look at your full server logs I suspect you’ll find you’re using the embedded H2 DB.

 
HTH,
Ann

@ganncamp No am using the postresql that we are using from 7.9.2 and even after upgarde to 8.9.10. Not sure were it took that DB config from. I just updated the docker image to 9.9.1 in place of 8.9.10 , no other changes were done.

Hi,

I’m pretty sure you’re connected to H2, and that’s why you weren’t prompted to upgrade. Wanna share your full server logs?

 
Ann

Please send the upgrade documents from 8.9.10 to 9.x LTS / 10.x

Even tried to bring the instance back from DB backup its not working .
$ kubectl logs -f sonarqube-sonarqube-74ddf998cd-n9jxb -n sonarqube
Defaulted container “sonarqube” out of: sonarqube, chmod-volume-mounts (init), init-sysctl (init), install-plugins (init), concat-properties (init)
2023.08.01 18:58:27 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2023.08.01 18:58:27 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:46825]
2023.08.01 18:58:27 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/
elasticsearch/bin/elasticsearch
2023.08.01 18:58:27 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
2023.08.01 18:58:29 INFO es[o.e.n.Node] version[7.16.2], pid[31], build[default/tar/2b937c44140b6559905130a8650c64dbd0879cfb/2021-12-18T19:42:46.604893745Z], OS[Linux/5.
4.219-126.411.amzn2.x86_64/amd64], JVM[Eclipse Adoptium/OpenJDK 64-Bit Server VM/11.0.13/11.0.13+8]
2023.08.01 18:58:29 INFO es[o.e.n.Node] JVM home [/opt/java/openjdk]
2023.08.01 18:58:29 INFO es[o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=…/logs/es_hs_err_pid%p.log, -Des.networkaddress
.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djna.tmpdir=/opt/
sonarqube/temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.alloc
ator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Xmx512m, -Xms512m,
-XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.fl
avor=default, -Des.distribution.type=tar, -Des.bundled_jdk=false]
2023.08.01 18:58:29 INFO es[o.e.p.PluginsService] loaded module [analysis-common]
2023.08.01 18:58:29 INFO es[o.e.p.PluginsService] loaded module [lang-painless]
2023.08.01 18:58:29 INFO es[o.e.p.PluginsService] loaded module [parent-join]
2023.08.01 18:58:29 INFO es[o.e.p.PluginsService] loaded module [reindex]
2023.08.01 18:58:29 INFO es[o.e.p.PluginsService] loaded module [transport-netty4]
2023.08.01 18:58:29 INFO es[o.e.p.PluginsService] no plugins loaded
2023.08.01 18:58:29 INFO es[o.e.e.NodeEnvironment] using [1] data paths, mounts [[/opt/sonarqube/data (/dev/nvme4n1)]], net usable_space [491.5gb], net total_space [491.
9gb], types [ext4]
2023.08.01 18:58:29 INFO es[o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2023.08.01 18:58:29 ERROR es[o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: cannot downgrade a node from version [7.17.8] to version [7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) ~[elasticsearch-cli-7.16.2.jar:7.16.2]
at org.elasticsearch.cli.Command.main(Command.java:77) ~[elasticsearch-cli-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-7.16.2.jar:7.16.2]
Caused by: java.lang.IllegalStateException: cannot downgrade a node from version [7.17.8] to version [7.16.2]
at org.elasticsearch.env.NodeMetadata.upgradeToCurrentVersion(NodeMetadata.java:80) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.env.NodeEnvironment.loadNodeMetadata(NodeEnvironment.java:482) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:356) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.node.Node.(Node.java:427) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.node.Node.(Node.java:309) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:234) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) ~[elasticsearch-7.16.2.jar:7.16.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) ~[elasticsearch-7.16.2.jar:7.16.2]
… 6 more
uncaught exception in thread [main]
java.lang.IllegalStateException: cannot downgrade a node from version [7.17.8] to version [7.16.2]
at org.elasticsearch.env.NodeMetadata.upgradeToCurrentVersion(NodeMetadata.java:80)
at org.elasticsearch.env.NodeEnvironment.loadNodeMetadata(NodeEnvironment.java:482)
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:356)
at org.elasticsearch.node.Node.(Node.java:427)
at org.elasticsearch.node.Node.(Node.java:309)
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:234)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
at org.elasticsearch.cli.Command.main(Command.java:77)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
For complete error details, refer to the log at /opt/sonarqube/logs/sonarqube.log
2023.08.01 18:58:29 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2023.08.01 18:58:29 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2023.08.01 18:58:29 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped

@ganncamp Service started successfully but I couldn’t see any projects inturn it asked me to change password directly and told DB is upto date and no need of migration and to create a repo integration on my screen.

In logs I couldn’t see any instructions like /setup needs to be run to migrate DB.

Regards,
harikrishna.

Hi Harikrishna,

Again, if it’s not asking you to upgrade the DB, then it’s not connected to your old/existing DB.

 
Ann