Sonarqube is not up after upgrade from 9.5 to 99

Make sure to tell us:

  • What version are you upgrading from? 9.5 to 9.9
  • System information (Operating system, Java version, Database provider/version)
    Ubuntu, Java 17, Postgres
  • What’s the issue you’re facing?
2023.04.26 10:33:54 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-9.9.0.65466/temp
2023.04.26 10:33:54 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:44223]
2023.04.26 10:33:54 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube-9.9.0.65466/elasticsearch]: /opt/sonarqube-9.9.0.65466/elasticsearch/bin/elasticsearch
2023.04.26 10:33:54 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.04.26 10:33:56 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2023.04.26 10:33:56 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.04.26 10:33:56 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

I have admin access still facing the issue while I start

:/opt/sonarqube-9.9.0.65466/bin/linux-x86-64$ ./sonar.sh start
/usr/bin/java
Starting SonarQube...
rm: cannot remove './SonarQube.pid': Permission denied
Removed stale pid file: ./SonarQube.pid
./sonar.sh: 162: cannot create ./SonarQube.pid: Permission denied
./sonar.sh: 161: cannot create ../../logs/nohup.log: Permission denied
rm: cannot remove './SonarQube.pid': Permission denied
Removed stale pid file: ./SonarQube.pid
Failed to start SonarQube.

Regards,
Pardha

Hi Pardha,

Two things here:

First you need to check your server logs, specifically es.log to see what it says.

Second, SonarQube needs full permissions, recursive, to its directory. The permission denied errors you’ve shown indicate that’s not the case.

 
HTH,
Ann

Hi Ann,

Thanks for the update, below is the error I can see in es.log. Could you please help

2023.04.26 12:43:44 ERROR es[][o.e.b.Bootstrap] Exception
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]
	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]

Hi,

What does that mean to you?

 
Ann

Sorry I didn’t get you, from error I mean elasticsearch can’t run as root. I tried with sonar user still I am facing the error, May be I am missing something here.

Regards,
Pardha

Hi Pardha,

The error indicates that SonarQube is being run as root. You’ll need to correct that.

 
HTH,
Ann