Comment:
Published by Scroll Versions from space IDS and version 8.4
...
Info
title
Database connection fails
When:
Starting Accounting Service for the first time after installation or restarting Accounting Service after a successful installation
What:
Database tables cannot be created in the initial startup or database connection cannot be created when checking the migration status, the following kind of error message in the Accounting Service application log:
Code Block
language
text
15:24:36.713 [main] ERROR Application run failed : o.s.boot.SpringApplication.reportFailure
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway'
defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration
...
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]:
Factory method 'flyway' threw exception; nested exception is java.lang.IllegalStateException:
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is
org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "accounting_user"
Why:
Cannot connect to the PostgreSQL Database
How to fix:
Check the root cause from the org.postgresql.util.PSQLException in the log, there are some alternatives:
Code Block
language
text
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "127.0.0.1",
user "accounting_user", database "accountingdb", SSL off
You have not configured PostgreSQL to accept connections from your host to the configured database and user, see the comment about md5 here and fix your PostgreSQL setup, start the Accounting Service again
You have forgotten to create the database in the PostgreSQL server, follow instructions in here, start the Accounting Service again
You have configured a wrong JDBC connection URL or username in the Accounting Service settings in win32.config/unix.config file, follow instructions in here (check that there are no trailing spaces in your settings)
Code Block
language
text
org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "accounting_user"
You have not configured PostgreSQL to accept password based authentication, see the comment about md5 here and fix your PostgreSQL setup, start the Accounting Service again
Code Block
language
text
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "accounting_user"
You have configured a wrong JDBC connection password in the Accounting Service settings in win32.config/unix.config file, follow instructions in here, check especially that you don't have extra spaces or other invisible characters after the password setting
Note that if you have created a user name having uppercase letters these are converted to lowercase letters by PostgreSQL
Code Block
language
text
org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port
are correct and that the postmaster is accepting TCP/IP connections.
Your PostgreSQL RDBMS server is down, start it, start the Accounting Service again
You have configured a wrong JDBC connection URL host name or port in the Accounting Service settings in win32.config/unix.config file, follow instructions in here
You cannot connect from the server SSO with Accounting Service is running to the correctly configured URL where the PostgreSQL RDBMS server is running, fix your network topology, firewall settings etc., start the Accounting Service again
Code Block
language
text
org.postgresql.util.PSQLException: FATAL: the database system is starting up
Your PostgreSQL RDBMS server had not yet started when Accounting Service already tried to start, start the Accounting Service again when PostgreSQL server is up