Using pipeline shared library is failing with "I don't handle protocol 'git clone ssh'"

684 views
Skip to first unread message

David Karr

unread,
Feb 2, 2017, 12:15:57 PM2/2/17
to Jenkins Users
In Jenkins 2.19.2, I now have three different pipeline jobs using a variation of the same script components, including a bunch of methods that I've pasted into each script.  I'm storing each script in git, but I think it's now time to define a shared library so I can remove the duplicated methods.

So, I created a git repo with the "src", "vars", and "resources" structure (initial test only has a single class in the "src" tree), and referenced that repo from the shared library definition.

I first noticed that something might be wrong when I entered "1.0" in the "Default Version" field and it printed "Cannot validate default version" below that.  When I clicked on "show details" it said something like this:
hudson.plugins.git.GitException: Command "/opt/app/git/1.9.0-0.14/bin/git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout
:
stderr
: fatal: I don't handle protocol 'git clone ssh'

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)


Even with this, I went ahead and tried adding the reference to the library in one of my pipeline scripts, only to reference the single class I put in the library (a simple enum definition).  In the build output, the first reference to the repo containing the shared library looks like this:
Setting origin to git clone ssh://git@.../usl_jenkins_library.git
 
> /opt/app/git/1.9.0-0.14/bin/git config remote.origin.url git clone ssh://git@.../usl_jenkins_library.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
 
> /opt/app/git/1.9.0-0.14/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
 
> /opt/app/git/1.9.0-0.14/bin/git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
hudson.plugins.git.GitException: Command "/opt/app/git/1.9.0-0.14/bin/git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: I don't handle protocol 'git clone ssh'

        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)

If it matters, I modified my pipeline script to look like this:
@Library("usl-pipeline-library")
import com.att.usl.jenkins.BUILD_STATUS

import groovy.xml.*
import java.nio.file.*
import hudson.model.*
import hudson.triggers.*
import hudson.plugins.git.GitStatus


What might I be doing wrong here?

Daniel Beck

unread,
Feb 2, 2017, 5:15:15 PM2/2/17
to jenkins...@googlegroups.com

> On 02.02.2017, at 18:15, David Karr <davidmic...@gmail.com> wrote:
>
> What might I be doing wrong here?

Are you including 'git clone' wherever you are pasting the URL to the repo?

David Karr

unread,
Feb 2, 2017, 5:18:22 PM2/2/17
to Jenkins Users

Hmm, well, this is was a head-slap error.  I didn't pay enough attention to what I pasted into the "repository" field.  I copied the entire "git clone" instruction instead of just the repository url.  Moving forward now.

Baptiste Mathus

unread,
Feb 14, 2017, 3:12:56 AM2/14/17
to jenkins...@googlegroups.com
+Thanks Daniel, maybe…

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/adae71ec-42d0-4b79-ae92-3b7bff880d64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages