Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32565

workflowLibs.git: Unable to clone empty repository via ssh using msys-git

    Details

    • Similar Issues:

      Description

      We just wanted to start using the workflow (sorry, pipeline) global lib feature.
      When trying to clone the repository via ssh, it fails:

      fatal: could not fetch refs from ssh://<user>@<server>:<port>/workflowLibs.git

      Workaround is to clone via http, then add an "ssh remote" and push the initial commit. Cloning via ssh works once there is something in the repository.

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          As designed. No need for HTTP access. Read the documentation. I just tried it (on 1.609.3, current Pipeline sources) and I got as expected

          tmp$ git clone ssh://…@localhost:…/workflowLibs.git
          Cloning into 'workflowLibs'...
          The authenticity of host '[localhost]:… ([127.0.0.1]:…)' can't be established.
          RSA key fingerprint is SHA256:….
          Are you sure you want to continue connecting (yes/no)? yes
          
          Warning: Permanently added '[localhost]:…' (RSA) to the list of known hosts.
          Checking connectivity... done.
          warning: remote HEAD refers to nonexistent ref, unable to checkout.
          
          tmp$ pushd workflowLibs/
          /tmp/workflowLibs /tmp
          workflowLibs$ git remote -v
          origin	ssh://…@localhost:…/workflowLibs.git (fetch)
          origin	ssh://…@localhost:…/workflowLibs.git (push)
          workflowLibs$ git checkout -b master
          Switched to a new branch 'master'
          workflowLibs$ touch foo
          workflowLibs$ git add foo
          workflowLibs$ git ci -m foo
          [master (root-commit) …] foo
           1 file changed, 0 insertions(+), 0 deletions(-)
           create mode 100644 foo
          workflowLibs$ git push --set-upstream origin master
          Counting objects: 3, done.
          Writing objects: 100% (3/3), 203 bytes | 0 bytes/s, done.
          Total 3 (delta 0), reused 0 (delta 0)
          remote: Updating references: 100% (1/1)        
          To ssh://…@localhost:…/workflowLibs.git
           * [new branch]      master -> master
          Branch master set up to track remote branch master from origin.
          workflowLibs$ git push
          Everything up-to-date
          workflowLibs$ git version
          git version 2.5.0
          
          Show
          jglick Jesse Glick added a comment - As designed. No need for HTTP access. Read the documentation . I just tried it (on 1.609.3, current Pipeline sources) and I got as expected tmp$ git clone ssh://…@localhost:…/workflowLibs.git Cloning into 'workflowLibs'... The authenticity of host '[localhost]:… ([127.0.0.1]:…)' can't be established. RSA key fingerprint is SHA256:…. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[localhost]:…' (RSA) to the list of known hosts. Checking connectivity... done. warning: remote HEAD refers to nonexistent ref, unable to checkout. tmp$ pushd workflowLibs/ /tmp/workflowLibs /tmp workflowLibs$ git remote -v origin ssh://…@localhost:…/workflowLibs.git (fetch) origin ssh://…@localhost:…/workflowLibs.git (push) workflowLibs$ git checkout -b master Switched to a new branch 'master' workflowLibs$ touch foo workflowLibs$ git add foo workflowLibs$ git ci -m foo [master (root-commit) …] foo 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 foo workflowLibs$ git push --set-upstream origin master Counting objects: 3, done. Writing objects: 100% (3/3), 203 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: Updating references: 100% (1/1) To ssh://…@localhost:…/workflowLibs.git * [new branch] master -> master Branch master set up to track remote branch master from origin. workflowLibs$ git push Everything up-to-date workflowLibs$ git version git version 2.5.0
          Hide
          thomas_kalmar Thomas Kalmár added a comment - - edited

          I think the bug is still valid.
          It is a Problem in jgit which occurs together with msys-git:
          https://bugs.eclipse.org/bugs/show_bug.cgi?id=442493
          Chekout via http:// works via ssh:// stops with fatal
          Only in windows:

          git --version
          git version 2.5.1.windows.1
          
          Show
          thomas_kalmar Thomas Kalmár added a comment - - edited I think the bug is still valid. It is a Problem in jgit which occurs together with msys-git: https://bugs.eclipse.org/bugs/show_bug.cgi?id=442493 Chekout via http:// works via ssh:// stops with fatal Only in windows: git --version git version 2.5.1.windows.1
          Hide
          lionelve Lionel Orellana added a comment -

          More of an issue when you get a fatal error instead of a warning.

          fatal: could not fetch refs from ssh://**@**:***/workflowLibs.git

          Easy way around it is to create an empty repo locally and push it.

          Show
          lionelve Lionel Orellana added a comment - More of an issue when you get a fatal error instead of a warning. fatal: could not fetch refs from ssh://** @ ** : ***/workflowLibs.git Easy way around it is to create an empty repo locally and push it.
          Hide
          jglick Jesse Glick added a comment -

          Unlikely to fix given JENKINS-31155.

          Show
          jglick Jesse Glick added a comment - Unlikely to fix given JENKINS-31155 .
          Hide
          jglick Jesse Glick added a comment -

          Will not fix given JENKINS-31155.

          Show
          jglick Jesse Glick added a comment - Will not fix given JENKINS-31155 .

            People

            • Assignee:
              Unassigned
              Reporter:
              danielweber Daniel Weber
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: