JIRA Unable to connect to database with 'Ident authentication failed' error
When starting a JIRA application instance, a database connection pool can't be created with the following error thrown in the application log:
There was a SQL exception checking for database driver correctness. Skipping. org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: Ident authentication failed for user "jirauser") at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at org.ofbiz.core.entity.transaction.JNDIFactory.getJndiConnection(JNDIFactory.java:168) at org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(JNDIFactory.java:140) at org.ofbiz.core.entity.TransactionFactory.getConnection(TransactionFactory.java:99) at org.ofbiz.core.entity.ConnectionFactory.getConnection(ConnectionFactory.java:53) at com.atlassian.jira.appconsistency.db.OfbizConnectionFactory.getConnection(OfbizConnectionFactory.java:27) ...
The JDBC client login uses 'Ident-based authentication' method instead of 'password authentication' mode.
By default PostgreSQL uses IDENT-based authentication and this will never allow you to login via -U and -W options. Allow username and password based authentication from your application by appling 'trust' as the authentication method for the JIRA application database user. You can do this by modifying the
pg_hba.conf file. This file controls:
- Which hosts are allowed to connect
- How clients are authenticated
- Which PostgreSQL user names they can use
- Which databases they can access
local all all trust host all 127.0.0.1/32 trust
Don't forget to restart PostgreSQL after saving your changes to the file.
# service postgresql restart