pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
authentication failure
38+ messages / 11 participants
[nested] [flat]

* authentication failure
@ 2014-01-03 09:16  Jayadevan M <maymala.jayadevan@gmail.com>
  0 siblings, 2 replies; 38+ messages in thread

From: Jayadevan M @ 2014-01-03 09:16 UTC (permalink / raw)
  To: pgsql-general

Hi,
I am trying to login from psql and consistently getting a
"psql: FATAL:  password authentication failed for user "xyz"" for all
users. I am not being prompted for a password at all. I faced a similar
issue sometime ago because there was a .pgpass file and it had wrong
entries. This time there is no .pgpass file.
Any clues? How do I trouble-shoot?
Other possibly relevant info - this is a chrooted environment. I upgraded
the OS recently in this env and faced some issues with /dev/null /proc etc
not being present and so on. Some issues there?
The database itself is running in the same server in the non-chroot
environment. I am also running a python application which uses psycopg2 and
that is working fine.
Regards,
Jayadevan

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 09:19  Ashesh Vashi <ashesh.vashi@enterprisedb.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  1 sibling, 1 reply; 38+ messages in thread

From: Ashesh Vashi @ 2014-01-03 09:19 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: pgsql-general

Try "psql -W" for prompting the password forcefully.


On Fri, Jan 3, 2014 at 2:46 PM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:

> Hi,
> I am trying to login from psql and consistently getting a
> "psql: FATAL:  password authentication failed for user "xyz"" for all
> users. I am not being prompted for a password at all. I faced a similar
> issue sometime ago because there was a .pgpass file and it had wrong
> entries. This time there is no .pgpass file.
> Any clues? How do I trouble-shoot?
> Other possibly relevant info - this is a chrooted environment. I upgraded
> the OS recently in this env and faced some issues with /dev/null /proc etc
> not being present and so on. Some issues there?
> The database itself is running in the same server in the non-chroot
> environment. I am also running a python application which uses psycopg2 and
> that is working fine.
> Regards,
> Jayadevan
>
>


-- 
--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company<http://www.enterprisedb.com;



*http://www.linkedin.com/in/asheshvashi*<http://www.linkedin.com/in/asheshvashi;

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 10:02  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Jayadevan M @ 2014-01-03 10:02 UTC (permalink / raw)
  To: Ashesh Vashi <ashesh.vashi@enterprisedb.com>; +Cc: pgsql-general

Nope -
psql -W
psql: FATAL:  password authentication failed for user "postgres"



On Fri, Jan 3, 2014 at 2:49 PM, Ashesh Vashi
<ashesh.vashi@enterprisedb.com>wrote:

> Try "psql -W" for prompting the password forcefully.
>
>
> On Fri, Jan 3, 2014 at 2:46 PM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:
>
>> Hi,
>> I am trying to login from psql and consistently getting a
>> "psql: FATAL:  password authentication failed for user "xyz"" for all
>> users. I am not being prompted for a password at all. I faced a similar
>> issue sometime ago because there was a .pgpass file and it had wrong
>> entries. This time there is no .pgpass file.
>> Any clues? How do I trouble-shoot?
>> Other possibly relevant info - this is a chrooted environment. I upgraded
>> the OS recently in this env and faced some issues with /dev/null /proc etc
>> not being present and so on. Some issues there?
>> The database itself is running in the same server in the non-chroot
>> environment. I am also running a python application which uses psycopg2 and
>> that is working fine.
>> Regards,
>> Jayadevan
>>
>>
>
>
> --
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company<http://www.enterprisedb.com;
>
>
>
> *http://www.linkedin.com/in/asheshvashi*<http://www.linkedin.com/in/asheshvashi;
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 11:02  dinesh kumar <dineshkumar02@gmail.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  0 siblings, 0 replies; 38+ messages in thread

From: dinesh kumar @ 2014-01-03 11:02 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: pgsql-general

Hi,

On Fri, Jan 3, 2014 at 3:32 PM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:

> Nope -
> psql -W
> psql: FATAL:  password authentication failed for user "postgres"
>
>
There might be possible of the user's password expiration. Make the user's
local authentication as trust, and reload the postgres instance, and check
the "pg_user" table for the password expire date. If the password is
expired, alter the user's expiration time.

Regards,
Dinesh
manojadinesh.blogspot.com


>
> On Fri, Jan 3, 2014 at 2:49 PM, Ashesh Vashi <
> ashesh.vashi@enterprisedb.com> wrote:
>
>> Try "psql -W" for prompting the password forcefully.
>>
>>
>> On Fri, Jan 3, 2014 at 2:46 PM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:
>>
>>> Hi,
>>> I am trying to login from psql and consistently getting a
>>> "psql: FATAL:  password authentication failed for user "xyz"" for all
>>> users. I am not being prompted for a password at all. I faced a similar
>>> issue sometime ago because there was a .pgpass file and it had wrong
>>> entries. This time there is no .pgpass file.
>>> Any clues? How do I trouble-shoot?
>>> Other possibly relevant info - this is a chrooted environment. I
>>> upgraded the OS recently in this env and faced some issues with /dev/null
>>> /proc etc not being present and so on. Some issues there?
>>> The database itself is running in the same server in the non-chroot
>>> environment. I am also running a python application which uses psycopg2 and
>>> that is working fine.
>>> Regards,
>>> Jayadevan
>>>
>>>
>>
>>
>> --
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company<http://www.enterprisedb.com;
>>
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*<http://www.linkedin.com/in/asheshvashi;
>>
>
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 11:39  Chris Curvey <chris@chriscurvey.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  1 sibling, 1 reply; 38+ messages in thread

From: Chris Curvey @ 2014-01-03 11:39 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: pgsql-general

On Fri, Jan 3, 2014 at 4:16 AM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:

> Hi,
> I am trying to login from psql and consistently getting a
> "psql: FATAL:  password authentication failed for user "xyz"" for all
> users. I am not being prompted for a password at all. I faced a similar
> issue sometime ago because there was a .pgpass file and it had wrong
> entries. This time there is no .pgpass file.
> Any clues? How do I trouble-shoot?
> Other possibly relevant info - this is a chrooted environment. I upgraded
> the OS recently in this env and faced some issues with /dev/null /proc etc
> not being present and so on. Some issues there?
> The database itself is running in the same server in the non-chroot
> environment. I am also running a python application which uses psycopg2 and
> that is working fine.
> Regards,
> Jayadevan
>

Could it be a problem with your pg_hba.conf?  Perhaps password
authentication is not enabled there?



-- 
I asked the Internet how to train my cat, and the Internet told me to get a
dog.

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 11:43  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: Chris Curvey <chris@chriscurvey.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Jayadevan M @ 2014-01-03 11:43 UTC (permalink / raw)
  To: chris@chriscurvey.com; +Cc: pgsql-general

I am able to login from the non-chroot environment. So it is not an issue
with pg_hba.conf and not an issue of password expiration. Is there a debug
psql option?




On Fri, Jan 3, 2014 at 5:09 PM, Chris Curvey <chris@chriscurvey.com> wrote:

>
>
>
> On Fri, Jan 3, 2014 at 4:16 AM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:
>
>> Hi,
>> I am trying to login from psql and consistently getting a
>> "psql: FATAL:  password authentication failed for user "xyz"" for all
>> users. I am not being prompted for a password at all. I faced a similar
>> issue sometime ago because there was a .pgpass file and it had wrong
>> entries. This time there is no .pgpass file.
>> Any clues? How do I trouble-shoot?
>> Other possibly relevant info - this is a chrooted environment. I upgraded
>> the OS recently in this env and faced some issues with /dev/null /proc etc
>> not being present and so on. Some issues there?
>> The database itself is running in the same server in the non-chroot
>> environment. I am also running a python application which uses psycopg2 and
>> that is working fine.
>> Regards,
>> Jayadevan
>>
>
> Could it be a problem with your pg_hba.conf?  Perhaps password
> authentication is not enabled there?
>
>
>
> --
> I asked the Internet how to train my cat, and the Internet told me to get
> a dog.
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 12:06  dinesh kumar <dineshkumar02@gmail.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: dinesh kumar @ 2014-01-03 12:06 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: pgsql-general

On Fri, Jan 3, 2014 at 5:13 PM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:

> I am able to login from the non-chroot environment. So it is not an issue
> with pg_hba.conf and not an issue of password expiration. Is there a debug
> psql option?
>
> OK.

Have you checked the PGPASSWORD environment variable, from where you are
trying to login.

Regards,
Dinesh
manojadinesh.blogspot.com


>
>
> On Fri, Jan 3, 2014 at 5:09 PM, Chris Curvey <chris@chriscurvey.com>wrote:
>
>>
>>
>>
>> On Fri, Jan 3, 2014 at 4:16 AM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:
>>
>>> Hi,
>>> I am trying to login from psql and consistently getting a
>>> "psql: FATAL:  password authentication failed for user "xyz"" for all
>>> users. I am not being prompted for a password at all. I faced a similar
>>> issue sometime ago because there was a .pgpass file and it had wrong
>>> entries. This time there is no .pgpass file.
>>> Any clues? How do I trouble-shoot?
>>> Other possibly relevant info - this is a chrooted environment. I
>>> upgraded the OS recently in this env and faced some issues with /dev/null
>>> /proc etc not being present and so on. Some issues there?
>>> The database itself is running in the same server in the non-chroot
>>> environment. I am also running a python application which uses psycopg2 and
>>> that is working fine.
>>> Regards,
>>> Jayadevan
>>>
>>
>> Could it be a problem with your pg_hba.conf?  Perhaps password
>> authentication is not enabled there?
>>
>>
>>
>> --
>> I asked the Internet how to train my cat, and the Internet told me to get
>> a dog.
>>
>
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 12:54  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: dinesh kumar <dineshkumar02@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Jayadevan M @ 2014-01-03 12:54 UTC (permalink / raw)
  To: dinesh kumar <dineshkumar02@gmail.com>; +Cc: pgsql-general

Yes. All the basic checks I have done. I upgraded from CENTOs 6.4 to 6.5.
Another interesting thing - if I su - postgres and then try, it works. So
it has something to do with the chrt user (root) settings.


On Fri, Jan 3, 2014 at 5:36 PM, dinesh kumar <dineshkumar02@gmail.com>wrote:

>
> On Fri, Jan 3, 2014 at 5:13 PM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:
>
>> I am able to login from the non-chroot environment. So it is not an issue
>> with pg_hba.conf and not an issue of password expiration. Is there a debug
>> psql option?
>>
>> OK.
>
> Have you checked the PGPASSWORD environment variable, from where you are
> trying to login.
>
> Regards,
> Dinesh
> manojadinesh.blogspot.com
>
>
>>
>>
>> On Fri, Jan 3, 2014 at 5:09 PM, Chris Curvey <chris@chriscurvey.com>wrote:
>>
>>>
>>>
>>>
>>> On Fri, Jan 3, 2014 at 4:16 AM, Jayadevan M <maymala.jayadevan@gmail.com
>>> > wrote:
>>>
>>>> Hi,
>>>> I am trying to login from psql and consistently getting a
>>>> "psql: FATAL:  password authentication failed for user "xyz"" for all
>>>> users. I am not being prompted for a password at all. I faced a similar
>>>> issue sometime ago because there was a .pgpass file and it had wrong
>>>> entries. This time there is no .pgpass file.
>>>> Any clues? How do I trouble-shoot?
>>>> Other possibly relevant info - this is a chrooted environment. I
>>>> upgraded the OS recently in this env and faced some issues with /dev/null
>>>> /proc etc not being present and so on. Some issues there?
>>>> The database itself is running in the same server in the non-chroot
>>>> environment. I am also running a python application which uses psycopg2 and
>>>> that is working fine.
>>>> Regards,
>>>> Jayadevan
>>>>
>>>
>>> Could it be a problem with your pg_hba.conf?  Perhaps password
>>> authentication is not enabled there?
>>>
>>>
>>>
>>> --
>>> I asked the Internet how to train my cat, and the Internet told me to
>>> get a dog.
>>>
>>
>>
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 14:27  Adrian Klaver <adrian.klaver@gmail.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2014-01-03 14:27 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; +Cc: pgsql-general

On 01/03/2014 04:54 AM, Jayadevan M wrote:
> Yes. All the basic checks I have done. I upgraded from CENTOs 6.4 to
> 6.5. Another interesting thing - if I su - postgres and then try, it
> works. So it has something to do with the chrt user (root) settings.
>

It might be helpful to detail what are the 'basic' checks you did? Also 
whenever I see unexplained behavior of this nature on Linux I suspect 
SELinux. Is it enabled?

>

-- 
Adrian Klaver
adrian.klaver@gmail.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-03 15:07  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Tom Lane @ 2014-01-03 15:07 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@gmail.com>; +Cc: Jayadevan M <maymala.jayadevan@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

Adrian Klaver <adrian.klaver@gmail.com> writes:
> On 01/03/2014 04:54 AM, Jayadevan M wrote:
>> Yes. All the basic checks I have done. I upgraded from CENTOs 6.4 to
>> 6.5. Another interesting thing - if I su - postgres and then try, it
>> works. So it has something to do with the chrt user (root) settings.

> It might be helpful to detail what are the 'basic' checks you did? Also 
> whenever I see unexplained behavior of this nature on Linux I suspect 
> SELinux. Is it enabled?

I'm wondering if there are two Postgres instances on the machine,
and the apparent inconsistency comes from connecting to one or the other.

A different line of thought is that connections from inside and outside
the chroot are getting different treatment in pg_hba.conf.

In any case, debugging this from the client's perspective is almost
impossible, because the server intentionally doesn't give a lot of
detail about why authentication failed.  You need to be looking at
the postmaster log, possibly with log_min_messages cranked up.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-04 05:29  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 38+ messages in thread

From: Jayadevan M @ 2014-01-04 05:29 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Adrian Klaver <adrian.klaver@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

There is only one instance -

 ps -eaf | grep bin/postgres | grep -v grep
postgres  3203     1  0  2013 ?        00:02:04 /usr/pgsql-9.3/bin/postgres

The basic checks I did -
Connectivity from other machines work (so server is accessible)
No .pgpass file in the system
Able to login as postgres and application users from the same system (as
long as it is not from the chroot environment). So this is not a
show-stopper- I am able to work and application is also working fine
Even in the chroot, as I mentioned, once I do a 'su - postgres', I am able
to login.

Overall, it is just a minor inconvenience, but I would like to resolve
this. The no password supplied message comes back so fast, it is as if it
did not even attemp to connect.




On Fri, Jan 3, 2014 at 8:37 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Adrian Klaver <adrian.klaver@gmail.com> writes:
> > On 01/03/2014 04:54 AM, Jayadevan M wrote:
> >> Yes. All the basic checks I have done. I upgraded from CENTOs 6.4 to
> >> 6.5. Another interesting thing - if I su - postgres and then try, it
> >> works. So it has something to do with the chrt user (root) settings.
>
> > It might be helpful to detail what are the 'basic' checks you did? Also
> > whenever I see unexplained behavior of this nature on Linux I suspect
> > SELinux. Is it enabled?
>
> I'm wondering if there are two Postgres instances on the machine,
> and the apparent inconsistency comes from connecting to one or the other.
>
> A different line of thought is that connections from inside and outside
> the chroot are getting different treatment in pg_hba.conf.
>
> In any case, debugging this from the client's perspective is almost
> impossible, because the server intentionally doesn't give a lot of
> detail about why authentication failed.  You need to be looking at
> the postmaster log, possibly with log_min_messages cranked up.
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-04 15:13  Adrian Klaver <adrian.klaver@gmail.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  1 sibling, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2014-01-04 15:13 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

On 01/03/2014 09:29 PM, Jayadevan M wrote:
> There is only one instance -
>
>   ps -eaf | grep bin/postgres | grep -v grep
> postgres  3203     1  0  2013 ?        00:02:04 /usr/pgsql-9.3/bin/postgres
>
> The basic checks I did -
> Connectivity from other machines work (so server is accessible)
> No .pgpass file in the system
> Able to login as postgres and application users from the same system (as
> long as it is not from the chroot environment). So this is not a
> show-stopper- I am able to work and application is also working fine
> Even in the chroot, as I mentioned, once I do a 'su - postgres', I am
> able to login.

So, if when you are in the chroot environment what user(s) fail to log 
in and are they the same user(s) as outside the chroot?

>
> Overall, it is just a minor inconvenience, but I would like to resolve
> this. The no password supplied message comes back so fast, it is as if
> it did not even attemp to connect.

Well, per Toms suggestion you will need to look at the Postgres log file 
to see from the servers perspective.

Also, in case there is third party program involved it would not hurt to 
tail the system log during your connection attempts.

>
>
>
>

-- 
Adrian Klaver
adrian.klaver@gmail.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 04:46  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Jayadevan M @ 2014-01-05 04:46 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

Log entries for 3 situations - 2 successful and one failed attempt -

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 07:43  Sameer Kumar <sameer.kumar@ashnik.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  1 sibling, 1 reply; 38+ messages in thread

From: Sameer Kumar @ 2014-01-05 07:43 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Adrian Klaver <adrian.klaver@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

On Sat, Jan 4, 2014 at 1:29 PM, Jayadevan M <maymala.jayadevan@gmail.com>wrote:

> There is only one instance -
>
>  ps -eaf | grep bin/postgres | grep -v grep
> postgres  3203     1  0  2013 ?        00:02:04 /usr/pgsql-9.3/bin/postgres
>

This only tells that there is one instance running!

There could be multiple PostgreSQL installations. And I guess that is what
Tom meant here.

Can you try
$ which psql
$ which pg_clt

Can you set your $PGUSER variable to postgres and then try?

$ export $PGUSER=postgres



Best Regards,
*Sameer Kumar | Database Consultant*

*ASHNIK PTE. LTD.*101 Cecil Street, #11-11 Tong Eng Building, Singapore
069533
M : *+65 8110 0350* T: +65 6438 3504 | www.ashnik.com
www.facebook.com/ashnikbiz | www.twitter.com/ashnikbiz

[image: email patch]

This email may contain confidential, privileged or copyright material and
is solely for the use of the intended recipient(s).

Attachments:

image002.jpg (image/jpeg, 5.5K) download view image
^ permalink raw reply [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 10:45  Jayadevan <maymala.jayadevan@gmail.com>
  parent: Sameer Kumar <sameer.kumar@ashnik.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Jayadevan @ 2014-01-05 10:45 UTC (permalink / raw)
  To: pgsql-general

Sameer Kumar wrote
> This only tells that there is one instance running!
> 
> There could be multiple PostgreSQL installations. And I guess that is what
> Tom meant here.

I doubt that was what Tom meant. Anyway, we can see from the error that the
request did reach the server.


Sameer Kumar wrote
> Can you try
> $ which psql
> $ which pg_clt
> 
> Can you set your $PGUSER variable to postgres and then try?
> 
> $ export $PGUSER=postgres

It is already set. How would which psql is being used have an impact?




--
View this message in context: http://postgresql.1045698.n5.nabble.com/authentication-failure-tp5785193p5785366.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 13:49  Sameer Kumar <sameer.kumar@ashnik.com>
  parent: Jayadevan <maymala.jayadevan@gmail.com>
  0 siblings, 0 replies; 38+ messages in thread

From: Sameer Kumar @ 2014-01-05 13:49 UTC (permalink / raw)
  To: Jayadevan <maymala.jayadevan@gmail.com>; +Cc: pgsql-general

On Sun, Jan 5, 2014 at 6:45 PM, Jayadevan <maymala.jayadevan@gmail.com>wrote:

> Sameer Kumar wrote
> > This only tells that there is one instance running!
> >
> > There could be multiple PostgreSQL installations. And I guess that is
> what
> > Tom meant here.
>
> I doubt that was what Tom meant. Anyway, we can see from the error that the
> request did reach the server.
>
>
> Sameer Kumar wrote
> > Can you try
> > $ which psql
> > $ which pg_clt
> >
> > Can you set your $PGUSER variable to postgres and then try?
> >
> > $ export $PGUSER=postgres
>
> It is already set.


I suggested this since you mentioned su - postgresql does not give you the
same error.

Which user are you using (while you get the error)?



> How would which psql is being used have an impact?
>
>
>
I was just trying to understand more about your environment. This will let
us know how many installations you have.

What is the value for your $PGDATA, $PGPASSWORD?


>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/authentication-failure-tp5785193p5785366.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 15:33  Adrian Klaver <adrian.klaver@gmail.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2014-01-05 15:33 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

On 01/04/2014 08:46 PM, Jayadevan M wrote:
> Log entries for 3 situations - 2 successful and one failed attempt -
>
>  From non-chroot, shell user  postgres
>
> 2014-01-05 10:11:58 IST [17008]: [2-1] user=postgres,db=postgres LOG:
> connection authorized: user=postgres database=postgres
> 2014-01-05 10:12:03 IST [17008]: [3-1] user=postgres,db=postgres LOG:
> disconnection: session time: 0:00:04.413 user=postgres database=postgres
> host=::1 port=47944
>
>
>  From chroot, shell user root, db user postgres
> 2014-01-05 10:12:18 IST [17021]: [1-1] user=[unknown],db=[unknown] LOG:
> connection received: host=::1 port=47945
> 2014-01-05 10:12:18 IST [17022]: [1-1] user=[unknown],db=[unknown] LOG:
> connection received: host=::1 port=47946
> 2014-01-05 10:12:18 IST [17022]: [2-1] user=postgres,db=postgres FATAL:
> password authentication failed for user "postgres"
> 2014-01-05 10:12:18 IST [17022]: [3-1] user=postgres,db=postgres
> DETAIL:  Connection matched pg_hba.conf line 90: "host
> all             all             ::1/128                 md5"
>

Alright so it (psql I assume) makes the connection but is failing when 
the password is supplied. That would point to an erroneous password 
being supplied from the root shell. This would seem to mean there is a 
~/.pgpass file with an incorrect value or a PGPASSWORD environment 
variable with an incorrect value. There is also the possibility that 
PGPASSFILE was set to point to a file other than .pgpass. To confirm 
that it is a password issue you could temporarily change the pg_hba.conf 
line above to trust and attempt the connection to see if it succeeds.

>
> chroot, shell user postgres
>
> 2014-01-05 10:12:48 IST [17051]: [1-1] user=[unknown],db=[unknown] LOG:
> connection received: host=::1 port=47948
> 2014-01-05 10:12:51 IST [17052]: [1-1] user=[unknown],db=[unknown] LOG:
> connection received: host=::1 port=47949
> 2014-01-05 10:12:51 IST [17052]: [2-1] user=postgres,db=postgres LOG:
> connection authorized: user=postgres database=postgres
>
>



-- 
Adrian Klaver
adrian.klaver@gmail.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 15:47  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 3 replies; 38+ messages in thread

From: Jayadevan M @ 2014-01-05 15:47 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

With md5
psql
psql: FATAL:  password authentication failed for user "postgres"

with trust
psql -h localhost
psql (9.3.2)
Type "help" for help.

back to md5
psql -h localhost
psql: FATAL:  password authentication failed for user "postgres"

But...

find / -name .pgpass
<no file found>

$ env | grep PG
PGPORT=1234
PGUSER=postgres
PGHOST=localhost



On Sun, Jan 5, 2014 at 9:03 PM, Adrian Klaver <adrian.klaver@gmail.com>wrote:

> On 01/04/2014 08:46 PM, Jayadevan M wrote:
>
>> Log entries for 3 situations - 2 successful and one failed attempt -
>>
>>  From non-chroot, shell user  postgres
>>
>> 2014-01-05 10:11:58 IST [17008]: [2-1] user=postgres,db=postgres LOG:
>> connection authorized: user=postgres database=postgres
>> 2014-01-05 10:12:03 IST [17008]: [3-1] user=postgres,db=postgres LOG:
>> disconnection: session time: 0:00:04.413 user=postgres database=postgres
>> host=::1 port=47944
>>
>>
>>  From chroot, shell user root, db user postgres
>> 2014-01-05 10:12:18 IST [17021]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47945
>> 2014-01-05 10:12:18 IST [17022]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47946
>> 2014-01-05 10:12:18 IST [17022]: [2-1] user=postgres,db=postgres FATAL:
>> password authentication failed for user "postgres"
>> 2014-01-05 10:12:18 IST [17022]: [3-1] user=postgres,db=postgres
>> DETAIL:  Connection matched pg_hba.conf line 90: "host
>> all             all             ::1/128                 md5"
>>
>>
> Alright so it (psql I assume) makes the connection but is failing when the
> password is supplied. That would point to an erroneous password being
> supplied from the root shell. This would seem to mean there is a ~/.pgpass
> file with an incorrect value or a PGPASSWORD environment variable with an
> incorrect value. There is also the possibility that PGPASSFILE was set to
> point to a file other than .pgpass. To confirm that it is a password issue
> you could temporarily change the pg_hba.conf line above to trust and
> attempt the connection to see if it succeeds.
>
>
>> chroot, shell user postgres
>>
>> 2014-01-05 10:12:48 IST [17051]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47948
>> 2014-01-05 10:12:51 IST [17052]: [1-1] user=[unknown],db=[unknown] LOG:
>> connection received: host=::1 port=47949
>> 2014-01-05 10:12:51 IST [17052]: [2-1] user=postgres,db=postgres LOG:
>> connection authorized: user=postgres database=postgres
>>
>>
>>
>
>
> --
> Adrian Klaver
> adrian.klaver@gmail.com
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 17:12  Adrian Klaver <adrian.klaver@gmail.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  2 siblings, 0 replies; 38+ messages in thread

From: Adrian Klaver @ 2014-01-05 17:12 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

On 01/05/2014 07:47 AM, Jayadevan M wrote:
> With md5
> psql
> psql: FATAL:  password authentication failed for user "postgres"
>
> with trust
> psql -h localhost
> psql (9.3.2)
> Type "help" for help.
>
> back to md5
> psql -h localhost
> psql: FATAL:  password authentication failed for user "postgres"

Just noticed while testing here:

aklaver@panda:~> psql -d test -U aklaver -h localhost
psql: FATAL:  password authentication failed for user "aklaver"
password retrieved from file "/home/aklaver/.pgpass"

So psql tells you when you are getting password from pgpass.


>
> But...
>
> find / -name .pgpass
> <no file found>
>
> $ env | grep PG
> PGPORT=1234
> PGUSER=postgres
> PGHOST=localhost

Hmm, I am going to have to think about this.

>
>
>
>


-- 
Adrian Klaver
adrian.klaver@gmail.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 17:42  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  2 siblings, 1 reply; 38+ messages in thread

From: Tom Lane @ 2014-01-05 17:42 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

Jayadevan M <maymala.jayadevan@gmail.com> writes:
> back to md5
> psql -h localhost
> psql: FATAL:  password authentication failed for user "postgres"
> [ but there's no .pgpass file ]

Perhaps the postgres user has a password that's marked as expired
in pg_authid.rolvaliduntil?  Try
select rolname, rolvaliduntil from pg_authid;

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 17:48  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 38+ messages in thread

From: Tom Lane @ 2014-01-05 17:48 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

I wrote:
> Perhaps the postgres user has a password that's marked as expired
> in pg_authid.rolvaliduntil?

Ah, no, scratch that: a look at the code shows the backend doesn't
check rolvaliduntil until after the client has given a valid password.
Seems like psql *must* be getting a password from someplace.

Perhaps it's time to strace psql and see what files it accesses.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-05 20:47  Adrian Klaver <adrian.klaver@gmail.com>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  2 siblings, 0 replies; 38+ messages in thread

From: Adrian Klaver @ 2014-01-05 20:47 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

On 01/05/2014 07:47 AM, Jayadevan M wrote:
> With md5
> psql
> psql: FATAL:  password authentication failed for user "postgres"
>
> with trust
> psql -h localhost
> psql (9.3.2)
> Type "help" for help.
>
> back to md5
> psql -h localhost
> psql: FATAL:  password authentication failed for user "postgres"
>
> But...
>
> find / -name .pgpass
> <no file found>
>
> $ env | grep PG
> PGPORT=1234
> PGUSER=postgres
> PGHOST=localhost
>
>

So the env is from the root account in the chroot?

Is it the same as the postgres account?

The only suggestion I have left is to look at the chroot setup.

See Toms post for another suggestion.


-- 
Adrian Klaver
adrian.klaver@gmail.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-06 04:52  Jayadevan M <maymala.jayadevan@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 38+ messages in thread

From: Jayadevan M @ 2014-01-06 04:52 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Adrian Klaver <adrian.klaver@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

I am able to login as postgres with password from the same machine. So it
is not an expiry issue (as you too concluded).  Output from strace is about
500 lines. I am pasting what I feel may be relevant. I hope this will be
useful.

execve("/usr/pgsql-9.3/bin/psql", ["psql", "-h", "localhost"], [/* 24 vars
*/]) = 0
brk(0)                                  = 0x1962000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fb252e42000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=40284, ...}) = 0
mmap(NULL, 40284, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb252e38000
close(3)                                = 0
open("/usr/pgsql-9.3/lib/libpq.so.5", O_RDONLY) = 3
read(3,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\225\0\0\0\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=188904, ...}) = 0
mmap(NULL, 2284256, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x7fb2529f6000
mprotect(0x7fb252a21000, 2097152, PROT_NONE) = 0
....
munmap(0x7fb252e41000, 4096)            = 0
open("/usr/pgsql-9.3/share/locale/en_IN/LC_MESSAGES/psql-9.3.mo", O_RDONLY)
= -1 ENOENT (No such file or directory)
open("/usr/pgsql-9.3/share/locale/en/LC_MESSAGES/psql-9.3.mo", O_RDONLY) =
-1 ENOENT (No such file or directory)
geteuid()                               = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1
ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1
ENOENT (No such file or directory)
close(3)                                = 0
....
stat("/root/.pgpass", 0x7fffc631e030)   = -1 ENOENT (No such file or
directory)
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
.....
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1
ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1
ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/host.conf", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
....
sendto(3, "\0\0\0T\0\3\0\0user\0postgres\0database\0p"..., 84,
MSG_NOSIGNAL, NULL, 0) = 84
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "R\0\0\0\f\0\0\0\5:\314\261\264", 16384, 0, NULL, NULL) = 13
close(3)                                = 0
open("/dev/tty", O_RDONLY)              = 3
open("/dev/tty", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffc631e550) = -1 ENOTTY
(Inappropriate ioctl for device)
ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B0 -opost -isig icanon -echo
...}) = -1 ENOTTY (Inappropriate ioctl for device)
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fb252e41000
write(4, "Password: ", 10)              = 10
fstat(3, {st_mode=S_IFREG|0644, st_size=10, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fb252e40000
read(3, "Password: ", 4096)             = 10
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B0 -opost -isig icanon -echo
...}) = -1 ENOTTY (Inappropriate ioctl for device)
write(4, "\n", 1)                       = 1
close(3)                                = 0
munmap(0x7fb252e40000, 4096)            = 0
close(4)                                = 0
munmap(0x7fb252e41000, 4096)            = 0
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
....
connect(3, {sa_family=AF_INET, sin_port=htons(1234),
sin_addr=inet_addr("212.71.253.117")}, 16) = 0
getsockname(3, {sa_family=AF_INET6, sin6_port=htons(49998),
inet_pton(AF_INET6, "::ffff:212.71.253.117", &sin6_addr), sin6_flowinfo=0,
sin6_scope_id=0}, [28]) = 0
close(3)                                = 0
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=3632, groups=00000000}, [12]) = 0
sendto(3, "\24\0\0\0\22\0\1\3m4\312R\0\0\0\0\0\0\0\0", 20, 0,
{sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000},
msg_iov(1)=[{"0\4\0\0\20\0\2\0m4\312R0\16\0\0\0\0\4\3\1\0\0\0I\0\1\0\0\0\0\0"...,
4096}], msg_controllen=0, msg_flags=0}, 0) = 3244
close(3)                                = 0
socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
fcntl(3, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
connect(3, {sa_family=AF_INET6, sin6_port=htons(1234), inet_pton(AF_INET6,
"::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EINPROGRESS
(Operation now in progress)
poll([{fd=3, events=POLLOUT|POLLERR}], 1, -1) = 1 ([{fd=3,
revents=POLLOUT}])
getsockopt(3, SOL_SOCKET, SO_ERROR, [5972663263635177472], [4]) = 0
getsockname(3, {sa_family=AF_INET6, sin6_port=htons(49516),
inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
[28]) = 0
poll([{fd=3, events=POLLOUT|POLLERR}], 1, -1) = 1 ([{fd=3,
revents=POLLOUT}])
sendto(3, "\0\0\0\10\4\322\26/", 8, MSG_NOSIGNAL, NULL, 0) = 8
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "N", 16384, 0, NULL, NULL)  = 1
poll([{fd=3, events=POLLOUT|POLLERR}], 1, -1) = 1 ([{fd=3,
revents=POLLOUT}])
sendto(3, "\0\0\0T\0\3\0\0user\0postgres\0database\0p"..., 84,
MSG_NOSIGNAL, NULL, 0) = 84
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "R\0\0\0\f\0\0\0\5\245}\301\263", 16384, 0, NULL, NULL) = 13
sendto(3, "p\0\0\0(md5db443609787c21b3171e5eed"..., 41, MSG_NOSIGNAL, NULL,
0) = 41
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "E\0\0\0aSFATAL\0C28P01\0Mpassword aut"..., 16384, 0, NULL,
NULL) = 98
write(2, "psql: FATAL:  password authentic"..., 65) = 65



On Sun, Jan 5, 2014 at 11:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> I wrote:
> > Perhaps the postgres user has a password that's marked as expired
> > in pg_authid.rolvaliduntil?
>
> Ah, no, scratch that: a look at the code shows the backend doesn't
> check rolvaliduntil until after the client has given a valid password.
> Seems like psql *must* be getting a password from someplace.
>
> Perhaps it's time to strace psql and see what files it accesses.
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-06 21:42  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jayadevan M <maymala.jayadevan@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Tom Lane @ 2014-01-06 21:42 UTC (permalink / raw)
  To: Jayadevan M <maymala.jayadevan@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@gmail.com>; dinesh kumar <dineshkumar02@gmail.com>; pgsql-general

Jayadevan M <maymala.jayadevan@gmail.com> writes:
> I am able to login as postgres with password from the same machine. So it
> is not an expiry issue (as you too concluded).  Output from strace is about
> 500 lines. I am pasting what I feel may be relevant. I hope this will be
> useful.

Well, this is pretty interesting:

> open("/dev/tty", O_RDONLY)              = 3
> open("/dev/tty", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
> ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffc631e550) = -1 ENOTTY
> (Inappropriate ioctl for device)
> ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B0 -opost -isig icanon -echo
> ...}) = -1 ENOTTY (Inappropriate ioctl for device)
> fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0x7fb252e41000
> write(4, "Password: ", 10)              = 10
> fstat(3, {st_mode=S_IFREG|0644, st_size=10, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0x7fb252e40000
> read(3, "Password: ", 4096)             = 10
> read(3, "", 4096)                       = 0
> read(3, "", 4096)                       = 0
> ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B0 -opost -isig icanon -echo
> ...}) = -1 ENOTTY (Inappropriate ioctl for device)
> write(4, "\n", 1)                       = 1
> close(3)                                = 0
> munmap(0x7fb252e40000, 4096)            = 0
> close(4)                                = 0

It *is* prompting for a password, or so it thinks.  Apparently /dev/tty
is connected to the bit bucket in your environment?

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2014-01-06 22:04  Rob Sargent <robjsargent@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 38+ messages in thread

From: Rob Sargent @ 2014-01-06 22:04 UTC (permalink / raw)
  To: pgsql-general

On 01/06/2014 02:42 PM, Tom Lane wrote:
> Jayadevan M <maymala.jayadevan@gmail.com> writes:
>> I am able to login as postgres with password from the same machine. So it
>> is not an expiry issue (as you too concluded).  Output from strace is about
>> 500 lines. I am pasting what I feel may be relevant. I hope this will be
>> useful.
> Well, this is pretty interesting:
>
>> open("/dev/tty", O_RDONLY)              = 3
>> open("/dev/tty", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
>> ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffc631e550) = -1 ENOTTY
>> (Inappropriate ioctl for device)
>> ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B0 -opost -isig icanon -echo
>> ...}) = -1 ENOTTY (Inappropriate ioctl for device)
>> fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
>> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>> 0x7fb252e41000
>> write(4, "Password: ", 10)              = 10
>> fstat(3, {st_mode=S_IFREG|0644, st_size=10, ...}) = 0
>> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>> 0x7fb252e40000
>> read(3, "Password: ", 4096)             = 10
>> read(3, "", 4096)                       = 0
>> read(3, "", 4096)                       = 0
>> ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B0 -opost -isig icanon -echo
>> ...}) = -1 ENOTTY (Inappropriate ioctl for device)
>> write(4, "\n", 1)                       = 1
>> close(3)                                = 0
>> munmap(0x7fb252e40000, 4096)            = 0
>> close(4)                                = 0
> It *is* prompting for a password, or so it thinks.  Apparently /dev/tty
> is connected to the bit bucket in your environment?
>
> 			regards, tom lane
>
>
I've been bit where foreground colour == background colour.

rjs

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* authentication failure
@ 2018-04-12 13:51  armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: armand pirvu @ 2018-04-12 13:51 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi there

I have a process in place which runs several queries from one host to another one


All of a sudden I started noticing authentication failures

Like below

.009 ms  statement: COPY  NACDS.tf_show_code_response_person FROM STDIN with csv;",,,,,,,,,"psql"
2018-04-12 00:10:48.765 CDT,"csidba","birstdb",7553,"172.16.20.4:40330",5aceea2e.1d81,1,"UPDATE",2018-04-12 00:10:06 CDT,24/0,0,LOG,00000,"duration: 425
90.993 ms  statement: UPDATE
    csischema.tf_transaction_person
SET 
    is_deleted = 'TRUE',
    birst_is_deleted = 'TRUE',
    update_datetime = now()::timestamp(0)
WHERE
    show_id = '984BIOWC18' AND
    birst_is_deleted = 'FALSE' AND
    person_transaction_id IN (
        SELECT a.person_transaction_id
        FROM csischema.tf_transaction_person a
             LEFT JOIN BIOWC.tf_transaction_person b
             ON a.person_transaction_id=b.person_transaction_id
        WHERE a.show_id = '984BIOWC18' AND b.person_transaction_id IS NULL
    )
;",,,,,,,,,"psql"
2018-04-12 00:10:48.823 CDT,"csidba","birstdb",7755,"172.16.20.4:40455",5aceea58.1e4b,1,"authentication",2018-04-12 00:10:48 CDT,3/20320168,0,FATAL,28P0
1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
2018-04-12 00:10:48.841 CDT,"csidba","birstdb",7756,"172.16.20.4:40456",5aceea58.1e4c,1,"authentication",2018-04-12 00:10:48 CDT,3/20320169,0,FATAL,28P0
1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
2018-04-12 00:10:48.957 CDT,"csidba","birstdb",7759,"172.16.20.4:40459",5aceea58.1e4f,1,"authentication",2018-04-12 00:10:48 CDT,3/20320172,0,FATAL,28P0


pg_hba.conf

# "local" is for Unix domain socket connections only
#local   all             all                                     peer
local   all             all                                     md5
# IPv4 local connections:
#host    all             all             127.0.0.1/32            ident
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident
local  replication  csidba  md5
host   replication  csidba  127.0.0.1/32  md5
host   replication  csidba  0.0.0.0/0     md5
local  replication  repuser  md5
host   replication  repuser  127.0.0.1/32  md5
host   replication  repuser  0.0.0.0/0     md5
local  all         repuser  md5
host   all         repuser  127.0.0.1/32  md5
host   all         repuser  0.0.0.0/0     md5



Did I run in somthing similar to a racong condition ?


Any ideas ?



Many thanks

— Armand







^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 13:56  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2018-04-12 13:56 UTC (permalink / raw)
  To: armand pirvu <armand.pirvu@gmail.com>; pgsql-general@lists.postgresql.org

On 04/12/2018 06:51 AM, armand pirvu wrote:
> Hi there
> 
> I have a process in place which runs several queries from one host to another one
> 
> 
> All of a sudden I started noticing authentication failures
> 
> Like below
> 
> .009 ms  statement: COPY  NACDS.tf_show_code_response_person FROM STDIN with csv;",,,,,,,,,"psql"
> 2018-04-12 00:10:48.765 CDT,"csidba","birstdb",7553,"172.16.20.4:40330",5aceea2e.1d81,1,"UPDATE",2018-04-12 00:10:06 CDT,24/0,0,LOG,00000,"duration: 425
> 90.993 ms  statement: UPDATE
>      csischema.tf_transaction_person
> SET
>      is_deleted = 'TRUE',
>      birst_is_deleted = 'TRUE',
>      update_datetime = now()::timestamp(0)
> WHERE
>      show_id = '984BIOWC18' AND
>      birst_is_deleted = 'FALSE' AND
>      person_transaction_id IN (
>          SELECT a.person_transaction_id
>          FROM csischema.tf_transaction_person a
>               LEFT JOIN BIOWC.tf_transaction_person b
>               ON a.person_transaction_id=b.person_transaction_id
>          WHERE a.show_id = '984BIOWC18' AND b.person_transaction_id IS NULL
>      )
> ;",,,,,,,,,"psql"
> 2018-04-12 00:10:48.823 CDT,"csidba","birstdb",7755,"172.16.20.4:40455",5aceea58.1e4b,1,"authentication",2018-04-12 00:10:48 CDT,3/20320168,0,FATAL,28P0
> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
> 2018-04-12 00:10:48.841 CDT,"csidba","birstdb",7756,"172.16.20.4:40456",5aceea58.1e4c,1,"authentication",2018-04-12 00:10:48 CDT,3/20320169,0,FATAL,28P0
> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
> 2018-04-12 00:10:48.957 CDT,"csidba","birstdb",7759,"172.16.20.4:40459",5aceea58.1e4f,1,"authentication",2018-04-12 00:10:48 CDT,3/20320172,0,FATAL,28P0
> 
> 
> pg_hba.conf
> 
> # "local" is for Unix domain socket connections only
> #local   all             all                                     peer
> local   all             all                                     md5
> # IPv4 local connections:
> #host    all             all             127.0.0.1/32            ident
> host all all 0.0.0.0/0 md5
> # IPv6 local connections:
> host    all             all             ::1/128                 ident
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> #local   replication     postgres                                peer
> #host    replication     postgres        127.0.0.1/32            ident
> #host    replication     postgres        ::1/128                 ident
> local  replication  csidba  md5
> host   replication  csidba  127.0.0.1/32  md5
> host   replication  csidba  0.0.0.0/0     md5
> local  replication  repuser  md5
> host   replication  repuser  127.0.0.1/32  md5
> host   replication  repuser  0.0.0.0/0     md5
> local  all         repuser  md5
> host   all         repuser  127.0.0.1/32  md5
> host   all         repuser  0.0.0.0/0     md5
> 
> 
> 
> Did I run in somthing similar to a racong condition ?
> 
> 
> Any ideas ?

Is the process using the correct password?

> 
> 
> 
> Many thanks
> 
> — Armand
> 
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:08  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2018-04-12 14:08 UTC (permalink / raw)
  To: armand pirvu <armand.pirvu@gmail.com>; +Cc: pgsql-general

On 04/12/2018 06:59 AM, armand pirvu wrote:

Please reply to list also.
Ccing list.
> Yes and worked fine until two days ago
> I use .pgpass

So can you connect from wherever the process is run to the server 
manually? Something like:


psql -d birstab -U csidba -h some_server


> I will also check and see if there are not too many hands in the cookie jar so to speak and things happen without being communicated
> 
> 
>> On Apr 12, 2018, at 8:56 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>>
>> On 04/12/2018 06:51 AM, armand pirvu wrote:
>>> Hi there
>>> I have a process in place which runs several queries from one host to another one
>>> All of a sudden I started noticing authentication failures
>>> Like below
>>> .009 ms  statement: COPY  NACDS.tf_show_code_response_person FROM STDIN with csv;",,,,,,,,,"psql"
>>> 2018-04-12 00:10:48.765 CDT,"csidba","birstdb",7553,"172.16.20.4:40330",5aceea2e.1d81,1,"UPDATE",2018-04-12 00:10:06 CDT,24/0,0,LOG,00000,"duration: 425
>>> 90.993 ms  statement: UPDATE
>>>      csischema.tf_transaction_person
>>> SET
>>>      is_deleted = 'TRUE',
>>>      birst_is_deleted = 'TRUE',
>>>      update_datetime = now()::timestamp(0)
>>> WHERE
>>>      show_id = '984BIOWC18' AND
>>>      birst_is_deleted = 'FALSE' AND
>>>      person_transaction_id IN (
>>>          SELECT a.person_transaction_id
>>>          FROM csischema.tf_transaction_person a
>>>               LEFT JOIN BIOWC.tf_transaction_person b
>>>               ON a.person_transaction_id=b.person_transaction_id
>>>          WHERE a.show_id = '984BIOWC18' AND b.person_transaction_id IS NULL
>>>      )
>>> ;",,,,,,,,,"psql"
>>> 2018-04-12 00:10:48.823 CDT,"csidba","birstdb",7755,"172.16.20.4:40455",5aceea58.1e4b,1,"authentication",2018-04-12 00:10:48 CDT,3/20320168,0,FATAL,28P0
>>> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
>>> 2018-04-12 00:10:48.841 CDT,"csidba","birstdb",7756,"172.16.20.4:40456",5aceea58.1e4c,1,"authentication",2018-04-12 00:10:48 CDT,3/20320169,0,FATAL,28P0
>>> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
>>> 2018-04-12 00:10:48.957 CDT,"csidba","birstdb",7759,"172.16.20.4:40459",5aceea58.1e4f,1,"authentication",2018-04-12 00:10:48 CDT,3/20320172,0,FATAL,28P0
>>> pg_hba.conf
>>> # "local" is for Unix domain socket connections only
>>> #local   all             all                                     peer
>>> local   all             all                                     md5
>>> # IPv4 local connections:
>>> #host    all             all             127.0.0.1/32            ident
>>> host all all 0.0.0.0/0 md5
>>> # IPv6 local connections:
>>> host    all             all             ::1/128                 ident
>>> # Allow replication connections from localhost, by a user with the
>>> # replication privilege.
>>> #local   replication     postgres                                peer
>>> #host    replication     postgres        127.0.0.1/32            ident
>>> #host    replication     postgres        ::1/128                 ident
>>> local  replication  csidba  md5
>>> host   replication  csidba  127.0.0.1/32  md5
>>> host   replication  csidba  0.0.0.0/0     md5
>>> local  replication  repuser  md5
>>> host   replication  repuser  127.0.0.1/32  md5
>>> host   replication  repuser  0.0.0.0/0     md5
>>> local  all         repuser  md5
>>> host   all         repuser  127.0.0.1/32  md5
>>> host   all         repuser  0.0.0.0/0     md5
>>> Did I run in somthing similar to a racong condition ?
>>> Any ideas ?
>>
>> Is the process using the correct password?
>>
>>> Many thanks
>>> — Armand
>>
>>
>> -- 
>> Adrian Klaver
>> adrian.klaver@aklaver.com
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:12  armand pirvu <armand.pirvu@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 38+ messages in thread

From: armand pirvu @ 2018-04-12 14:12 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general


> On Apr 12, 2018, at 9:08 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
> On 04/12/2018 06:59 AM, armand pirvu wrote:
> 
> Please reply to list also.
> Ccing list.
>> Yes and worked fine until two days ago
>> I use .pgpass
> 
> So can you connect from wherever the process is run to the server manually? Something like:
> 
> 
> psql -d birstab -U csidba -h some_server
> 
> 
>> I will also check and see if there are not too many hands in the cookie jar so to speak and things happen without being communicated
>>> On Apr 12, 2018, at 8:56 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>>> 
>>> On 04/12/2018 06:51 AM, armand pirvu wrote:
>>>> Hi there
>>>> I have a process in place which runs several queries from one host to another one
>>>> All of a sudden I started noticing authentication failures
>>>> Like below
>>>> .009 ms  statement: COPY  NACDS.tf_show_code_response_person FROM STDIN with csv;",,,,,,,,,"psql"
>>>> 2018-04-12 00:10:48.765 CDT,"csidba","birstdb",7553,"172.16.20.4:40330",5aceea2e.1d81,1,"UPDATE",2018-04-12 00:10:06 CDT,24/0,0,LOG,00000,"duration: 425
>>>> 90.993 ms  statement: UPDATE
>>>>     csischema.tf_transaction_person
>>>> SET
>>>>     is_deleted = 'TRUE',
>>>>     birst_is_deleted = 'TRUE',
>>>>     update_datetime = now()::timestamp(0)
>>>> WHERE
>>>>     show_id = '984BIOWC18' AND
>>>>     birst_is_deleted = 'FALSE' AND
>>>>     person_transaction_id IN (
>>>>         SELECT a.person_transaction_id
>>>>         FROM csischema.tf_transaction_person a
>>>>              LEFT JOIN BIOWC.tf_transaction_person b
>>>>              ON a.person_transaction_id=b.person_transaction_id
>>>>         WHERE a.show_id = '984BIOWC18' AND b.person_transaction_id IS NULL
>>>>     )
>>>> ;",,,,,,,,,"psql"
>>>> 2018-04-12 00:10:48.823 CDT,"csidba","birstdb",7755,"172.16.20.4:40455",5aceea58.1e4b,1,"authentication",2018-04-12 00:10:48 CDT,3/20320168,0,FATAL,28P0
>>>> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
>>>> 2018-04-12 00:10:48.841 CDT,"csidba","birstdb",7756,"172.16.20.4:40456",5aceea58.1e4c,1,"authentication",2018-04-12 00:10:48 CDT,3/20320169,0,FATAL,28P0
>>>> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
>>>> 2018-04-12 00:10:48.957 CDT,"csidba","birstdb",7759,"172.16.20.4:40459",5aceea58.1e4f,1,"authentication",2018-04-12 00:10:48 CDT,3/20320172,0,FATAL,28P0
>>>> pg_hba.conf
>>>> # "local" is for Unix domain socket connections only
>>>> #local   all             all                                     peer
>>>> local   all             all                                     md5
>>>> # IPv4 local connections:
>>>> #host    all             all             127.0.0.1/32            ident
>>>> host all all 0.0.0.0/0 md5
>>>> # IPv6 local connections:
>>>> host    all             all             ::1/128                 ident
>>>> # Allow replication connections from localhost, by a user with the
>>>> # replication privilege.
>>>> #local   replication     postgres                                peer
>>>> #host    replication     postgres        127.0.0.1/32            ident
>>>> #host    replication     postgres        ::1/128                 ident
>>>> local  replication  csidba  md5
>>>> host   replication  csidba  127.0.0.1/32  md5
>>>> host   replication  csidba  0.0.0.0/0     md5
>>>> local  replication  repuser  md5
>>>> host   replication  repuser  127.0.0.1/32  md5
>>>> host   replication  repuser  0.0.0.0/0     md5
>>>> local  all         repuser  md5
>>>> host   all         repuser  127.0.0.1/32  md5
>>>> host   all         repuser  0.0.0.0/0     md5
>>>> Did I run in somthing similar to a racong condition ?
>>>> Any ideas ?
>>> 
>>> Is the process using the correct password?
>>> 
>>>> Many thanks
>>>> — Armand
>>> 
>>> 
>>> -- 
>>> Adrian Klaver
>>> adrian.klaver@aklaver.com
> 
> 
> -- 
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

Yes I can that’s what is really puzzling me

[armandp@devweb2004 ~]$ /usr/pgsql-9.5/bin/psql -d birstdb -U csidba -h 172.16.26.4
psql (9.5.12, server 9.5.8)
Type "help" for help.

birstdb=# 

It is almost like the authnetication stops working for whatever reason
I did check the .pgpass and all that and nothing chaged

Is there a possibility like say 70 processes try to authenticate in the same time and postgres authentication gets a bit lost ?


Thank you

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:15  armand pirvu <armand.pirvu@gmail.com>
  parent: armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: armand pirvu @ 2018-04-12 14:15 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general


> On Apr 12, 2018, at 9:12 AM, armand pirvu <armand.pirvu@gmail.com> wrote:
> 
> 
>> On Apr 12, 2018, at 9:08 AM, Adrian Klaver <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>> 
>> On 04/12/2018 06:59 AM, armand pirvu wrote:
>> 
>> Please reply to list also.
>> Ccing list.
>>> Yes and worked fine until two days ago
>>> I use .pgpass
>> 
>> So can you connect from wherever the process is run to the server manually? Something like:
>> 
>> 
>> psql -d birstab -U csidba -h some_server
>> 
>> 
>>> I will also check and see if there are not too many hands in the cookie jar so to speak and things happen without being communicated
>>>> On Apr 12, 2018, at 8:56 AM, Adrian Klaver <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>>>> 
>>>> On 04/12/2018 06:51 AM, armand pirvu wrote:
>>>>> Hi there
>>>>> I have a process in place which runs several queries from one host to another one
>>>>> All of a sudden I started noticing authentication failures
>>>>> Like below
>>>>> .009 ms  statement: COPY  NACDS.tf_show_code_response_person FROM STDIN with csv;",,,,,,,,,"psql"
>>>>> 2018-04-12 00:10:48.765 CDT,"csidba","birstdb",7553,"172.16.20.4:40330",5aceea2e.1d81,1,"UPDATE",2018-04-12 00:10:06 CDT,24/0,0,LOG,00000,"duration: 425
>>>>> 90.993 ms  statement: UPDATE
>>>>>     csischema.tf_transaction_person
>>>>> SET
>>>>>     is_deleted = 'TRUE',
>>>>>     birst_is_deleted = 'TRUE',
>>>>>     update_datetime = now()::timestamp(0)
>>>>> WHERE
>>>>>     show_id = '984BIOWC18' AND
>>>>>     birst_is_deleted = 'FALSE' AND
>>>>>     person_transaction_id IN (
>>>>>         SELECT a.person_transaction_id
>>>>>         FROM csischema.tf_transaction_person a
>>>>>              LEFT JOIN BIOWC.tf_transaction_person b
>>>>>              ON a.person_transaction_id=b.person_transaction_id
>>>>>         WHERE a.show_id = '984BIOWC18' AND b.person_transaction_id IS NULL
>>>>>     )
>>>>> ;",,,,,,,,,"psql"
>>>>> 2018-04-12 00:10:48.823 CDT,"csidba","birstdb",7755,"172.16.20.4:40455",5aceea58.1e4b,1,"authentication",2018-04-12 00:10:48 CDT,3/20320168,0,FATAL,28P0
>>>>> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
>>>>> 2018-04-12 00:10:48.841 CDT,"csidba","birstdb",7756,"172.16.20.4:40456",5aceea58.1e4c,1,"authentication",2018-04-12 00:10:48 CDT,3/20320169,0,FATAL,28P0
>>>>> 1,"password authentication failed for user ""csidba""","Connection matched pg_hba.conf line 84: ""host all all 0.0.0.0/0 md5""",,,,,,,,""
>>>>> 2018-04-12 00:10:48.957 CDT,"csidba","birstdb",7759,"172.16.20.4:40459",5aceea58.1e4f,1,"authentication",2018-04-12 00:10:48 CDT,3/20320172,0,FATAL,28P0
>>>>> pg_hba.conf
>>>>> # "local" is for Unix domain socket connections only
>>>>> #local   all             all                                     peer
>>>>> local   all             all                                     md5
>>>>> # IPv4 local connections:
>>>>> #host    all             all             127.0.0.1/32            ident
>>>>> host all all 0.0.0.0/0 md5
>>>>> # IPv6 local connections:
>>>>> host    all             all             ::1/128                 ident
>>>>> # Allow replication connections from localhost, by a user with the
>>>>> # replication privilege.
>>>>> #local   replication     postgres                                peer
>>>>> #host    replication     postgres        127.0.0.1/32            ident
>>>>> #host    replication     postgres        ::1/128                 ident
>>>>> local  replication  csidba  md5
>>>>> host   replication  csidba  127.0.0.1/32  md5
>>>>> host   replication  csidba  0.0.0.0/0     md5
>>>>> local  replication  repuser  md5
>>>>> host   replication  repuser  127.0.0.1/32  md5
>>>>> host   replication  repuser  0.0.0.0/0     md5
>>>>> local  all         repuser  md5
>>>>> host   all         repuser  127.0.0.1/32  md5
>>>>> host   all         repuser  0.0.0.0/0     md5
>>>>> Did I run in somthing similar to a racong condition ?
>>>>> Any ideas ?
>>>> 
>>>> Is the process using the correct password?
>>>> 
>>>>> Many thanks
>>>>> — Armand
>>>> 
>>>> 
>>>> -- 
>>>> Adrian Klaver
>>>> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>> 
>> 
>> -- 
>> Adrian Klaver
>> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 
> Yes I can that’s what is really puzzling me
> 
> [armandp@devweb2004 ~]$ /usr/pgsql-9.5/bin/psql -d birstdb -U csidba -h 172.16.26.4
> psql (9.5.12, server 9.5.8)
> Type "help" for help.
> 
> birstdb=# 
> 
> It is almost like the authnetication stops working for whatever reason
> I did check the .pgpass and all that and nothing chaged
> 
> Is there a possibility like say 70 processes try to authenticate in the same time and postgres authentication gets a bit lost ?
> 
> 
> Thank you
> 
> 

Sorry for the double posting but could it be from 

#authentication_timeout = 1min		# 1s-600s

So if the server gets a bit oveloaded this could play a role ?

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:28  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2018-04-12 14:28 UTC (permalink / raw)
  To: armand pirvu <armand.pirvu@gmail.com>; +Cc: pgsql-general

On 04/12/2018 07:15 AM, armand pirvu wrote:
> 

>>
>>
> 
> Sorry for the double posting but could it be from
> 
> #authentication_timeout = 1min# 1s-600s

 From you previous post:

"It is almost like the authnetication stops working for whatever reason"

So to be clear the initial connections in the process go through, but at 
some point they start failing. Is that correct?

The timeout could be an issue. It would helpful to also see what 
max_connections setting is.

> 
> So if the server gets a bit oveloaded this could play a role ?
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:37  armand pirvu <armand.pirvu@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 38+ messages in thread

From: armand pirvu @ 2018-04-12 14:37 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general


> On Apr 12, 2018, at 9:28 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
> On 04/12/2018 07:15 AM, armand pirvu wrote:
> 
>>> 
>>> 
>> Sorry for the double posting but could it be from
>> #authentication_timeout = 1min# 1s-600s
> 
> From you previous post:
> 
> "It is almost like the authnetication stops working for whatever reason"
> 
> So to be clear the initial connections in the process go through, but at some point they start failing. Is that correct?
> 
> The timeout could be an issue. It would helpful to also see what max_connections setting is.
> 
>> So if the server gets a bit oveloaded this could play a role ?
> 
> 
> -- 
> Adrian Klaver
> adrian.klaver@aklaver.com


Yes correct initially they go through but at some point they start failing
Max_connections is set to 200 on the postgres server, but I did not notice any message about being maxed out connections wise
As a workaround for this very specific set of processes, until things get back in line so to speak, do you think from the devweb2004 (where processing is done) to devdb2004 (where the postgres database resides), should I just go from md5 to trusted ?









^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:48  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2018-04-12 14:48 UTC (permalink / raw)
  To: armand pirvu <armand.pirvu@gmail.com>; +Cc: pgsql-general

On 04/12/2018 07:37 AM, armand pirvu wrote:
> 
>> On Apr 12, 2018, at 9:28 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>>
>> On 04/12/2018 07:15 AM, armand pirvu wrote:
>>
>>>>
>>>>
>>> Sorry for the double posting but could it be from
>>> #authentication_timeout = 1min# 1s-600s
>>
>>  From you previous post:
>>
>> "It is almost like the authnetication stops working for whatever reason"
>>
>> So to be clear the initial connections in the process go through, but at some point they start failing. Is that correct?
>>
>> The timeout could be an issue. It would helpful to also see what max_connections setting is.
>>
>>> So if the server gets a bit oveloaded this could play a role ?
>>
>>
>> -- 
>> Adrian Klaver
>> adrian.klaver@aklaver.com
> 
> 
> Yes correct initially they go through but at some point they start failing
> Max_connections is set to 200 on the postgres server, but I did not notice any message about being maxed out connections wise
> As a workaround for this very specific set of processes, until things get back in line so to speak, do you think from the devweb2004 (where processing is done) to devdb2004 (where the postgres database resides), should I just go from md5 to trusted ?

I would be inclined to raise the authentication_timeout first before 
setting the auth method to trust.

I would also set the below.:

https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT

log_connections (boolean)
Causes each attempted connection to the server to be logged, as well as 
successful completion of client authentication. Only superusers can 
change this parameter at session start, and it cannot be changed at all 
within a session. The default is off.

log_disconnections (boolean)

That will give you a better idea of what is going on connection wise.

> 
> 
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:50  armand pirvu <armand.pirvu@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 38+ messages in thread

From: armand pirvu @ 2018-04-12 14:50 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general


> On Apr 12, 2018, at 9:48 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
> On 04/12/2018 07:37 AM, armand pirvu wrote:
>>> On Apr 12, 2018, at 9:28 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>>> 
>>> On 04/12/2018 07:15 AM, armand pirvu wrote:
>>> 
>>>>> 
>>>>> 
>>>> Sorry for the double posting but could it be from
>>>> #authentication_timeout = 1min# 1s-600s
>>> 
>>> From you previous post:
>>> 
>>> "It is almost like the authnetication stops working for whatever reason"
>>> 
>>> So to be clear the initial connections in the process go through, but at some point they start failing. Is that correct?
>>> 
>>> The timeout could be an issue. It would helpful to also see what max_connections setting is.
>>> 
>>>> So if the server gets a bit oveloaded this could play a role ?
>>> 
>>> 
>>> -- 
>>> Adrian Klaver
>>> adrian.klaver@aklaver.com
>> Yes correct initially they go through but at some point they start failing
>> Max_connections is set to 200 on the postgres server, but I did not notice any message about being maxed out connections wise
>> As a workaround for this very specific set of processes, until things get back in line so to speak, do you think from the devweb2004 (where processing is done) to devdb2004 (where the postgres database resides), should I just go from md5 to trusted ?
> 
> I would be inclined to raise the authentication_timeout first before setting the auth method to trust.
> 
> I would also set the below.:
> 
> https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT
> 
> log_connections (boolean)
> Causes each attempted connection to the server to be logged, as well as successful completion of client authentication. Only superusers can change this parameter at session start, and it cannot be changed at all within a session. The default is off.
> 
> log_disconnections (boolean)
> 
> That will give you a better idea of what is going on connection wise.
> 
> 
> 
> -- 
> Adrian Klaver
> adrian.klaver@aklaver.com


Will do so and report back 

Many thanks
Armand





^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 14:55  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: Adrian Klaver @ 2018-04-12 14:55 UTC (permalink / raw)
  To: armand pirvu <armand.pirvu@gmail.com>; +Cc: pgsql-general

On 04/12/2018 07:50 AM, armand pirvu wrote:
> 

>> I would be inclined to raise the authentication_timeout first before setting the auth method to trust.
>>
>> I would also set the below.:
>>
>> https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT
>>
>> log_connections (boolean)
>> Causes each attempted connection to the server to be logged, as well as successful completion of client authentication. Only superusers can change this parameter at session start, and it cannot be changed at all within a session. The default is off.
>>
>> log_disconnections (boolean)
>>
>> That will give you a better idea of what is going on connection wise.
>>
>>
>>
>> -- 
>> Adrian Klaver
>> adrian.klaver@aklaver.com
> 
> 
> Will do so and report back

Also, in a previous post you mentioned:

"Yes and worked fine until two days ago"

Is the code under version control so you can see if anything changed two 
days ago?

If not, any recollections of significant events from that time period?

> 
> Many thanks
> Armand
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-12 15:07  armand pirvu <armand.pirvu@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 38+ messages in thread

From: armand pirvu @ 2018-04-12 15:07 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general


> On Apr 12, 2018, at 9:55 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
> On 04/12/2018 07:50 AM, armand pirvu wrote:
> 
>>> I would be inclined to raise the authentication_timeout first before setting the auth method to trust.
>>> 
>>> I would also set the below.:
>>> 
>>> https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT
>>> 
>>> log_connections (boolean)
>>> Causes each attempted connection to the server to be logged, as well as successful completion of client authentication. Only superusers can change this parameter at session start, and it cannot be changed at all within a session. The default is off.
>>> 
>>> log_disconnections (boolean)
>>> 
>>> That will give you a better idea of what is going on connection wise.
>>> 
>>> 
>>> 
>>> -- 
>>> Adrian Klaver
>>> adrian.klaver@aklaver.com
>> Will do so and report back
> 
> Also, in a previous post you mentioned:
> 
> "Yes and worked fine until two days ago"
> 
> Is the code under version control so you can see if anything changed two days ago?
> 
> If not, any recollections of significant events from that time period?
> 
>> Many thanks
>> Armand
> 
> 
> -- 
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

No change in the code
Only maybe the data volume and potentially the number of what we call events for which that runs
There was a talk to add some more functionality but never went through
However I will ask around to see if someone did not forget to say about a change put in place overnight (it happened before)

Thanks
Armand

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-16 01:22  armand pirvu <armand.pirvu@gmail.com>
  parent: armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 1 reply; 38+ messages in thread

From: armand pirvu @ 2018-04-16 01:22 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general


> On Apr 12, 2018, at 10:07 AM, armand pirvu <armand.pirvu@gmail.com> wrote:
> 
> 
>> On Apr 12, 2018, at 9:55 AM, Adrian Klaver <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>> 
>> On 04/12/2018 07:50 AM, armand pirvu wrote:
>> 
>>>> I would be inclined to raise the authentication_timeout first before setting the auth method to trust.
>>>> 
>>>> I would also set the below.:
>>>> 
>>>> https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT <https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT;
>>>> 
>>>> log_connections (boolean)
>>>> Causes each attempted connection to the server to be logged, as well as successful completion of client authentication. Only superusers can change this parameter at session start, and it cannot be changed at all within a session. The default is off.
>>>> 
>>>> log_disconnections (boolean)
>>>> 
>>>> That will give you a better idea of what is going on connection wise.
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Adrian Klaver
>>>> adrian.klaver@aklaver.com
>>> Will do so and report back
>> 
>> Also, in a previous post you mentioned:
>> 
>> "Yes and worked fine until two days ago"
>> 
>> Is the code under version control so you can see if anything changed two days ago?
>> 
>> If not, any recollections of significant events from that time period?
>> 
>>> Many thanks
>>> Armand
>> 
>> 
>> -- 
>> Adrian Klaver
>> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 
> No change in the code
> Only maybe the data volume and potentially the number of what we call events for which that runs
> There was a talk to add some more functionality but never went through
> However I will ask around to see if someone did not forget to say about a change put in place overnight (it happened before)
> 
> Thanks
> Armand
> 
> 


Sorry for the late reply. In and out sll sorts of things which do distract me.
I raised the authentication_timeout and seems okay for now

Thank you for the help

Armand

^ permalink  raw  reply  [nested|flat] 38+ messages in thread

* Re: authentication failure
@ 2018-04-16 04:08  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: armand pirvu <armand.pirvu@gmail.com>
  0 siblings, 0 replies; 38+ messages in thread

From: Adrian Klaver @ 2018-04-16 04:08 UTC (permalink / raw)
  To: armand pirvu <armand.pirvu@gmail.com>; +Cc: pgsql-general

On 04/15/2018 06:22 PM, armand pirvu wrote:
> 

>>
> 
> 
> Sorry for the late reply. In and out sll sorts of things which do 
> distract me.
> I raised the authentication_timeout and seems okay for now

I would take the 'for now' as a heads up that there is underlying issue 
that will need to be resolved eventually. Namely that the procedure is 
using enough resources to impact the authentication process.

> 
> Thank you for the help
> 
> Armand
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 38+ messages in thread


end of thread, other threads:[~2018-04-16 04:08 UTC | newest]

Thread overview: 38+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-01-03 09:16 authentication failure Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-03 09:19 ` Ashesh Vashi <ashesh.vashi@enterprisedb.com>
2014-01-03 10:02   ` Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-03 11:02     ` dinesh kumar <dineshkumar02@gmail.com>
2014-01-03 11:39 ` Chris Curvey <chris@chriscurvey.com>
2014-01-03 11:43   ` Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-03 12:06     ` dinesh kumar <dineshkumar02@gmail.com>
2014-01-03 12:54       ` Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-03 14:27         ` Adrian Klaver <adrian.klaver@gmail.com>
2014-01-03 15:07           ` Tom Lane <tgl@sss.pgh.pa.us>
2014-01-04 05:29             ` Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-04 15:13               ` Adrian Klaver <adrian.klaver@gmail.com>
2014-01-05 04:46                 ` Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-05 15:33                   ` Adrian Klaver <adrian.klaver@gmail.com>
2014-01-05 15:47                     ` Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-05 17:12                       ` Adrian Klaver <adrian.klaver@gmail.com>
2014-01-05 17:42                       ` Tom Lane <tgl@sss.pgh.pa.us>
2014-01-05 17:48                         ` Tom Lane <tgl@sss.pgh.pa.us>
2014-01-06 04:52                           ` Jayadevan M <maymala.jayadevan@gmail.com>
2014-01-06 21:42                             ` Tom Lane <tgl@sss.pgh.pa.us>
2014-01-06 22:04                               ` Rob Sargent <robjsargent@gmail.com>
2014-01-05 20:47                       ` Adrian Klaver <adrian.klaver@gmail.com>
2014-01-05 07:43               ` Sameer Kumar <sameer.kumar@ashnik.com>
2014-01-05 10:45                 ` Jayadevan <maymala.jayadevan@gmail.com>
2014-01-05 13:49                   ` Sameer Kumar <sameer.kumar@ashnik.com>
2018-04-12 13:51 authentication failure armand pirvu <armand.pirvu@gmail.com>
2018-04-12 13:56 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-04-12 14:08   ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-04-12 14:12     ` armand pirvu <armand.pirvu@gmail.com>
2018-04-12 14:15       ` armand pirvu <armand.pirvu@gmail.com>
2018-04-12 14:28         ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-04-12 14:37           ` armand pirvu <armand.pirvu@gmail.com>
2018-04-12 14:48             ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-04-12 14:50               ` armand pirvu <armand.pirvu@gmail.com>
2018-04-12 14:55                 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-04-12 15:07                   ` armand pirvu <armand.pirvu@gmail.com>
2018-04-16 01:22                     ` armand pirvu <armand.pirvu@gmail.com>
2018-04-16 04:08                       ` Adrian Klaver <adrian.klaver@aklaver.com>

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