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.


    Broken pipe error using Stash's git push (both http&https)

    Pythonista
    git error stash
    2
    13
    11380
    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.
    • SimCityWok
      SimCityWok last edited by

      So, 1 & 2 don't work as I posted above, @JonB
      I really appreciate the help.

      Let me rephrase the problem: if I delete the GitHub repo, how can I push my folder to GitHub?

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

        Sorry, i was wrong about a few of the commands:

        git fetch origin ( although fetch claims to accept a url, it really wants a remote name)
        git merge origin/master ( the argument is required, apparantly)

        For keygen, sorry, should be:
        ssh-keygen -trsa -b2048 creates a rsa key.

        pbcopy ~/.ssh/id_rsa.pub copies it to the clipboard. You then go to github settings/ssh keys, and click the create new key button, and paste it in with a title of your choice.
        I am updating the gh command to easily add keys without this extra step.

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

          just to be clear: you have commits locally, but none in github?

          Delete the github repo, then create it without the auto option (bare repo).

          As an example:

          [~/Documents]$ mkdir example
          [~/Documents]$ cd example
          [example]$ git init .
          [example]$ echo hello world > Readme.md
          [example]$ git add Readme.md 
          Adding Readme.md
          [example]$ git commit
          Commit Message: First commit
          Author Name: jb
          Save this setting? [y/n]y
          Author Email: jb
          Save this setting? [y/n]y
          f065a0f14eaaa9777ea250ab5b9e3a2226ea2991
          [example]$ gh create example -i
          Created https://github.com/jsbain/example
          [example]$ git remote origin https://github.com/jsbain/example.git
          [example]$ git push
          
          1 Reply Last reply Reply Quote 1
          • SimCityWok
            SimCityWok last edited by SimCityWok

            [~/Documents]$ cd alphabear-solver/
            [alphabear-solver]$ git init .
            stash: <type 'exceptions.OSError'>: [Errno 17] File exists: './.git'
            
            [alphabear-solver]$ ls -h
            usage: ls.py [-h] [-1] [-a] [-l] [files [files ...]]
            
            positional arguments:
              files           files to be listed
            
            optional arguments:
              -h, --help      show this help message and exit
              -1, --one-line  List one file per line
              -a, --all       do not ignore entries starting with .
              -l, --long      use a long listing format
            [alphabear-solver]$ ls -1a
            .git
            README.md
            ab.py
            dictionary.txt
            hashdict.py
            map.json
            solver.py
            [alphabear-solver]$ rm .git
            .git: is a directory
            [alphabear-solver]$ rm -r .git
            [alphabear-solver]$ git init .
            [alphabear-solver]$ git add *
            Adding README.md
            Adding ab.py
            Adding dictionary.txt
            Adding hashdict.py
            Adding map.json
            Adding solver.py
            [alphabear-solver]$ git commit
            Commit Message: bare Pythonista commit
            Author Name: wizardofozzie
            Save this setting? [y/n]y
            Author Email: djsim4242@gmail.com
            Save this setting? [y/n]y
            628238a51a09ccbff9d389e2a27cd340d4ffe640
            [alphabear-solver]$ gh create alphabear-solver -i
            Created https://github.com/wizardofozzie/alphabear-solver
            [alphabear-solver]$ git remote origin https://github.com/wizardofozzie/alphabear-solver.git
            [alphabear-solver]$ git push
            Attempting to push to: https://github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
            stash: <class 'urllib2.URLError'>: <urlopen error [Errno 32] Broken pipe>
            
            [alphabear-solver]$ 
            

            Same issue

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

              hmm, strange. i followed your example and it worked.
              Can you check your dulwich version?

              import dulwich
              print(dulwich.__version__)
              

              Also, go ahead and update stash:
              selfupdate dev
              and force quit pythonista, and restart it.

              run gh create_key stash to create a ssh key and link it with your github account.

              Then,
              git remote origin ssh://git@github.com/wizardofozzie/alphabear-solver.git
              and then try git push

              This may be a stupid question, but is your user and password stored corrctly?

              import keychain
              print([s for s in keychain.get_services() if s[0]=='stash.git.github.com'][0])
              print(keychain.get_password(*[s for s in keychain.get_services() if s[0]=='stash.git.github.com'][0]))
              

              This should be exactly your github login info.

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

                Dulwich version (0,12,2)

                Keychain checks out.

                gh create_key stash

                [alphabear-solver]$ gh create_key stash
                stash: <class 'github.GithubException.GithubException'>: 422 {u'documentation_url': u'https://developer.github.com/v3/users/keys/#create-a-public-key', u'message': u'Validation Failed', u'errors': [{u'field': u'key', u'message': u'key is already in use', u'code': u'custom', u'resource': u'PublicKey'}]}
                
                1 Reply Last reply Reply Quote 0
                • JonB
                  JonB last edited by

                  sounds like you already set up ssh keys. so you should be able to set up the remote url using ssh.

                  SimCityWok 1 Reply Last reply Reply Quote 1
                  • SimCityWok
                    SimCityWok @JonB last edited by SimCityWok

                    @JonB said:

                    sounds like you already set up ssh keys. so you should be able to set up the remote url using ssh.

                    Ok, I appreciate it.
                    Happy to work ssh on stash out myself, but can you tell me where to start?
                    I appreciate all your help

                    EDIT: Dulwich error on SSH

                    [alphabear-solver]$ git remote origin ssh://git@github.com/wizardofozzie/alphabear-solver.git
                    [alphabear-solver]$ git push
                    Attempting to push to: ssh://git@github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
                    
                    [alphabear-solver]$ git push
                    Attempting to push to: ssh://git@github.com/wizardofozzie/alphabear-solver.git, branch: refs/heads/master
                    stash: <class 'dulwich.errors.HangupException'>: The remote server unexpectedly closed the connection.
                    
                    [alphabear-solver]$ ```
                    1 Reply Last reply Reply Quote 0
                    • JonB
                      JonB last edited by

                      you seem to have a real iffy connection ( your earlier entry had a bunch of those hangup errors, followed by success). I think that literally meant that your connection was dropped. Just try git push a few times until you get something other than this error.

                      Are you on wifi or wireless? Or dial up?

                      I am going to write a ping command for stash tonight, and maybe we can test your connection. I am not sure, but it is likely that both errors could be caused by your connection literally dropping out.

                      1 Reply Last reply Reply Quote 1
                      • SimCityWok
                        SimCityWok last edited by

                        I am on Wifi swapping to 4G when it fails (in pasted log)

                        As I said in Slack, updating dulwich as per your recommendation, seems to have done the trick.

                        There was an error saying something about an error renaming to dulwich.old but restarting worked

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