Issue1100

Title abort: error: Connection refused where?
Priority bug Status chatting
Superseder Nosy List mpm, tonfa, yozh
Assigned To Topics http_proto, patch

Created on 2008-04-24.19:44:44 by yozh, last changed 2008-09-20.12:59:32 by tonfa.

Messages
msg6892 (view) Author: tonfa Date: 2008-09-01.14:15:36
keepalive.py mimicks urllib2. urllib2 doesn't put the hostname in the exception.
A possible fix might be:

diff -r 7e5f3480c45b mercurial/httprepo.py
--- a/mercurial/httprepo.py	Fri Aug 29 16:50:11 2008 +0200
+++ b/mercurial/httprepo.py	Mon Sep 01 16:09:35 2008 +0200
@@ -303,6 +303,9 @@
             if data:
                 self.ui.debug(_("sending %s bytes\n") % len(data))
             resp = urllib2.urlopen(request(cu, data, headers))
+        except urllib2.URLError, inst:
+            raise util.Abort(_('failed to connect to %s: %s')
+                             % (self._url, inst.reason[1]))
         except urllib2.HTTPError, inst:
             if inst.code == 401:
                 raise util.Abort(_('authorization failed'))
msg6891 (view) Author: yozh Date: 2008-09-01.13:36:34
Bug report is not about problem, but rather about lack of diagnostics. As far as
I see in sources (keepalive.py) there is still no hostname is thrown exception.
msg6889 (view) Author: tonfa Date: 2008-09-01.13:00:13
Is it still an issue ?
msg5961 (view) Author: yozh Date: 2008-04-24.19:51:00
===
# hg --traceback clone http://hg.openjdk.java.net/jdk7/tl                      
                                 
destination directory: tl
Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 45, in
_runcatch
    return _dispatch(ui, args)
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 364, in
_dispatch
    ret = _runcommand(ui, options, cmd, d)
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 417, in
_runcommand
    return checkargs()
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 373, in
checkargs
    return cmdfunc()
  File "/Library/Python/2.5/site-packages/mercurial/dispatch.py", line 358, in
<lambda>
    d = lambda: func(ui, *args, **cmdoptions)
  File "/Library/Python/2.5/site-packages/mercurial/commands.py", line 532, in clone
    update=not opts['noupdate'])
  File "/Library/Python/2.5/site-packages/mercurial/hg.py", line 230, in clone
    dest_repo.clone(src_repo, heads=revs, stream=stream)
  File "/Library/Python/2.5/site-packages/mercurial/localrepo.py", line 2124, in
clone
    return self.pull(remote, heads)
  File "/Library/Python/2.5/site-packages/mercurial/localrepo.py", line 1470, in
pull
    fetch = self.findincoming(remote, heads=heads, force=force)
  File "/Library/Python/2.5/site-packages/mercurial/localrepo.py", line 1303, in
findincoming
    heads = remote.heads()
  File "/Library/Python/2.5/site-packages/mercurial/httprepo.py", line 366, in heads
    d = self.do_read("heads")
  File "/Library/Python/2.5/site-packages/mercurial/httprepo.py", line 350, in
do_read
    fp = self.do_cmd(cmd, **args)
  File "/Library/Python/2.5/site-packages/mercurial/httprepo.py", line 304, in
do_cmd
    resp = urllib2.urlopen(request(cu, data, headers))
  File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py",
line 121, in urlopen
    return _opener.open(url, data)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py",
line 374, in open
    response = self._open(req, data)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py",
line 392, in _open
    '_open', req)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py",
line 353, in _call_chain
    result = func(*args)
  File "/Library/Python/2.5/site-packages/mercurial/httprepo.py", line 107, in
http_open
    return self.do_open(httpconnection, req)
  File "/Library/Python/2.5/site-packages/mercurial/keepalive.py", line 241, in
do_open
    self._start_transaction(h, req)
  File "/Library/Python/2.5/site-packages/mercurial/keepalive.py", line 315, in
_start_transaction
    raise urllib2.URLError(err)
URLError: <urlopen error (61, 'Connection refused')>
abort: error: Connection refused
===
msg5960 (view) Author: mpm Date: 2008-04-24.19:49:09
Try again with --traceback
msg5959 (view) Author: yozh Date: 2008-04-24.19:44:44
Cannot clone openjdk repository. hg provides not enough information to fix the
problem: it shows it cannot connect somewhere, and I cannot find, where it tries
to connect to. hg version is 1.0, I've got binary package for Mac OS X.

===
# hg clone http://hg.openjdk.java.net/jdk7/tl jdk7/tl                          
                                 
abort: error: Connection refused
zsh: exit 255   hg clone http://hg.openjdk.java.net/jdk7/tl jdk7/tl
# hg --verbose --debug clone http://hg.openjdk.java.net/jdk7/tl jdk7/tl        
                                 
using http://hg.openjdk.java.net/jdk7/tl
sending heads command
abort: error: Connection refused
zsh: exit 255   hg --verbose --debug clone http://hg.openjdk.java.net/jdk7/tl
jdk7/tl
# telnet hg.openjdk.java.net 80                                                
                                 
Trying 70.42.188.38...
Connected to hg.openjdk.java.net.
Escape character is '^]'.
^]
telnet> Connection closed.
# hg --version                                                                 
                                 
Mercurial Distributed SCM (version 1e4ddc9ac9f7)

Copyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
===
History
Date User Action Args
2008-09-20 12:59:32tonfasetpriority: urgent -> bug
nosy: mpm, tonfa, yozh
2008-09-20 12:58:05tonfasettopic: + patch
nosy: mpm, tonfa, yozh
2008-09-01 14:15:37tonfasetnosy: mpm, tonfa, yozh
messages: + msg6892
2008-09-01 13:36:34yozhsetnosy: mpm, tonfa, yozh
messages: + msg6891
2008-09-01 13:00:14tonfasettopic: + http_proto
nosy: + tonfa
messages: + msg6889
2008-04-24 19:51:01yozhsetmessages: + msg5961
2008-04-24 19:49:09mpmsetstatus: unread -> chatting
nosy: + mpm
messages: + msg5960
2008-04-24 19:44:44yozhcreate