Bug 653539 - Postgres: fatal error in log even after providing correct password and successful configuration settings
Postgres: fatal error in log even after providing correct password and succes...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Configuration (Show other bugs)
4.0.0
Unspecified Linux
low Severity medium (vote)
: ---
: ---
Assigned To: Lukas Krejci
Corey Welton
:
Depends On:
Blocks: jon30-bugs
  Show dependency treegraph
 
Reported: 2010-11-15 11:58 EST by Lukas Krejci
Modified: 2011-05-23 21:14 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 651826
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lukas Krejci 2010-11-15 11:58:33 EST
+++ 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:
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:

--- 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
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@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 11:59:55 EST
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 14:18:02 EDT
i tested the 4/29/2011 release with postgres
Comment 3 Corey Welton 2011-05-23 21:14:23 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 4 Corey Welton 2011-05-23 21:14:24 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 5 Corey Welton 2011-05-23 21:14:25 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.