pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Neuner <gneuner2@comcast.net>
To: nageswara Bandla <nag.bandla@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
Date: Mon, 4 Jun 2018 20:18:39 -0400
Message-ID: <b8eb6c47-7b71-b159-0eb3-307bd5ac1d36@comcast.net> (raw)
In-Reply-To: <CADJadRAVwknPiB3i85XKoQLu7jBXWN=bDUEh6bQhHRsDMnUWcQ@mail.gmail.com>
References: <CADJadRDCoHALsJQv8ySQiO2QdgWnfqVL+iX-v72QxA6pFtgYtg@mail.gmail.com>
	<5595335e-32e8-80da-9c65-8d79fce554a7@aklaver.com>
	<ppfugdp0kau1a9178injuk52b0eqg29i3o@4ax.com>
	<CADJadRAd7=5z9DcoOvDCQKb1Lyi7VHNRBbuVsQ1x398s_isRdw@mail.gmail.com>
	<e4c0hdhkoflpsfvqdbel5q4ouh3lnuvme3@4ax.com>
	<CADJadRBjBpZHqEOn68miwES1sTQp5TMa0qTwVm83X-cf6LD5=g@mail.gmail.com>
	<cls0hdps5fv0pj5jt1mhp9ij5in8bj4aq7@4ax.com>
	<CADJadRBHo-sFCeyy-2TWP4VFM9eNDrcxWYyjrCBRv5z290f_ww@mail.gmail.com>
	<CADJadRAVwknPiB3i85XKoQLu7jBXWN=bDUEh6bQhHRsDMnUWcQ@mail.gmail.com>


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

view thread (20+ messages)  latest in thread

Message-ID: <b8eb6c47-7b71-b159-0eb3-307bd5ac1d36@comcast.net>
Permalink:  ../b8eb6c47-7b71-b159-0eb3-307bd5ac1d36@comcast.net/
Also on:    postgresql.org/message-id/b8eb6c47-7b71-b159-0eb3-307bd5ac1d36@comcast.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: gneuner2@comcast.net, nag.bandla@gmail.com
  Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
  In-Reply-To: <b8eb6c47-7b71-b159-0eb3-307bd5ac1d36@comcast.net>
  References: <CADJadRDCoHALsJQv8ySQiO2QdgWnfqVL+iX-v72QxA6pFtgYtg@mail.gmail.com> <5595335e-32e8-80da-9c65-8d79fce554a7@aklaver.com> <ppfugdp0kau1a9178injuk52b0eqg29i3o@4ax.com> <CADJadRAd7=5z9DcoOvDCQKb1Lyi7VHNRBbuVsQ1x398s_isRdw@mail.gmail.com> <e4c0hdhkoflpsfvqdbel5q4ouh3lnuvme3@4ax.com> <CADJadRBjBpZHqEOn68miwES1sTQp5TMa0qTwVm83X-cf6LD5=g@mail.gmail.com> <cls0hdps5fv0pj5jt1mhp9ij5in8bj4aq7@4ax.com> <CADJadRBHo-sFCeyy-2TWP4VFM9eNDrcxWYyjrCBRv5z290f_ww@mail.gmail.com> <CADJadRAVwknPiB3i85XKoQLu7jBXWN=bDUEh6bQhHRsDMnUWcQ@mail.gmail.com> <b8eb6c47-7b71-b159-0eb3-307bd5ac1d36@comcast.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox