pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Stuart McGraw <smcg4191@mtneva.com>
To: pgsql-general@postgresql.org
Subject: Re: source of connection fails at pg startup?
Date: Tue, 22 May 2018 06:22:22 -0700
Message-ID: <18a6baff-4ab2-6da4-350a-96579b47e5a6@aklaver.com> (raw)
In-Reply-To: <86216924-a5c8-80c1-52d6-0bc4a104de81@mtneva.com>
References: <86216924-a5c8-80c1-52d6-0bc4a104de81@mtneva.com>

On 05/21/2018 10:48 PM, Stuart McGraw wrote:
> When I start my postgresql server I get 11 messages reporting that 
> "password
> authentication failed for user 'postgres'" spaced about ~.5sec apart.
> I increased the logging level to INFO, and added the application name to 
> the
> message format (after the pid) which resulted in:
> 
>    2018-05-21 23:04:44.395 MDT [20232][[unknown]] [unknown]@[unknown] 
> LOG:  connection received: host=[local]
>    2018-05-21 23:04:44.395 MDT [20232][[unknown]] postgres@postgres 
> FATAL:  password authentication failed for user "postgres"
>    2018-05-21 23:04:44.395 MDT [20232][[unknown]] postgres@postgres 
> DETAIL:  Password does not match for user "postgres".
>      Connection matched pg_hba.conf line 90: "local   all   all   md5"
> 
> This is on a Ububuntu-18.04 machine with postgresql-10.3 from Ubuntu.  
> As distributed
> the pg_hba.conf line mentioned used "peer" authentication method, I have 
> changed to
> "md5".  When I change back to "peer" the error messages go away.  The 
> processes are
> too short-lived for me to catch with ps.  Successful connect message 
> example:
> 
>    2018-05-21 23:25:13.577 MDT [21080][[unknown]] [unknown]@[unknown] 
> LOG:  connection received: host=[local]
>    2018-05-21 23:25:13.578 MDT [21080][[unknown]] postgres@postgres 
> LOG:  connection authorized: user=postgres database=postgres
>    2018-05-21 23:25:13.579 MDT [21080][psql] postgres@postgres LOG:  
> disconnection: session time: 0:00:00.002 user=postgres database=postgres 
> host=[local]
> 
> My question is, how can I find out where the connections are coming from 
> so I can
> modify them to provide passwords (so I can go back to "md5")?  Are there 

 From the error messages it looks like your connections are already 
supplying passwords. I am guessing that the issue is that you have not 
created a password for the database user postgres. See the below:

https://help.ubuntu.com/community/PostgreSQL

Basic Server Setup

for how to do that. If you have set up a password then the connections 
are using the wrong one. For catching the connections uncomment and set 
to on:

log_connections
log_disconnections

in postgresql.conf.

You might also try something like:

watch -n 0.5 'ps aux|grep post'

to see if you catch the connections from the system end.

> startup-
> time connections made by postgresql itself or is this likely from some 
> Ubuntu-
> specific configuration?
> 
> Thanks.
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (5+ messages)  latest in thread

Message-ID: <18a6baff-4ab2-6da4-350a-96579b47e5a6@aklaver.com>
Permalink:  ../18a6baff-4ab2-6da4-350a-96579b47e5a6@aklaver.com/
Also on:    postgresql.org/message-id/18a6baff-4ab2-6da4-350a-96579b47e5a6@aklaver.com

 · 

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: adrian.klaver@aklaver.com, smcg4191@mtneva.com
  Subject: Re: source of connection fails at pg startup?
  In-Reply-To: <18a6baff-4ab2-6da4-350a-96579b47e5a6@aklaver.com>
  References: <86216924-a5c8-80c1-52d6-0bc4a104de81@mtneva.com> <18a6baff-4ab2-6da4-350a-96579b47e5a6@aklaver.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