CMDBuild Forum

Unable to install CMBuild for the first time

Hi, I tried to install CMDBuild (core 3.4) on a Linux Mint (Debian) computer.

First I installed the Postgres (version 12.10), the Apache Tomcat (9.0.31) and Java (OpenJDK 11.0.15), and then the CMDBuild. For this last one I used the GUI option (java -jar ready2use-2.2-3.3.2-w.war -v). I kept the default options except the Database type (I opted for an empty db). I tested the config and it said it was OK, so I installed. But I got the error “installation error: org.cmdbuild.dao.DaoException: Error while configuring the database”.

Looking at the log there were 3 Fatal errors:

  • INFO o.c.dao.config.inner.DatabaseCreator - database not found: org.postgresql.util.PSQLException: FATAL: password authentication failed for user “cmdbuild”
  • Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.postgresql.util.PSQLException: FATAL: password authentication failed for user “postgres”
  • Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user “postgres”

So, after reading Error installing Ready2Use using GUI in Linux I decided to:

  • Force a change to the postgres passwd (sudo passwd postgres)
  • Add it to the adm group (sudo usermod -aG adm postgres)

I repeated the installation and, once again, I got the same 3 FATAL password authentication errors.

What am I doing wrong?

Check PostgreSQL logs, I suppose you have to fix your pg_hba.conf to allow this connection.
Also, can you connect to this database from the same machine where you have installed CMDBuild using ‘psql’ and credentials you have supplied to CMDBuild?

I posted an install guide on the forum, look it up and see if it helps.

Thanks @pmg and @ecorona21
I tried both recommendations but it still gives a fatal error "password authentication failed for user “postgres”. I double checked and the password is set to “postgres” as requested during the cmdbuild installation. And this error appears both with the “demo” and the “empty” options
It seems that there is a postgres password somewhere that is not being updated
This is the log:
10:47:37.419 DEBUG org.cmdbuild.utils.cli.Main - running from war file = /home/rui/Documents/cmdbuild/ready2use-2.2-3.3.2-w.war
10:47:45.304 INFO o.c.utils.gui.GuiCommandRunner - test install config
10:47:45.305 INFO o.c.utils.gui.GuiCommandRunner - prepare db config
10:47:45.400 INFO o.c.utils.crypto.Cm3EasyCryptoUtils - using default cm3easy key ( if this is a production environment you should change this to a secure key source by setting either env param CMDBUILD_CM3EASY_KEY or java system property org.cmdbuild.cm3easy.key to a valid key file )
10:47:45.776 INFO o.c.utils.gui.GuiCommandRunner - prepare tomcat config
10:47:45.842 INFO o.c.u.t.TomcatConfig$Builder - port offset = 1
10:47:45.854 INFO o.c.utils.gui.GuiCommandRunner - config is ready
10:47:48.102 INFO o.c.utils.gui.GuiCommandRunner - prepare db config
10:47:48.103 INFO o.c.utils.gui.GuiCommandRunner - prepare tomcat config
10:47:48.104 INFO o.c.u.t.TomcatConfig$Builder - port offset = 1
10:47:48.105 INFO o.c.utils.gui.GuiCommandRunner - config is ready
10:47:48.114 INFO o.c.utils.gui.GuiCommandRunner - start installation thread
10:47:48.116 INFO o.c.utils.gui.GuiCommandRunner - installation thread is running
10:47:48.126 INFO o.c.u.tomcatmanager.TomcatBuilder - buildTomcat BEGIN
10:47:48.358 INFO o.c.u.tomcatmanager.TomcatBuilder - unpacking tomcat cm_d75f03c5a08055292041d497771d8719.cache to /home/rui/cmdbuild_30_2
10:47:48.891 INFO o.c.u.tomcatmanager.TomcatBuilder - successfully unpacked tomcat binary distribution to dir = /home/rui/cmdbuild_30_2
10:47:48.892 INFO o.c.u.tomcatmanager.TomcatBuilder - configure tomcat ports, http port = 8081, shutdown port = 8006
10:47:49.276 INFO o.c.u.tomcatmanager.TomcatBuilder - set catalina pid = /home/rui/cmdbuild_30_2/bin/catalina.pid
10:47:49.281 INFO o.c.u.tomcatmanager.TomcatBuilder - deploy war artifact = /home/rui/Documents/cmdbuild/ready2use-2.2-3.3.2-w.war AS cmdbuild to tomcat = /home/rui/cmdbuild_30_2
10:47:55.753 INFO o.c.u.tomcatmanager.TomcatBuilder - successfully deployed war artifact = /home/rui/Documents/cmdbuild/ready2use-2.2-3.3.2-w.war AS cmdbuild to dir = /home/rui/cmdbuild_30_2/webapps/cmdbuild
10:47:55.754 INFO o.c.u.tomcatmanager.TomcatBuilder - adding config overlay for key = database file = /home/rui/cmdbuild_30_2/./conf/cmdbuild/database.conf content =
#Sun May 22 10:47:48 BRT 2022
db.admin.password=postgres
db.password=cmdbuild
db.username=cmdbuild
db.admin.username=postgres
db.url=jdbc:postgresql://localhost:5432/cmdbuild_61be
10:47:55.781 INFO o.c.u.tomcatmanager.TomcatBuilder - buildTomcat END
create database cmdbuild_61be demo.dump.xz
10:48:13.360 INFO o.c.dao.config.inner.DatabaseCreator - create database = jdbc:postgresql://localhost:5432/cmdbuild_61be from source = demo.dump.xz
10:48:13.360 INFO o.c.dao.config.inner.DatabaseCreator - checking database
10:48:17.591 INFO o.c.dao.config.inner.DatabaseCreator - database not found: org.postgresql.util.PSQLException: FATAL: database “cmdbuild_61be” does not exist
10:48:17.591 INFO o.c.dao.config.inner.DatabaseCreator - Creating database cmdbuild_61be
10:48:17.685 ERROR o.c.utils.gui.GuiCommandRunner - error executing install
org.cmdbuild.dao.DaoException: Error while configuring the database
at org.cmdbuild.dao.config.inner.DatabaseCreator.configureDatabase(DatabaseCreator.java:201)
at org.cmdbuild.utils.cli.utils.DatabaseUtils.createDatabase(DatabaseUtils.java:42)
at org.cmdbuild.utils.cli.utils.DatabaseUtils.createDatabase(DatabaseUtils.java:36)
at org.cmdbuild.utils.cli.utils.DatabaseUtils.createDatabase(DatabaseUtils.java:32)
at org.cmdbuild.utils.gui.GuiCommandRunner$InstallHelper.lambda$install$10(GuiCommandRunner.java:319)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.postgresql.util.PSQLException: FATAL: password authentication failed for user “postgres”
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:371)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:418)
at org.cmdbuild.dao.config.inner.DatabaseCreator.createDatabase(DatabaseCreator.java:315)
at org.cmdbuild.dao.config.inner.DatabaseCreator.configureDatabase(DatabaseCreator.java:170)
… 5 common frames omitted
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user “postgres”
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:514)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:454)
at org.postgresql.Driver.connect(Driver.java:256)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:94)
at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:79)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
… 9 common frames omitted

@Rui

Have you tried this?

Looks like you didn’t followed my guide:

You cannot use the user “postgres” as the password, please give a second read to the guide I posted.