Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have an app on Heroku which stores information in a Postgres database (Heroku Postgres :: Purple Crane). I often connect to this database pythonicly via python psycopg2. Lately, my psycopg connection gives an error:

OperationalError: could not translate host name "ec2-**-**-***-***.compute-1.amazonaws.com" to address: Name or service not known

Things I've done & know:

  • verified the login credentials
  • can connect and execute SQL queries via pg_admin3
  • the app is up an running. no problems

I'm at a loss, so any advice would be appreciated!

share|improve this question
    
UPDATE: I'm able to connect to my Postgres DB, using psycopg2, from another computer. Also, not able to ping "google.com", instance from the server, where psycopy2 is not working. So it seems the problem here is really about access to the internet and nothing inherit about my DB setup/configuration or interaction with psycopg2. –  Arvind Feb 15 at 1:55
1  
"could not translate host name <host> to address: Name or service not known" sounds like a DNS issue. Your update about not being able to ping google.com reinforces that suspicion. –  Lukas Graf Feb 16 at 11:58
    
Also see this question and the answer to it. You might have to contact Heroku support about that. –  Lukas Graf Feb 16 at 12:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.