Re: Pgagent is not reading pgpass file either in Windows or Linux.

From: George Neuner <gneuner2(at)comcast(dot)net>
To: nageswara Bandla <nag(dot)bandla(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
Date: 2018-06-05 00:18:39
Message-ID: b8eb6c47-7b71-b159-0eb3-307bd5ac1d36@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 6/4/2018 6:31 PM, nageswara Bandla wrote:
> I have figured out the issue with pgAgent both in Windows and Linux.
>
> PgAgent seems to ignore pgpass.conf/.pgpass whenever it has 127.0.0.1
> (127.0.0.1:5432:*:postgres:postgres) throws an error:
>
> *DEBUG: Creating DB connection: user=postgres port=5432
> hostaddr=127.0.0.1 dbname=linuxpostgresdb*
>
> *WARNING: Couldn't create the primary connection (attempt 1):
> fe_sendauth: no password supplied*
>
> *
> *
>
> The solution could be update .pgpass to have (
> localhost:5432:*:postgres:postgres ) and then pgagent works fine
> without issues.
>
>
> I think, pgagent is not inline with libpq.dll while passing host
> address parameter. I have raised this concern with pgagent github
> where exactly they need to change the code in order for pgagent to be
> in line with psql program.
>
>
> https://github.com/postgres/pgagent/issues/14

Wow !!!

I don't use pgpass much at all - usually I want the security of
providing the password manually.  Since we started with the idea that
the file wasn't being read properly, I was mainly trying to figure out
how Windows could be screwing that up. <grin>

There is a difference between localhost and 127.0.0.1:  localhost is DNS
resolved - usually from the local hosts file - and thus works with
either IPv4 or IPv6 addressing.  But it never would have occurred to me
that using one vs the other, on an otherwise properly configured system,
should cause an error.

Great work finding that.
George

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2018-06-05 00:36:18 Re: Code of Conduct plan
Previous Message Tom Lane 2018-06-05 00:18:24 Re: Code of Conduct plan