Forums

ssh: connect to host bitbucket.org port 22: Connection refused

was working but today, I am getting ssh: connect to host bitbucket.org port 22: Connection refused

when I try any remote op with hg. i.e. hg sum --remote, hg pull --up

14:24 ~$ ping -c 5 bitbucket.org
PING bitbucket.org (104.192.143.2) 56(84) bytes of data.
From ip-10-203-221-184.ec2.internal (10.203.221.184) icmp_seq=1 Destination Port Unreachable
From ip-10-203-221-184.ec2.internal (10.203.221.184) icmp_seq=1 Destination Port Unreachable
From ip-10-203-221-184.ec2.internal (10.203.221.184) icmp_seq=1 Destination Port Unreachable
From ip-10-203-221-184.ec2.internal (10.203.221.184) icmp_seq=1 Destination Port Unreachable
From ip-10-203-221-184.ec2.internal (10.203.221.184) icmp_seq=1 Destination Port Unreachable
--- bitbucket.org ping statistics ---
0 packets transmitted, 0 received, +5 errors
14:24 ~$ dig bitbucket.org                                                                                                                              
; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> bitbucket.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42455
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;bitbucket.org.                 IN      A
;; ANSWER SECTION:
bitbucket.org.          46      IN      A       104.192.143.2
bitbucket.org.          46      IN      A       104.192.143.3
bitbucket.org.          46      IN      A       104.192.143.1
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Dec 28 14:26:20 UTC 2015
;; MSG SIZE  rcvd: 90

That's strange, we've specifically whitelisted the bitbucket IP addresses. Will look into it...

Is that because he's trying to open an ssh connection, and that's not going through the proxy?

Right, the proxy only applies to HTTP/S connections, but we have a separate system for whitelisting IP addresses, and that should have the bitbucket IPs on it (as well as github, gmail, and a few others) to allow direct socket connections for other protocols...

OK, I'm not quite sure why those IP addresses weren't on there, but I've added them... Give it a try now?

Thank you. That did the trick.

Have a Happy New Year.

:) you too!