Discussion:
Switch To Postgres Error - "Ident authentication failed"
f***@atlassian.com
2010-03-28 19:09:34 UTC
Permalink
I followed the wiki for changing the backend to postgresql on my standalone-JIRA-on-Fedora-12 installation. However, I can start it up. The system was working fine before I attempted to switch to postgresql.

The first error is a list of repeated verbose Java errors in catalina.out is included below. I'm assuming that I have a postgresql config error. When I issue "psql -U jira" I get the same FATAL error. I have added the jira user to pg_hba.conf, but it doesn't seem to do it.

Help?

--------------------------------------------------------------------------------------------------------
2010-03-28 11:57:19,315 main INFO [atlassian.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2010-03-28 11:57:20,182 main ERROR [jira.appconsistency.db.DatabaseConsistencyCheck] 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 "jira")
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:212)
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)
at com.atlassian.jira.appconsistency.db.DatabaseConsistencyCheck.isJdbcDriverCorrectTypeForEntityEngine(DatabaseConsistencyCheck.jav$
at com.atlassian.jira.appconsistency.db.DatabaseConsistencyCheck.isOk(DatabaseConsistencyCheck.java:80)
at com.atlassian.jira.startup.JiraStartupChecklist.doStartupChecks(JiraStartupChecklist.java:56)
at com.atlassian.jira.startup.JiraStartupChecklist.startupOK(JiraStartupChecklist.java:46)
at com.atlassian.jira.startup.JiraStartupChecklistContextListener.runStartupChecks(JiraStartupChecklistContextListener.java:96)
at com.atlassian.jira.startup.JiraStartupChecklistContextListener.contextInitialized(JiraStartupChecklistContextListener.java:46)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
--
Post by alphadog - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=42570
f***@atlassian.com
2010-03-28 20:26:58 UTC
Permalink
I suspect this is more a problem with Postgres, not Jira.

If you're getting the error when using psql, then the username/password you are specifying is incorrect, or the config is barring the account for some reason. What does your pg_hba.conf file say in full (well, black out the passwords for us...)
--
Post by broughn2 - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=42570
f***@atlassian.com
2010-03-29 02:34:18 UTC
Permalink
While SSHed in as user "jira", I am able to issue a "psql -d jira_400 -U jira" and get in.

But, when I start up JIRA with "/usr/local/bin/startup.sh", I get the ident error.

Here's the pg_hba.conf setting:
{code}
local all all ident
local jira_400 jira password
host all all 127.0.0.1/32 ident
host jira_400 jira 127.0.0.1/32 password
host all all ::1/128 ident
{code}

And, here's server.xml's <Resource> section
{code}
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
username="jira"
password="[same password as manual login]"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost/jira_400"
maxActive="20" />
{code}
--
Post by alphadog - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=42570
f***@atlassian.com
2010-03-29 03:25:54 UTC
Permalink
To add, enabling logging on PostgreSQL shows the following in the log (/var/lib/pgsql/data/pg_log/):

{code}
2010-03-28 23:13:59 EDT PID: 5753 USER: [unknown] DB: [unknown] REMOTE: LOG: connection received: host=127.0.0.1 port=43457
2010-03-28 23:13:59 EDT PID: 5753 USER: jira DB: jira_400 REMOTE: 127.0.0.1(43457)LOG: could not connect to Ident server at address "127.0.0.1", port 113: Connection refused
2010-03-28 23:13:59 EDT PID: 5753 USER: jira DB: jira_400 REMOTE: 127.0.0.1(43457)FATAL: Ident authentication failed for user "jira"
{code}

This helped me realize that I had placed the rules in pg_hba.conf in the wrong order and had overlooked that postgresql matches on a first-match basis.

that should actually read as:
{code}
local jira_400 jira password
local all all ident
host jira_400 jira 127.0.0.1/32 password
host all all 127.0.0.1/32 ident
host all all ::1/128 ident
{code}

Ok, it works now.
--
Post by alphadog - online at:
http://forums.atlassian.com/thread.jspa?forumID=46&threadID=42570
Loading...