1 Reply Latest reply on Apr 20, 2010 8:52 AM by mazz

    postgres login error

    robert.breault

      I get this on the client even though the client isnt looking for postgres, Where would I set this password?

       

      2010-04-19 16:26:41,000 INFO  [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.postgres.PostgresDiscoveryComponent)- Discovered a postgres process: ProcessScanResult: scan=[ProcessScan: query=[process|basename|match=^(postgres|postmaster)$,process|basename|nomatch|parent=^(postgres|postmaster)$], name=[unix]], info=[process: pid=[1368], name=[/opt/PostgreSQL/8.4/bin/postgres], ppid=[1]]
      2010-04-19 16:26:41,009 INFO  [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.postgres.PostgresDiscoveryComponent)- Exception detecting postgres instance
      org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
          at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:276)
          at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:95)
          at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
          at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
          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:386)
          at org.postgresql.Driver.connect(Driver.java:260)
          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:184)
          at org.rhq.plugins.postgres.PostgresDiscoveryComponent.getVersion(PostgresDiscoveryComponent.java:160)
          at org.rhq.plugins.postgres.PostgresDiscoveryComponent.createResourceDetails(PostgresDiscoveryComponent.java:144)
          at org.rhq.plugins.postgres.PostgresDiscoveryComponent.discoverResources(PostgresDiscoveryComponent.java:116)
          at sun.reflect.GeneratedMethodAccessor46.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:266)
          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)
      2010-04-19 16:26:41,010 INFO  [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.postgres.PostgresDiscoveryComponent)- Discovered a postgres process: ProcessScanResult: scan=[ProcessScan: query=[process|basename|match=^(postgres|postmaster)$,process|basename|nomatch|parent=^(postgres|postmaster)$], name=[unix]], info=[process: pid=[1312], name=[/opt/PostgreSQL/8.3/bin/postgres], ppid=[1]]

        • 1. Re: postgres login error
          mazz

          To make it clear to others reading this thread, by "client" you mean "agent".

           

          This is happening because you have deployed the Postgres  plugin. When the Postgres plugin is deployed in the agent, it will periodically be asked to search for Postgres database servers to monitor. As the Postgres plugin scans the box looking for databases, if it thinks it finds one (as it did in your case by looking at the operating system's process table and it found a running Postgres) it will try to log into that database to obtain more information about it.

           

          How does it try to log in? Since it obviously doesn't know your DB password yet, it just tries to guess - and it guesses using a default username/password (which I believe is postgres/postgres). But that isn't your DB password and thus the error you see.

           

          I think the plugin should not behave in the way it is here - it should not log an ugly stack trace here because this is going to be the normal use-case when a postgres process is found (usually the default password will be changed). Unsure what version you are using, but this might be fixed in  master, I dunno. It should be fixed, if anyone in the community wants to go in and fix this behavior (if it isn't fixed yet), that would be helpful.

           

          However, this exception is not fatal nor is it really an error per-se (which is why its logged at INFO level). Its just saying, "I found a postgres process but I can't log into it so I can't really discover it fully)."