Upgrading from 8.9.5 LTS version to 9.9.2 LTS

Upgrading from 8.9.5 LTS version to 9.9.2 LTS

System information:

Operating system
-Red Hat Enterprise Linux Server 7.9 (Maipo)

Java version
-Java 11 (Pre Upgrade) to be updated to Java 17 during upgrade

Database provider/version
-Postgres 11

  • What’s the issue you’re facing?

We are running into the below error when starting up the version 9.9.2 LTS of Sonar

2023.11.15 15:00:40 ERROR es[][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:173) ~[elasticsearch-7.17.8.jar:7.17.8]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160) ~[elasticsearch-7.17.8.jar:7.17.8]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) ~[elasticsearch-7.17.8.jar:7.17.8]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) ~[elasticsearch-cli-7.17.8.jar:7.17.8]
        at org.elasticsearch.cli.Command.main(Command.java:77) ~[elasticsearch-cli-7.17.8.jar:7.17.8]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125) ~[elasticsearch-7.17.8.jar:7.17.8]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-7.17.8.jar:7.17.8]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:107) ~[elasticsearch-7.17.8.jar:7.17.8]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183) ~[elasticsearch-7.17.8.jar:7.17.8]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) ~[elasticsearch-7.17.8.jar:7.17.8]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169) ~[elasticsearch-7.17.8.jar:7.17.8] 

We tried a workaround command which is:
sudo -Hu sonar ./sonar.sh start

The service somehow starts but the Application’s UI does not load and also experiences an issue with plugins maybe because of the workaround command. We do not have a copy of the specific plugin error as we had to restore our previous configurations to avoid our application with further downtime (in production)

Any ideas on how to proceed, upgrade successfully and start our Sonar? Thank you

We managed to upgrade to 9.9.2 LTS

1 Like