Friday, June 1, 2012

mercurial abort: error: Name or service not known abort: error: Name or service not known abort: error: Name or service not known

Q: when cloning a mercurial repository, if you are getting error

"abort: error: Name or service not known"

Solution:
If you are behind a proxy please make sure /etc/mercurial/hgrc or ~/.hgrc has correct proxy settings.
Mercurial also uses ENV variable http_proxy if set. you can set http_proxy variable in unix using

export http_proxy=proxy.mydomain.in:8080   

where proxy.mydomain.in is the host and 8080 is the port.


This error can also happen if you were behind proxy before and now you are not.

So to unset proxy setting for mercurial make sure in
/etc/mercurial/hgrc
~/.hgrc
you had commented out those lines

also clear the http_proxy ENV

you can use unset command for this

unset http_proxy

1 comment:

  1. using Ubuntu 14.04.2, Mercurial Distributed SCM (version 2.8.2)
    1. We are not using proxy server.
    2. http_proxy not set
    3. Able to download repo from hg clone http://selenic.com/hg mercurial-repo
    4. Not able to download from hg clone http://hg.serpentine.com/tutorial/hello and get the error "abort: error: Name or service not known"

    ReplyDelete