hanw / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

repo should trap connectivity errors and provide a more useful error message, instead of crashin' #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported by Andrew D. Stadler (Google) <stadler@android.com> on Wed Aug 12 
23:26:53 PDT 2009
Source: JIRA REPO-45

I tried to do repo upload but I forgot to connect the VPN.  The answer was a
many-line stack trace:

$ repo upload --replace .
Traceback (most recent call last):
  File "/Volumes/src/repo/master/.repo/repo/main.py", line 235, in <module>
    _Main(sys.argv[1:])
  File "/Volumes/src/repo/master/.repo/repo/main.py", line 217, in _Main
    repo._Run(argv)
  File "/Volumes/src/repo/master/.repo/repo/main.py", line 123, in _Run
    cmd.Execute(copts, cargs)
  File "/Volumes/src/repo/master/.repo/repo/subcmds/upload.py", line 313, in
Execute
    self._ReplaceBranch(project_list[0], people)
  File "/Volumes/src/repo/master/.repo/repo/subcmds/upload.py", line 262, in
_ReplaceBranch
    self._UploadAndReport([branch], people)
  File "/Volumes/src/repo/master/.repo/repo/subcmds/upload.py", line 268, in
_UploadAndReport
    branch.UploadForReview(people)
  File "/Volumes/src/repo/master/.repo/repo/project.py", line 155, in
UploadForReview
    people)
  File "/Volumes/src/repo/master/.repo/repo/project.py", line 555, in
UploadForReview
    if branch.remote.ReviewProtocol == 'ssh':
  File "/Volumes/src/repo/master/.repo/repo/git_config.py", line 471, in
ReviewProtocol
    info = urlopen(u).read()
  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 "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
urllib2.py", line 1108, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
urllib2.py", line 1075, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (8, 'nodename nor servname provided, or not
known')>

What's odd is that "repo sync ." does the right thing:
$ repo sync .
ssh: Could not resolve hostname android-git.corp.google.com: nodename nor
servname provided, or not known

Original issue reported on code.google.com by code-rev...@gtempaccount.com on 24 Sep 2009 at 9:10

GoogleCodeExporter commented 9 years ago
Comment by Shawn Pearce <sop@google.com> on Sat Aug 22 18:42:32 PDT 2009

Fixed by change I9a45b387e86e48073a2d99bd6d594c1a7d6d99d4

Original comment by code-rev...@gtempaccount.com on 24 Sep 2009 at 9:11

GoogleCodeExporter commented 9 years ago
Update by Shawn Pearce <sop@google.com> on Sat Aug 22 18:42:32 PDT 2009

Fixed in version 1.7.0.

Original comment by code-rev...@gtempaccount.com on 24 Sep 2009 at 9:11