Can't connect to PostgreSQL 12 database with SQ 8.4

I have installed PostgreSQL 12 - also trying on 13 version.
Config file pg_hba.conf:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all               md5
host    replication     all             ::1/128                 md5

Man page:

Connecting via CLI works as expected.

$ psql -d sonarqube -U postgres -W -p 5432 -h localhost

Also working external app connections: DataGrid, PhpStorm, pgAdmin4.

I have fresh install of SonarQube 8.4.
Config file


I also try


I have that error:

2020.11.01 11:53:52 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed
java.lang.IllegalStateException: Unable to start database
        at org.sonar.server.platform.db.EmbeddedDatabase.startServer(
        at org.sonar.server.platform.db.EmbeddedDatabase.start(
        at org.sonar.server.platform.db.EmbeddedDatabaseFactory.start(
        at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(
        at org.picocontainer.behaviors.AbstractBehavior.start(
        at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(
        at org.picocontainer.behaviors.Stored.start(
        at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(
        at org.picocontainer.DefaultPicoContainer.startAdapters(
        at org.picocontainer.DefaultPicoContainer.start(
        at org.sonar.core.platform.ComponentContainer.startComponents(
        at org.sonar.server.platform.platformlevel.PlatformLevel.start(
        at org.sonar.server.platform.platformlevel.PlatformLevel1.start(
        at org.sonar.server.platform.PlatformImpl.start(
        at org.sonar.server.platform.PlatformImpl.startLevel1Container(
        at org.sonar.server.platform.PlatformImpl.init(
        at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(
        at org.apache.catalina.core.StandardContext.listenerStart(
        at org.apache.catalina.core.StandardContext.startInternal(
        at org.apache.catalina.util.LifecycleBase.start(
        at org.apache.catalina.core.ContainerBase$
        at org.apache.catalina.core.ContainerBase$
        at java.base/
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.base/java.util.concurrent.ThreadPoolExecutor$
        at java.base/
Caused by: org.h2.jdbc.JdbcSQLInvalidAuthorizationSpecException: Wrong user name or password [28000-199]
        at org.h2.message.DbException.getJdbcSQLException(
        at org.h2.message.DbException.getJdbcSQLException(
        at org.h2.message.DbException.get(
        at org.h2.message.DbException.get(
        at org.h2.message.DbException.get(
        at org.h2.engine.Engine.validateUserAndPassword(
        at org.h2.engine.Engine.createSessionAndValidate(
        at org.h2.engine.Engine.createSession(
        at org.h2.engine.Engine.createSession(
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(
        at org.h2.jdbc.JdbcConnection.<init>(
        at org.h2.jdbc.JdbcConnection.<init>(
        at org.h2.Driver.connect(
        at java.sql/java.sql.DriverManager.getConnection(
        at java.sql/java.sql.DriverManager.getConnection(
        at org.sonar.server.platform.db.EmbeddedDatabase.createDatabase(
        at org.sonar.server.platform.db.EmbeddedDatabase.startServer(
        ... 26 common frames omitted

When I comment that line


SonarQube start as expected.

Hi @LocalHeroPro and welcome to the community :wave:

you already found the solution. the property sonar.embeddedDatabase.port defines the port for the embedded h2 database and not the postgresql that you want to attach sonarqube to. if you change the port, the h2 database will be created but sonarqube will fail to do something with it, resulting in the failure you observerd.

can you point us to the documentation that made you assume that you had to change this value, so we can improve our docs on this?


My bad with config line with H2 port.
Please update docs with information about config file pg_hba.conf.

we don’t provide a detailed configuration for every DBMS and framework there is, that would be too much to maintain and this is already covered by the DBMS specific documentation you already mentioned

never the less i am glad that everything is working for you now and happy analyzing :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.