Re: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-26 Thread Ron Johnson
On Sun, Nov 26, 2023 at 6:51 AM Peter J. Holzer  wrote:
[snip]

> > But is not explanatory.  I want to see host names in the log file when
> > possible, not just IP addresses.
>
> So now that you have IP addresses again, are there any for which a
> reverse lookup doesn't work?
>

I've gone through /etc/hosts, and there are some mismatches between it and
DNS.  Maybe that's the cause of the errors... maybe not.  


Re: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-26 Thread Peter J. Holzer
On 2023-11-24 16:39:57 -0500, Ron Johnson wrote:
> On Fri, Nov 24, 2023 at 4:26 PM David G. Johnston 
> wrote:
> 
> On Friday, November 24, 2023, Ron Johnson  wrote:
> 
> 
> The second "way" sounds interesting, but what is it filled with?

With "???"

(which isn't very helpful. I would have hoped it's filled in with a
representation of the IP address)



> What does it matter?  It’s an internal detail that apparently gets exposed
> as [unknown] appearing in your log file where the client ip address would
> normally be.
> 
> 
> Because I'd hope that the log file would tell me the errant host name.  

The error message says that the host name could not be determined
because of a DNS error. So obviously it can't tell you the host name.
It could tell you the IP address, though.


> I added "log_hostname = on" to postgresql.conf earlier in the day. 
> When I commented that out, the errors stopped happening.
> 
> 
> This makes sense.
> 
> 
> But is not explanatory.  I want to see host names in the log file when
> possible, not just IP addresses.

So now that you have IP addresses again, are there any for which a
reverse lookup doesn't work?

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature


Re: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-24 Thread Ron Johnson
On Fri, Nov 24, 2023 at 4:26 PM David G. Johnston <
david.g.johns...@gmail.com> wrote:

> On Friday, November 24, 2023, Ron Johnson  wrote:
>>
>>
>> The second "way" sounds interesting, but what is it filled with?
>>
>
> What does it matter?  It’s an internal detail that apparently gets exposed
> as [unknown] appearing in your log file where the client ip address would
> normally be.
>

Because I'd hope that the log file would tell me the errant host name.


>
>> I added "log_hostname = on" to postgresql.conf earlier in the day.  When
>> I commented that out, the errors stopped happening.
>>
>
> This makes sense.
>

But is not explanatory.  I want to see host names in the log file when
possible, not just IP addresses.

In pg_hba.conf. all application servers are either IP addresses, or names
that are explicitly defined in /etc/hosts.


Re: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-24 Thread David G. Johnston
On Friday, November 24, 2023, Ron Johnson  wrote:
>
>
> The second "way" sounds interesting, but what is it filled with?
>

What does it matter?  It’s an internal detail that apparently gets exposed
as [unknown] appearing in your log file where the client ip address would
normally be.


>
> I added "log_hostname = on" to postgresql.conf earlier in the day.  When I
> commented that out, the errors stopped happening.
>

This makes sense.

David J.


Re: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-24 Thread Ron Johnson
On Fri, Nov 24, 2023 at 3:46 PM Adrian Klaver 
wrote:

> On 11/24/23 12:30, Ron Johnson wrote:
> > PG 9.6.24 (Yes, I know it's EOL.)
> >
> > I'm seeing lots of these in the postgresql log file:
> > 2023-11-24 15:09:02.224 EST [unknown]   [unknown]
> > 18163   [unknown]   01000   WARNING:  01000:
> > pg_getnameinfo_all() failed: Temporary failure in name resolution
> > 2023-11-24 15:09:02.224 EST [unknown]   [unknown]
> > 18163   [unknown]   01000   LOCATION:  BackendInitialize,
> > postmaster.c:4220
> >
> > What name is postgresql failing to resolve?
>
>  From ~/src/common/ip.c
>
> /*
>   *  pg_getnameinfo_all - get name info for Unix, IPv4 and IPv6 sockets
>   *
>   * The API of this routine differs from the standard getnameinfo()
> definition
>   * in two ways: first, the addr parameter is declared as sockaddr_storage
>   * rather than struct sockaddr, and second, the node and service fields
> are
>   * guaranteed to be filled with something even on failure return.
>   */
>
>
The second "way" sounds interesting, but what is it filled with?

I added "log_hostname = on" to postgresql.conf earlier in the day.  When I
commented that out, the errors stopped happening.


Re: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-24 Thread Adrian Klaver

On 11/24/23 12:30, Ron Johnson wrote:

PG 9.6.24 (Yes, I know it's EOL.)

I'm seeing lots of these in the postgresql log file:
2023-11-24 15:09:02.224 EST             [unknown]       [unknown]   
18163           [unknown]       01000   WARNING:  01000: 
pg_getnameinfo_all() failed: Temporary failure in name resolution
2023-11-24 15:09:02.224 EST             [unknown]       [unknown]   
18163           [unknown]       01000   LOCATION:  BackendInitialize, 
postmaster.c:4220


What name is postgresql failing to resolve?


From ~/src/common/ip.c

/*
 *  pg_getnameinfo_all - get name info for Unix, IPv4 and IPv6 sockets
 *
 * The API of this routine differs from the standard getnameinfo() 
definition

 * in two ways: first, the addr parameter is declared as sockaddr_storage
 * rather than struct sockaddr, and second, the node and service fields are
 * guaranteed to be filled with something even on failure return.
 */


--
Adrian Klaver
adrian.kla...@aklaver.com





pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-24 Thread Ron Johnson
PG 9.6.24 (Yes, I know it's EOL.)

I'm seeing lots of these in the postgresql log file:
2023-11-24 15:09:02.224 EST [unknown]   [unknown]
18163   [unknown]   01000   WARNING:  01000:
pg_getnameinfo_all() failed: Temporary failure in name resolution
2023-11-24 15:09:02.224 EST [unknown]   [unknown]
18163   [unknown]   01000   LOCATION:  BackendInitialize,
postmaster.c:4220

What name is postgresql failing to resolve?


Re: Flood Warning message : user=[unknown],db=[unknown],host= WARNING: pg_getnameinfo_all() failed: Temporary failure in name resolution

2019-06-06 Thread Perumal Raj
Hi All,

We are using the following format for LDAP authentication,

hostall all 0.0.0.0/0   ldap ldapserver=ldap.xxx.com
ldapport=389
ldaptls=1 ldapbasedn="dc=domain,dc=com"
ldapbinddn="cn=auth_user,dc=domain,dc=com"
ldapbindpasswd=encrypted_password ldapsearchattribute=uid

1. It successfully retrieved user information when we do ldapsearch "ldapsearch
-H "ldaps://ldap..com" -W -D "cn=auth_user,ou=people,dc=domain,dc=com"
-b "dc=domain,dc=com" "uid=ldap_user"

2. Same LDAP server is authenticating while ssh / sudo successfully.

But issue is while connecting DB

-bash-4.1$ psql -h dbhost.domain.com -Atc "select 'success'"
-Uldap_user postgres

Password for user ldap_user:

psql: FATAL:  LDAP authentication failed for user "ldap_user"

-bash-4.1$



Is there any way to validate ldap_user password using ldapsearch ?
Or is there any specific format in pg_hba.conf to configure LDAP.

Regards,
Raj

On Wed, Jun 5, 2019 at 4:56 PM Perumal Raj  wrote:

> Thanks Steve for the response, Yes we had DNS server change.
> But conf file updated with right DNS server and its resolving when i
> crosscheck with nslookup against clinet_addr
>
> By the way , What is the right syntax for LDAP configuration ,
>
> I am using the one below, and getting LDAP authentication error though i
> was able to login to server with same password.
>
> hostall all 0.0.0.0/0   ldap ldapserver=ldap.xxx.com
> ldapport=389 ldaptls=1 ldapbasedn="dc=domain,dc=com"
> ldapbinddn="cn=auth_user,dc=domain,dc=com"
> ldapbindpasswd=encrypted_password ldapsearchattribute=uid
>
> Version :9..2
>
> Regards,
> Raju
>
>
> On Wed, Jun 5, 2019 at 11:08 AM Steve Crawford <
> scrawf...@pinpointresearch.com> wrote:
>
>> On Wed, Jun 5, 2019 at 10:13 AM Perumal Raj  wrote:
>>
>>> Hi All,
>>>
>>> We have recently noticed in our development environment pg_log with
>>> flooded message.
>>>
>>> [64459]: [1-1] user=[unknown],db=[unknown],host= WARNING:
>>>  pg_getnameinfo_all() failed: Temporary failure in name resolution...
>>>
>>
>> First thing I'd check is that DNS is functioning correctly (including
>> local resolution settings or caching name resolvers).
>>
>> Cheers,
>> Steve
>>
>>
>


Re: Flood Warning message : user=[unknown],db=[unknown],host= WARNING: pg_getnameinfo_all() failed: Temporary failure in name resolution

2019-06-05 Thread Perumal Raj
Thanks Steve for the response, Yes we had DNS server change.
But conf file updated with right DNS server and its resolving when i
crosscheck with nslookup against clinet_addr

By the way , What is the right syntax for LDAP configuration ,

I am using the one below, and getting LDAP authentication error though i
was able to login to server with same password.

hostall all 0.0.0.0/0   ldap ldapserver=ldap.xxx.com
ldapport=389 ldaptls=1 ldapbasedn="dc=domain,dc=com"
ldapbinddn="cn=auth_user,dc=domain,dc=com"
ldapbindpasswd=encrypted_password ldapsearchattribute=uid

Version :9..2

Regards,
Raju


On Wed, Jun 5, 2019 at 11:08 AM Steve Crawford <
scrawf...@pinpointresearch.com> wrote:

> On Wed, Jun 5, 2019 at 10:13 AM Perumal Raj  wrote:
>
>> Hi All,
>>
>> We have recently noticed in our development environment pg_log with
>> flooded message.
>>
>> [64459]: [1-1] user=[unknown],db=[unknown],host= WARNING:
>>  pg_getnameinfo_all() failed: Temporary failure in name resolution...
>>
>
> First thing I'd check is that DNS is functioning correctly (including
> local resolution settings or caching name resolvers).
>
> Cheers,
> Steve
>
>


Re: Flood Warning message : user=[unknown],db=[unknown],host= WARNING: pg_getnameinfo_all() failed: Temporary failure in name resolution

2019-06-05 Thread bricklen
On Wed, Jun 5, 2019 at 11:08 AM Steve Crawford <
scrawf...@pinpointresearch.com> wrote:

> On Wed, Jun 5, 2019 at 10:13 AM Perumal Raj  wrote:
>
>>
>> [64459]: [1-1] user=[unknown],db=[unknown],host= WARNING:
>>  pg_getnameinfo_all() failed: Temporary failure in name resolution...
>>
>
> First thing I'd check is that DNS is functioning correctly (including
> local resolution settings or caching name resolvers).
>

In addition to what Steve mentioned, I've a vague recollection from running
into this several years ago that this is triggered by having "log_hostname"
enabled in your postgresql.conf.


Re: Flood Warning message : user=[unknown],db=[unknown],host= WARNING: pg_getnameinfo_all() failed: Temporary failure in name resolution

2019-06-05 Thread Steve Crawford
On Wed, Jun 5, 2019 at 10:13 AM Perumal Raj  wrote:

> Hi All,
>
> We have recently noticed in our development environment pg_log with
> flooded message.
>
> [64459]: [1-1] user=[unknown],db=[unknown],host= WARNING:
>  pg_getnameinfo_all() failed: Temporary failure in name resolution...
>

First thing I'd check is that DNS is functioning correctly (including local
resolution settings or caching name resolvers).

Cheers,
Steve


Flood Warning message : user=[unknown],db=[unknown],host= WARNING: pg_getnameinfo_all() failed: Temporary failure in name resolution

2019-06-05 Thread Perumal Raj
Hi All,

We have recently noticed in our development environment pg_log with flooded
message.

[64459]: [1-1] user=[unknown],db=[unknown],host= WARNING:
 pg_getnameinfo_all() failed: Temporary failure in name resolution
[64463]: [1-1] user=[unknown],db=[unknown],host= WARNING:
 pg_getnameinfo_all() failed: Temporary failure in name resolution
[64464]: [1-1] user=[unknown],db=[unknown],host= WARNING:
 pg_getnameinfo_all() failed: Temporary failure in name resolution
[64548]: [1-1] user=[unknown],db=[unknown],host= WARNING:
 pg_getnameinfo_all() failed: Temporary failure in name resolution
[64551]: [1-1] user=[unknown],db=[unknown],host= WARNING:
 pg_getnameinfo_all() failed: Temporary failure in name resolution
[64553]: [1-1] user=[unknown],db=[unknown],host= WARNING:
 pg_getnameinfo_all() failed: Temporary failure in name resolution

Not sure , How to address this message ,

Much appreciated if some one give light on this.

Version . : 9.2.23

Regards,
Raj