heroku / legacy-cli

Heroku CLI
https://cli.heroku.com
MIT License
1.37k stars 382 forks source link

Unable to run command "heroku run db:migrate" #1980

Open ghost opened 8 years ago

ghost commented 8 years ago

I'm behind my college proxy which requires username and password. I'm able to push my Rails code to heroku master. But after that, commands like heroku run db:migrate/heroku run rails console are not working, getting EAI_AGAIN: getaddrinfo EAI_AGAIN rendezvous.runtime.heroku.com:5000 error repeatedly. I've exported my proxy variables. I tried using heroku run:detached, but no progress.

ransombriggs commented 8 years ago

@ajajeetaj what kind of proxy are you behind? heroku run does not do an HTTP call, it instead connects using TCP over port 5000 and uses its own protocol, so if you only have to use the proxy for HTTP / HTTPS, the proxy should not be interfering. It also appears that the real problem is DNS resolution. What is the output of the following command? (works in Mac / Linux, let me know if you use windows)

dig rendezvous.runtime.heroku.com
ghost commented 8 years ago

My College uses squid proxy to restrict internet usage. When I ran nmap command sudo nmap -p 1-65000 202.141.80.22 to see my open ports, then result was

Nmap scan report for tsangpo.iitg.ernet.in (202.141.80.22)
Host is up (0.00023s latency).
Not shown: 64997 filtered ports
PORT     STATE  SERVICE
80/tcp   open   http
443/tcp  closed https
3128/tcp open   squid-http

The output of the command dig rendezvous.runtime.heroku.com is

; <<>> DiG 9.10.3-P4-Ubuntu <<>> rendezvous.runtime.heroku.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 42628
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;rendezvous.runtime.heroku.com. IN  A

;; Query time: 2 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Tue Jul 19 12:21:03 IST 2016
;; MSG SIZE  rcvd: 58

And, What does it mean by problem in DNS resolution? I get DNS resolution problem when I try to connect to my AWS machine through ssh from my college proxy.

ransombriggs commented 8 years ago

@ajajeetaj From the output of the dig command it looks like it is not able to resolve rendezvous.runtime.heroku.com. For comparison, here is my ANSWER SECTION for the same command. It appears that you are using localhost for DNS resolution, so something in your DNS daemon configuration will need to be fixed. Helping you configure this may be beyond the scope of my abilities depending on your setup.

;; ANSWER SECTION:
rendezvous.runtime.heroku.com. 180 IN   CNAME   ec2-50-19-103-36.compute-1.amazonaws.com.
ec2-50-19-103-36.compute-1.amazonaws.com. 21330 IN A 50.19.103.36
funwhilelost commented 8 years ago

A quick suggestion: switch to OpenDNS. Should work through your college proxy but you might not be able to resolve on-campus addresses as easily.

simonneutert commented 7 years ago

please try heroku run rake db:migrate

If you are using rake in your rails app.