From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
Date: Mon, 4 Jun 2018 17:44:53 -0500
Message-ID: <a1ddf5cb-020e-22d6-9183-94ed43a0f789@gmail.com> (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>
I've noticed that .pgpass is case sensitive, so am not surprised that it
also wouldn't note the difference between 127.0.0.1 and localhost.
On 06/04/2018 05: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
>
>
> On Fri, Jun 1, 2018 at 9:43 AM, nageswara Bandla <nag.bandla@gmail.com
> <mailto:nag.bandla@gmail.com>> wrote:
>
>
>
> On Thu, May 31, 2018 at 5:16 PM, George Neuner <gneuner2@comcast.net
> <mailto:gneuner2@comcast.net>> wrote:
>
> On Thu, 31 May 2018 15:40:21 -0500, nageswara Bandla
> <nag.bandla@gmail.com <mailto:nag.bandla@gmail.com>> wrote:
>
> >On Thu, May 31, 2018 at 12:57 PM, George Neuner
> <gneuner2@comcast.net <mailto:gneuner2@comcast.net>>
> >wrote:
> >
> >> It just occurred to me that you said PGPASSFILE was set to
> >>
> >> %APPDATA%/postgresql/pgpass.conf
> >>
> >>
> >> The problem may be that when LocalSystem expands %APPDATA%, it is
> >> finding its own directory, which might be any of:
> >>
> >> C:\Windows\ServiceProfiles\LocalService\appdata
> >> C:\Windows\System32\config\systemprofile\AppData
> >> C:\Windows\SysWOW64\config\systemprofile\AppData
> >>
> >> depending on your Windows version, policies (if any), and
> whether the
> >> executable is 32 or 64 bit.
> >>
> >>
> >> I wouldn't try messing with any of these directories. Instead try
> >> setting PGPASSFILE to the full path to your file.
> >>
> >>
> >I have tried all of them, pgagent is not recognizing any of the above
> >locations. In fact, I have tried both options
> >
> > #1. By defining PGPASSFILE to the above locations one after the
> other.
> > #2. By copying pgpass.conf to all the three locations by creating
> >Roaming/postgresql directories.
> >
> >And also I have defined PGPASSFILE=C:\pgpass.conf; I think, this
> should be
> >accessible to any system account. This also not working.
>
>
> One more stupid question and then I'm out of ideas ...
>
>
> Have you rebooted after changing the environment variable?
>
> Global environment changes normally don't take effect until the user
> logs out/in again. LocalSystem is not an interactive user - you have
> to restart the system to let it see environment changes. PITA.
>
>
> Yes, I did. But no luck..I guess, we have to live with this problem
> for pgagent running as a Local System account.
> We need to run pgagent service as "Logon user account" and provide
> user logon credentials for running pgagent service.
>
> In Linux case, pgagent is not even reading .pgpass itself. The issue
> here is that the logs (debug level log) are no help. It don't have
> much information.
> Which password file it is trying to read.
>
>
>
>
> George
>
>
>
>
--
Angular momentum makes the world go 'round.
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: ronljohnsonjr@gmail.com
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
In-Reply-To: <a1ddf5cb-020e-22d6-9183-94ed43a0f789@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> <a1ddf5cb-020e-22d6-9183-94ed43a0f789@gmail.com>
* 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