Bug 651826 - JON241: Postgres: fatal error in log even after providing correct password and successful configuration settings
Summary: JON241: Postgres: fatal error in log even after providing correct password an...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Configuration
Version: 3.0.0
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon241-bugs
TreeView+ depends on / blocked
 
Reported: 2010-11-10 11:49 UTC by Sudhir D
Modified: 2011-05-24 01:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 653539 (view as bug list)
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Sudhir D 2010-11-10 11:49:20 UTC
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:
Always

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:

Comment 1 Lukas Krejci 2010-11-15 16:57:42 UTC
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
discoveries. 

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>
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 Sudhir D 2010-11-18 09:58:02 UTC
Verified this on jon-server-2.4.1-SNAPSHOT build# 50f4c45.

Now, once I update the password correctly, I don't see this message. 

Marking this as verified.

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

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

Comment 5 Corey Welton 2011-05-24 01:14:40 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.