Bug 653539 - Postgres: fatal error in log even after providing correct password and successful configuration settings
Summary: Postgres: fatal error in log even after providing correct password and succes...
Alias: None
Product: RHQ Project
Classification: Other
Component: Configuration
Version: 4.0.0
Hardware: Unspecified
OS: Linux
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Corey Welton
Depends On:
Blocks: jon30-bugs
TreeView+ depends on / blocked
Reported: 2010-11-15 16:58 UTC by Lukas Krejci
Modified: 2011-05-24 01:14 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 651826
Last Closed:

Attachments (Terms of Use)

Description Lukas Krejci 2010-11-15 16:58:33 UTC
+++ This bug was initially created as a clone of Bug #651826 +++

Description of problem:
Postgres plugin by default shows down as it assumes a certain password. After providing the correct password in the Postgres Server->postgres->Inventory->Connection and update "role password" to correct password. After saving the settings, the configuration is successfully updated and the unavailability icon goes away and discovers Database and User. However, when I restart the server and agent, it throws, failed to connect to Postgres server as postgres user error. 

Version-Release number of selected component (if applicable):
rhq-server-3.0.1-SNAPSHOT build# 8469bdd

How reproducible:

Steps to Reproduce:
1. Install RHQ server and agent against postgres database
2. Import the agent.
3. Monitor the rhq agent log.
4. update the configuration settings for postgres with correct password as described in the description above.
5. See that the postgres unavailability is gone and Database and Users show up.
6. Restart agent and server.
7. Monitor agent log.

Actual results:
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
	at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
	at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
	at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
	at org.postgresql.Driver.makeConnection(Driver.java:393)
	at org.postgresql.Driver.connect(Driver.java:267)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:185)
	at org.rhq.plugins.postgres.PostgresDiscoveryComponent.buildConnection(PostgresDiscoveryComponent.java:228)
	at org.rhq.plugins.postgres.PostgresDiscoveryComponent.getConnection(PostgresDiscoveryComponent.java:292)
	at org.rhq.plugins.postgres.PostgresDiscoveryComponent.createResourceDetails(PostgresDiscoveryComponent.java:165)
	at org.rhq.plugins.postgres.PostgresDiscoveryComponent.discoverResources(PostgresDiscoveryComponent.java:138)
	at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:279)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

Expected results:
After updating with correct password, the error should not be thrown in log file.

Additional info:

--- Additional comment from lkrejci@redhat.com on 2010-11-15 11:57:42 EST ---

This is not a bug per se, because the error mentioned in the description
happens during discovery that is independent of (and doesn't know about) the
resources already in the inventory.

But it indeed looks a little bit confusing. I therefore changed the logging
logic a bit to log this error only on the DEBUG level in case of automatic

In the case of manual discovery, this error will still get logged at INFO so
that it ends up in the agent log by default.

commit b583eee673290900afac36b15e4e9a1ed590378d
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Mon Nov 15 17:08:24 2010 +0100

    BZ 651826 - Do not log the connection failures during auto-discovery on
INFO level.

Comment 1 Lukas Krejci 2010-11-15 16:59:55 UTC
In master, this bug should have been fixed by the following commit:

commit 0470d55fac5b40ca45bd0658c3d6b168019bd7ca
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Mon Nov 15 17:08:24 2010 +0100

    BZ 651826 - Do not log the connection failures during auto-discovery on INFO level.

Comment 2 Mike Foley 2011-04-20 18:18:02 UTC
i tested the 4/29/2011 release with postgres

Comment 3 Corey Welton 2011-05-24 01:14:23 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 4 Corey Welton 2011-05-24 01:14:24 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 5 Corey Welton 2011-05-24 01:14:25 UTC
Bookkeeping - closing bug - fixed in recent release.

Note You need to log in before you can comment on or make changes to this bug.