Will do. Thanks again.
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Posts made by mstonespeedy
-
RE: git clone ssh failing
Thanks for your additional help, @JonB.
I've been trying this URL:
'ssh://user@git.myCompany.com/git/MyRepository.git'
I did some trial and error with your test script, since can_read() was always false. I finally got it to work with an extra slash after the host name, like this:
'ssh://user@git.myCompany.com//git/MyRepository.git'
I've never had to do this with the regular git client. Do you know if there is a reason for requiring the extra slash? If not, I can report it as a bug.
Relieved to finally have it working, though. Thanks again for your patience and help!
-
RE: git clone ssh failing
stash: <class 'dulwich.errors.HangupException'>: The remote server unexpectedly closed the connection.
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 490, in exec_py_file
execfile(file_path, namespace, namespace)
File "test_dulwich_ssh.py", line 60, in <module>
fetch_one()
File "test_dulwich_ssh.py", line 58, in fetch_one
progress=sys.stdout.write)
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/client.py", line 251, in fetch
progress)
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/client.py", line 559, in fetch_pack
refs, server_capabilities = read_pkt_refs(proto)
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/client.py", line 168, in read_pkt_refs
for pkt in proto.read_pkt_seq():
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/protocol.py", line 201, in read_pkt_seq
pkt = self.read_pkt_line()
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/protocol.py", line 152, in read_pkt_line
raise HangupException()
HangupException: The remote server unexpectedly closed the connection. -
RE: git clone ssh failing
When I run the script with your source, it creates a paramikolog.txt file just fine. But when I use my source, apparently there's nothing to write because the file is never created. And no other output on the command line. All I get is a dulwichtests/.git folder with initialized files and folders.
-
RE: git clone ssh failing
Thanks for your continued help, @JonB.
With your script, I don't get a paramikolog.txt at all. Just the same HangupException.
Our company server reports:
Ubuntu 12.04.5 LTS (GNU/Linux 3.13.0-100-generic x86_64)
git version 1.7.9.5I don't believe we use submodules. How do I tell?
-
RE: git clone ssh failing
Thanks, @JonB. Sorry, I thought I had already done that. OK, now that I have that back in there, I'm getting the same dulwich.errors.HangupException as I started with.
Any other ideas for figuring out what's happening?
-
RE: git clone ssh failing
@JonB, I get the same TypeError with Python 2 or 3. However, if I run the Python 2 script from the command line, I get the following:
stash: <type 'exceptions.OSError'>: [Errno 1] Operation not permitted
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 490, in exec_py_file
execfile(file_path, namespace, namespace)
File "test.py", line 6, in <module>
dulwich.porcelain.clone('ssh://user@git.myCompany.com/MyRepository.git')
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/porcelain.py", line 258, in clone
progress=errstream.write)
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/client.py", line 251, in fetch
def abort():
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/client.py", line 557, in fetch_packFile "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/client.py", line 921, in _connect
raise TypeError(path)
File "/private/var/mobile/Containers/Shared/AppGroup/E35AE39A-48FB-44A1-BC2A-EE57EF6EAA4D/Pythonista3/Documents/site-packages/dulwich/client.py", line 877, in run_command
if port is not None:
File "/var/containers/Bundle/Application/297756CD-F73E-44E6-AB25-42E99062FE48/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/subprocess.py", line 711, in init
errread, errwrite)
File "/var/containers/Bundle/Application/297756CD-F73E-44E6-AB25-42E99062FE48/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/subprocess.py", line 1205, in _execute_child
self.pid = os.fork()
OSError: [Errno 1] Operation not permitted -
RE: git clone ssh failing
Thanks, @abcabc. Yes, I have Working Copy successfully cloning as I mentioned earlier. However, I'd like to see if I can get dulwich working properly, since it would be much more convenient for me.
Jelmer says that the TypeError is a known issue with Python 3, and that it is in the bug tracker. So, I may be stuck for now.
-
RE: git clone ssh failing
Thanks for the tips, @JonB.
Has the subprocess issue been reported? I don't have a beta version of anything I'm using, as far as I know. Which files should I look for?
I tried using dulwich.porcelain.clone('ssh://user@git.myCompany.com/MyRepository.git'). I get the following error. Any ideas?
TypeError: MyRepository.git
-
RE: git clone ssh failing
Thanks for the additional detail, @JonB.
I did indeed need that second .ssh folder to get back where I was with Pythonista 2. And I did find the dulwich folder in stash/lib. Oh, and git.py has the ParamikoSSHVendor line. However, I'm back to the same error as before ("The remote server unexpectedly closed the connection.").
I'll try to look into the subprocess issue later today. Is Jelmer aware of it?
-
RE: git clone ssh failing
That's what I thought, too. But dulwich is nowhere to be found, in any of the 3 site-packages folders. I've restarted Pythonista and tried git clone ssh multiple times. I get the message:
stash: <class 'paramiko.ssh_exception.SSHException'>: No authentication methods available
-
RE: git clone ssh failing
I just realized that I have been working with Pythonista 2, rather than Pythonista 3. I wondered if that made a difference. So I deleted Pythonista 2 and installed Pythonista 3. The first time I did a git clone ssh, it installed dulwich for me. But as I was testing straight ssh connections, somehow dulwich was deleted. Subsequent tries of git clone ssh won't reinstall dulwich. How do I install the appropriate version of dulwich now?
-
RE: git clone ssh failing
Quick update. I'm not sure when I'll have time to debug dulwich, but I wanted to at least log where I got to.
I can clone from github.
I can also clone from our company Git repository using the Working Copy iOS app with its ssh support.
-
RE: git clone ssh failing
Makes sense, thanks. I'll do some more digging when I get a chance.
-
RE: git clone ssh failing
I haven't tried github, but I can clone repos from our server using other clients over ssh. I'm pretty certain it's a problem with dulwich, since the server session close message is logged well after dulwich gives up. I'll log an issue on the dulwich page. Thanks again for your help!
-
RE: git clone ssh failing
Thanks again for your help, @JonB. It sounds like you're confident that the problem is on the server rather than in dulwich. I'll see if I can get any other information from our server administrator.
-
RE: git clone ssh failing
Thanks again for your help, @JonB.
Yes, I'm able to connect to the server via ssh and run commands there. That's why I'm assuming it's a dulwich problem.
I have verified that I have paramiko 1.16.0.
No, https doesn't work either, even just for the initial clone.
Executing your sample commands gives me the same error as before ("The remote server unexpectedly closed the connection.").
Is there a way to turn on debugging messages in dulwich?
-
RE: git clone ssh failing
Thanks for your help, @JonB.
I got this far following your very helpful post at https://forum.omz-software.com/topic/1848/working-copy-integration-sidebar/42. So, I used the following to generate the keys:
ssh-keygen -t rsa -b 2048
And I saw the hangup issue @SimCityWok was having, so I've done multiple retries with no success. Each time I try, it fails within 6 seconds. I've tried https, but it gives the same error.
I've now deleted dulwich and allowed git to reinstall it, but there's no difference in behavior.
I'm successfully connecting to the server via ssh, so that part of it is working properly. Wouldn't the problem be in dulwich, then?
-
git clone ssh failing
Hey, everyone. I'm new to Pythonista, and anxious to see what it can do!
I'm just about ready to grab some scripts from our company git repository to play with. I am successfully connecting to our company Git server through ssh. However, about 6 seconds after I try a git clone ssh://..., I get the error:
stash: <class 'dulwich.errors.HangupException'>: The remote server unexpectedly closed the connection.
The server logs show a successful session open, but they don't show a session close message until 3 minutes later, so it seems to be an issue with stash/ssh/dulwich.
StaSh v0.6.15
dulwich 0.12.2Any ideas?