Thread: [GENERAL] could not translate host name

[GENERAL] could not translate host name

From
Tom Ekberg
Date:
I'm running postgres 9.6.2 (also happened on 9.3.14) and have a cron job that runs hourly that runs a program that does
mostlypostgres SELECTs on a different host. Occasionally I get email (not hourly) from the cron daemon that contains a
stacktrace that ends with this: 

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db3.labmed.uw.edu" to
address:Name or service not known 

It has happened about 9 times so far this month. I have one of our network people look into this but there is no real
answer.I could use the IP address but I'd rather not. This problem only happens on one host. I moved the data from db2
todb3. I was getting similar emails regarding db2 which runs the older postgres. 

Any ideas on how to proceed?

Tom Ekberg
Senior Computer Specialist, Lab Medicine
University of Washington Medical Center
1959 NE Pacific St, MS 357110
Seattle WA 98195
work: (206) 598-8544
email: tekberg@uw.edu




Re: [GENERAL] could not translate host name

From
Steve Atkins
Date:
> On Feb 24, 2017, at 1:37 PM, Tom Ekberg <tekberg@uw.edu> wrote:
>
> I'm running postgres 9.6.2 (also happened on 9.3.14) and have a cron job that runs hourly that runs a program that
doesmostly postgres SELECTs on a different host. Occasionally I get email (not hourly) from the cron daemon that
containsa stack trace that ends with this: 
>
> sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db3.labmed.uw.edu" to
address:Name or service not known 
>
> It has happened about 9 times so far this month. I have one of our network people look into this but there is no real
answer.I could use the IP address but I'd rather not. This problem only happens on one host. I moved the data from db2
todb3. I was getting similar emails regarding db2 which runs the older postgres. 
>
> Any ideas on how to proceed?

It looks like a DNS issue. That hostname authoritatively doesn't exist, according to any of UW's nameservers.

If it works sometimes then you have some sort of internal name resolution hack, and it's not reliable.

Cheers,
  Steve

>
> Tom Ekberg
> Senior Computer Specialist, Lab Medicine
> University of Washington Medical Center
> 1959 NE Pacific St, MS 357110
> Seattle WA 98195
> work: (206) 598-8544
> email: tekberg@uw.edu
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general



Re: [GENERAL] could not translate host name

From
John R Pierce
Date:
On 2/24/2017 1:37 PM, Tom Ekberg wrote:
> I'm running postgres 9.6.2 (also happened on 9.3.14) and have a cron job that runs hourly that runs a program that
doesmostly postgres SELECTs on a different host. Occasionally I get email (not hourly) from the cron daemon that
containsa stack trace that ends with this: 
>
> sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db3.labmed.uw.edu" to
address:Name or service not known 
>
> It has happened about 9 times so far this month. I have one of our network people look into this but there is no real
answer.I could use the IP address but I'd rather not. This problem only happens on one host. I moved the data from db2
todb3. I was getting similar emails regarding db2 which runs the older postgres. 

what OS is this?     what DNS servers are configured on that OS (in most
all unix-flavored OS's, this is in /etc/resolv.conf  ... on windows its
in a network properties dialog buried 9 deep).

make sure *ALL* the listed name servers can resolve this internal
hostname, by querying them each directly.   do NOT mix private and
public name servers, as the name resolver will only query one for a
given query and only try another if the first server doesn't reply at
all.    if the first server replies ' host not known', that's taken as
the answer.

Unix systems generally always query the first server listed in
resolv.conf, and only queries the 2nd if the first isn't running at
all.   Windows, however, once it decides the first server isn't
responding will continue to use the next one that does reply.



--
john r pierce, recycling bits in santa cruz



Re: [GENERAL] could not translate host name

From
Adrian Klaver
Date:
On 02/24/2017 01:37 PM, Tom Ekberg wrote:
> I'm running postgres 9.6.2 (also happened on 9.3.14) and have a cron job that runs hourly that runs a program that
doesmostly postgres SELECTs on a different host. Occasionally I get email (not hourly) from the cron daemon that
containsa stack trace that ends with this: 
>
> sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db3.labmed.uw.edu" to
address:Name or service not known 

As Steve said this is falling over before it ever gets to the Postgres
server.

>
> It has happened about 9 times so far this month. I have one of our network people
>look into this but there is no real answer. I could use the IP address but I'd rather not.
> This problem only happens on one host. I moved the data from db2 to db3.
> I was getting similar emails regarding db2 which runs the older postgres.

The above has me confused. Earlier you mention db3.labmed.uw.edu which
is a host name. You say the problem is only on one host and then mention
it also happened on db2. So db2 as in db2.labmed.uw.edu which would
imply more then one host is affected or db2 as a second instance of
Postgres on db3.labmed.uw.edu?

Also what was the network people's 'no real answer'?

If there was no answer, what is the gist of the network setup between
the machine that runs the cron jobs and the machine(s) that run the
database servers?

>
> Any ideas on how to proceed?
>
> Tom Ekberg
> Senior Computer Specialist, Lab Medicine
> University of Washington Medical Center
> 1959 NE Pacific St, MS 357110
> Seattle WA 98195
> work: (206) 598-8544
> email: tekberg@uw.edu
>
>
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com