Unable to start SonarQube 8.0 in linux

I am new to SonarQube, try to install it for the first time

  • SonarQube 8.0
  • Bring up SonarQube for the first time
    *Activate Postgresql DB (Just did the following steps:
    yum install postgresql-server
    postgresql-setup initdb
    systemctl enable postgresql.service
    systemctl start postgresql.service

sonar.properties has the following uncommented out:

sonar.jdbc.username =sonarqube
sonar.jdbc.password =sonarqube
sonar.jdbc.url =jdbc:postgresql://localhost/sonarqube?currentSchema=my_schema

sonar.web.host =
sonar.web.context =
sonar.web.port =9000

Getting the following error in web.log
2019.11.23 23:19:35 DEBUG web[o.postgresql.Driver] Connection error :

sonar.log has the following:
2019.11.23 23:19:23 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.11.23 23:19:23 INFO app[o.e.p.PluginsService] no modules loaded
2019.11.23 23:19:23 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.11.23 23:19:32 INFO app[o.s.a.SchedulerImpl] Process[es] is up
2019.11.23 23:19:32 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘web’, ipcIndex=2, logFilenamePrefix=web]] from [/opt/proofpoint/sonarqube-8.0]: /usr/lib/jvm/java-11-openjdk- -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/proofpoint/sonarqube-8.0/temp --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx1G -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.|[::1] -cp ./lib/common/:/opt/proofpoint/sonarqube-8.0/lib/jdbc/postgresql/postgresql-42.2.5.jar org.sonar.server.app.WebServer /opt/proofpoint/sonarqube-8.0/temp/sq-process3220460299271426320properties
2019.11.23 23:19:35 INFO app[o.s.a.SchedulerImpl] Process[web] is stopped
2019.11.23 23:19:35 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2019.11.23 23:19:35 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143
2019.11.23 23:19:35 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped

Welcome to the community!

You can see on your web.log that you have a connection error to the database. Did you created the database schema and user corresponding with what you have in sonar.properties ?

Thanks Pierre for your response.
I followed the instruction here: https://dunterov.github.io/sq-psql/

Here it looks like at my end:
-bash-4.2$ psql
psql (9.2.24)
Type “help” for help.

postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
sonar | sonarqube | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)

Ok, so now you have to define your sonar.jdbc.url accordingly. It looks like your DB is named sonar and not sonarqube, and you can remove the currentSchema parameter from the url.

Thanks @pierreguillot. It was a good catch.
Here is my status now:
2019.12.03 15:48:45 DEBUG web[o.postgresql.Driver] Connection error:
org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user “sonarqube”
Location: File: auth.c, Routine: auth_failed, Line: 305
Server SQLState: 28000

postgres=# \du
List of roles
Role name | Attributes | Member of
postgres | Superuser, Create role, Create DB, Replication | {}
sonarqube | | {}

What am i missing?

I did update the following to fix it:

sudo vi /var/lib/pgsql/data/pg_hba.conf
```changed METHOD to md5
After that, when i restart sonarqube, i am getting the following error in sonar.log
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /0:0:0:0:0:0:0:1:9001

It works after I commented out the following line in sonar.properties: