我设法使用带有HTTP url的dulwich进行克隆,但是当我尝试使用SSH进行克隆时,我得到了一个"HangupException“。有没有可能dulwich无法访问~/.ssh文件夹中的公钥,因此无法进行SSH连接?是否需要在dulwich配置中添加此功能?下面是我得到的错误:
error: Application connect timed-out.
fatal: Host key verification failed.
Traceback (most recent call last):
File "C:\FAST\pycharmcommunity\2016.3.2\helpers\pydev\pydevd.py", line 1596, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\FAST\pycharmcommunity\2016.3.2\helpers\pydev\pydevd.py", line 974, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:/git/lqr_core/backtests/cash/Statistics/ssh_example.py", line 242, in <module>
example8()
File "C:/git/lqr_core/backtests/cash/Statistics/ssh_example.py", line 230, in example8
porcelain.clone(remote_address_ssh, target, errstream=sys.stdout, outstream=sys.stdout)
File "C:\FAST\anaconda\python27\win64\431\lib\site-packages\dulwich\porcelain.py", line 310, in clone
progress=errstream.write)
File "C:\FAST\anaconda\python27\win64\431\lib\site-packages\dulwich\client.py", line 363, in fetch
progress)
File "C:\FAST\anaconda\python27\win64\431\lib\site-packages\dulwich\client.py", line 729, in fetch_pack
refs, server_capabilities = read_pkt_refs(proto)
File "C:\FAST\anaconda\python27\win64\431\lib\site-packages\dulwich\client.py", line 197, in read_pkt_refs
for pkt in proto.read_pkt_seq():
File "C:\FAST\anaconda\python27\win64\431\lib\site-packages\dulwich\protocol.py", line 254, in read_pkt_seq
pkt = self.read_pkt_line()
File "C:\FAST\anaconda\python27\win64\431\lib\site-packages\dulwich\protocol.py", line 202, in read_pkt_line
raise HangupException()
dulwich.errors.HangupException: The remote server unexpectedly closed the connection.发布于 2018-01-19 05:01:55
从堆栈中,我可以看到它仍然尝试使用http客户端。您应该检查您向porcelain.clone提供了什么source。你可以尝试在client.get_transport_and_path函数中使用哪种客户端。
发布于 2018-01-20 06:19:24
我最终通过使用这里提到的方法解决了这个问题:http://poquitopicante.blogspot.co.uk/2012/09/dulwich-porcelain.html
dulwich.client中的ssh供应商应该由具有ssh密钥对的地址的供应商继承,以启用连接。
https://stackoverflow.com/questions/48329727
复制相似问题