Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

porcelain.clone error #401

Closed
hanbeibei opened this issue Dec 25, 2015 · 11 comments
Closed

porcelain.clone error #401

hanbeibei opened this issue Dec 25, 2015 · 11 comments

Comments

@hanbeibei
Copy link

Hello,

my link is http://ok231456@kkk.kkkt.net/git/~ok231456/IPC.git, in this form(sorry for modify internal info) if I use porcelain.clone(my_url, repo_name), it will raise an error: urllib.error.URLError: <urlopen error [Errno 11003] getaddrinfo failed>

but it is fined if I use git clone command

@jelmer
Copy link
Owner

jelmer commented Dec 25, 2015

Can you be more specific? I also get a URLError for that URL, but because the host does not resolve (which is expected).

@hanbeibei
Copy link
Author

I was trying to use dulwich on my internal stash/gitblit environment, and get that error,

I used to fork a repo to my own repo, and got that style link

@jelmer
Copy link
Owner

jelmer commented Dec 27, 2015

can please paste the full error message? This is a perfectly reasonable error if the host name can't be resolved, for example.

@hanbeibei
Copy link
Author

the url is like this: http://ok231456@kkk.kkkt.net/git/~ok231456/IPC.git

just take the ok231456 and kkk.kkkt.net as internal user id and internal url. I will post the whole error message tomorrow, thanks!

@jelmer
Copy link
Owner

jelmer commented Dec 27, 2015

FTR, that fails here too and is working as intended:

morgaine:/tmp% ~/src/dulwich/bin/dulwich clone http://ok231456@kkk.kkkt.net/git/~ok231456/IPC.git /tmp/ipc
Traceback (most recent call last):
File "/home/jelmer/src/dulwich/bin/dulwich", line 421, in
commandscmd
File "/home/jelmer/src/dulwich/bin/dulwich", line 181, in cmd_clone
porcelain.clone(source, target, bare=("--bare" in opts))
File "/usr/lib/python2.7/dist-packages/dulwich/porcelain.py", line 253, in clone
progress=errstream.write)
File "/usr/lib/python2.7/dist-packages/dulwich/client.py", line 242, in fetch
progress)
File "/usr/lib/python2.7/dist-packages/dulwich/client.py", line 1064, in fetch_pack
b"git-upload-pack", url)
File "/usr/lib/python2.7/dist-packages/dulwich/client.py", line 978, in _discover_references
resp = self._http_request(url, headers)
File "/usr/lib/python2.7/dist-packages/dulwich/client.py", line 963, in _http_request
resp = self.opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1227, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>

@hanbeibei
Copy link
Author

please refer to my error message:

Traceback (most recent call last):
File "c:\Anaconda3\lib\site-packages\dulwich-0.12.1-py3.4.egg\dulwich\client.py", line 9
68, in _http_request
resp = self.opener.open(req)
File "c:\Anaconda3\lib\urllib\request.py", line 461, in open
response = meth(req, response)
File "c:\Anaconda3\lib\urllib\request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "c:\Anaconda3\lib\urllib\request.py", line 499, in error
return self._call_chain(_args)
File "c:\Anaconda3\lib\urllib\request.py", line 433, in _call_chain
result = func(_args)
File "c:\Anaconda3\lib\urllib\request.py", line 579, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\Anaconda3\lib\site-packages\dulwich-0.12.1-py3.4.egg\dulwich\client.py", line 2
49, in fetch
progress)
File "c:\Anaconda3\lib\site-packages\dulwich-0.12.1-py3.4.egg\dulwich\client.py", line 1
069, in fetch_pack
b"git-upload-pack", url)
File "c:\Anaconda3\lib\site-packages\dulwich-0.12.1-py3.4.egg\dulwich\client.py", line 9
83, in _discover_references
resp = self._http_request(url, headers)
File "c:\Anaconda3\lib\site-packages\dulwich-0.12.1-py3.4.egg\dulwich\client.py", line 9
73, in _http_request
raise GitProtocolError("unexpected http response %d" % e.code)
dulwich.errors.GitProtocolError: unexpected http response 400

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "c:\Anaconda3\lib\site-packages\dulwich-0.12.1-py3.4.egg\dulwich\porcelain.py", lin
e 258, in clone
progress=errstream.write)
File "c:\Anaconda3\lib\site-packages\dulwich-0.12.1-py3.4.egg\dulwich\client.py", line 2
51, in fetch
abort()
UnboundLocalError: local variable 'abort' referenced before assignment

@jelmer
Copy link
Owner

jelmer commented Dec 28, 2015

Ah, interesting. IIUC that means this is working as intended then?

@jelmer jelmer closed this as completed Dec 28, 2015
@hanbeibei
Copy link
Author

still not yet, I will try to argue with SA to enable ssh access key function

@hanbeibei
Copy link
Author

thanks for your attention.

@jelmer
Copy link
Owner

jelmer commented Feb 24, 2016

On Wed, Feb 24, 2016 at 09:42:12AM -0800, Christian Tismer wrote:

@jelmer I just got a similar error.

porcelain.clone('git://github.com/sigmavirus24/github3.py.git', 'cloned_repo', True)
---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-21-a87448bb4fdc> in <module>()
----> 1 porcelain.clone('git://github.com/sigmavirus24/github3.py.git', 'cloned_repo', True)

/Users/tismer/src/ansi-test/lib/python2.7/site-packages/dulwich/porcelain.pyc in clone(source, target, bare, checkout, errstream, outstream)
    256         remote_refs = client.fetch(host_path, r,
    257             determine_wants=r.object_store.determine_wants_all,
--> 258             progress=errstream.write)
    259         r[b"HEAD"] = remote_refs[b"HEAD"]
    260         if checkout:

/Users/tismer/src/ansi-test/lib/python2.7/site-packages/dulwich/client.pyc in fetch(self, path, target, determine_wants, progress)
    249                 progress)
    250         except:
--> 251             abort()
    252             raise
    253         else:

UnboundLocalError: local variable 'abort' referenced before assignment

An UnboundLocalError is by definition never intended and always a serious bug.
Agreed, but that should already be fixed.

Can you reproduce the UnboundLocalError with current master?

Cheers,

Jelmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants