Bug 651826 - JON241: Postgres: fatal error in log even after providing correct password and successful configuration settings
JON241: Postgres: fatal error in log even after providing correct password an...
Product: RHQ Project
Classification: Other
Component: Configuration (Show other bugs)
Unspecified Linux
low Severity medium (vote)
: ---
: ---
Assigned To: Lukas Krejci
Corey Welton
Depends On:
Blocks: jon241-bugs
  Show dependency treegraph
Reported: 2010-11-10 06:49 EST by Sudhir D
Modified: 2011-05-23 21:14 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 653539 (view as bug list)
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Sudhir D 2010-11-10 06:49:20 EST
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:
Comment 1 Lukas Krejci 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 2 Sudhir D 2010-11-18 04:58:02 EST
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-23 21:14:37 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 4 Corey Welton 2011-05-23 21:14:39 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 5 Corey Welton 2011-05-23 21:14:40 EDT
Bookkeeping - closing bug - fixed in recent release.

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