omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    git clone ssh failing

    Pythonista
    ssh git stash
    4
    37
    29522
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mstonespeedy
      mstonespeedy last edited by

      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.5

      I don't believe we use submodules. How do I tell?

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        Do you get any printout from the script? I am surprised you don't get any list of refs...

        Perhaps also change the paramikolog.txt to os.path.expanduser('~/Documents/paramikolog.txt')

        1 Reply Last reply Reply Quote 0
        • mstonespeedy
          mstonespeedy last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            That is surprising, because at a minimum, you should get a "logging started" message which is logged right off the bat by my script.

            Then you should see some startup stuff, and the authentication negotiation..

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              Can you post a full traceback of your hangup error?

              1 Reply Last reply Reply Quote 0
              • mstonespeedy
                mstonespeedy last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • JonB
                  JonB last edited by JonB

                  Can you exit/restart pythonista, then run the script directly(no stash)?

                  Incidentally, i can reproduce this error if I type in an incorrect repo path. Are you SURE you have the full and proper path? i.e if i change uicomponents to uicomponent, i get thto same error as you.

                  Try adding this right after the get_transport line, around 34:

                  proto, can_read = client._connect(b'upload-pack', host_path)
                  import time
                  time.sleep(1.0)
                  okay_to_read=can_read()
                  while okay_to_read:
                  	line=proto.read_pkt_line()
                  	if line:
                  		line=line.replace('\x00','')
                  		print(line)
                  	okay_to_read=can_read()
                  
                  1 Reply Last reply Reply Quote 0
                  • mstonespeedy
                    mstonespeedy last edited by mstonespeedy

                    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!

                    1 Reply Last reply Reply Quote 0
                    • JonB
                      JonB last edited by

                      how odd. I would report it as a dulwich issue. I suspect a true git client may do some "normalization" such as adding the .git at the end.

                      1 Reply Last reply Reply Quote 0
                      • mstonespeedy
                        mstonespeedy last edited by

                        Will do. Thanks again.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Powered by NodeBB Forums | Contributors