Bonita 9 / Postgres 15 / FATAL: password authentication failed for user "bonita"

I am a bit puzzled with an issue I am running into and I am hoping someone could have a hint or an idea how I can troubleshoot this.

I have a Bonita + postgres env running on Docker.
I am now migrating to K8S, which should be pretty much similar.

My postgres is running fine, it has a bonita user and a password.
I can confirm the credentials and connections via pgadmin or psql work just fine.

Bonita however does not manage to connect and throw:

XA transaction timeout: 180
Using DB_VENDOR: postgres
Using DB_NAME: bonita
Using DB_HOST: svc-postgres
Using DB_PORT: 5432
Using BIZ_DB_NAME: businessdb
 ____              _ _
|  _ \            (_) |
| |_) | ___  _ __  _| |_ __ _
|  _ < / _ \| '_ \| | __/ _` |
| |_) | (_) | | | | | || (_| |
|____/ \___/|_| |_|_|\__\__,_|

(Platform Setup 9.0.0)

[INFO] configuration for Database vendor: postgres
[ERROR] HikariPool-1 - Exception during pool initialization.
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "bonita"
        at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:659)
        at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:180)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:247)
        at org.postgresql.Driver.makeConnection(Driver.java:434)
        at org.postgresql.Driver.connect(Driver.java:291)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
        at org.bonitasoft.platform.setup.PlatformSetup.initDataSource(PlatformSetup.java:435)
        at org.bonitasoft.platform.setup.PlatformSetup.initPlatformSetup(PlatformSetup.java:476)
        at org.bonitasoft.platform.setup.PlatformSetup.init(PlatformSetup.java:109)
        at org.bonitasoft.platform.setup.command.InitCommand.execute(InitCommand.java:44)
        at org.bonitasoft.platform.setup.PlatformSetupApplication.execute(PlatformSetupApplication.java:110)
        at org.bonitasoft.platform.setup.PlatformSetupApplication.run(PlatformSetupApplication.java:84)
        at org.bonitasoft.platform.setup.PlatformSetupApplication.main(PlatformSetupApplication.java:69)
[ERROR] org.postgresql.util.PSQLException: FATAL: password authentication failed for user "bonita"
[ERROR] You might get more detailed information about the error by adding '--debug' to the command line, and run again

On the postgres side, I can see the failed attempt:

2024-09-09 10:16:49.946 UTC [185] FATAL:  password authentication failed for user "bonita"
2024-09-09 10:16:49.946 UTC [185] DETAIL:  Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
2024-09-09 10:16:51.950 UTC [186] FATAL:  password authentication failed for user "bonita"
2024-09-09 10:16:51.950 UTC [186] DETAIL:  Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
2024-09-09 10:16:53.950 UTC [187] FATAL:  password authentication failed for user "bonita"
...

The first thing I checked where the Bonita pod env to ensure I have the right credentials there and I can confirm that I have the right user and password.

I know the pods can reach each others since I see the failed auth in the postgres pod.

Anyone ran into something like this ?
Is there a way to debug further ?

I am not sure what to do with the suggestion to use --debug since:

  • /opt/files/startup.sh --debug /opt/bonita/server/bin/catalina.sh run is invalid
  • /opt/files/startup.sh /opt/bonita/server/bin/catalina.sh --debug run yield the same result
    /opt/files/startup.sh /opt/bonita/server/bin/catalina.sh run --debug yield the same result

I also printed the DB_PASS from the startup script and it matches.

1 Like

I reverted to a simple password bonita and now it works connects.
The issue appears to be a bug related to how the DB_PASS is handled in the case of using specials chars such as &,@ or %.

1 Like