Did you define a credential for the access to that repository (using the "Add" button on the job UI, or using the credentials section in "Manage Jenkins")?
Is the credential you defined a private key (not a username / password) credential? If not, it needs to be. Did you associate that credential with that repository URL in the job definition? Is the public key for that private key registered with github as an allowed public key for that repository? Are you using any entries in ~/.ssh/config to use unexpected or different private keys in your access to the github repository? Mark Waite On Mon, Dec 19, 2016 at 2:10 PM <[email protected]> wrote: > I'm attempting to pull from a private repository in GitHub. I have keys > set up so that the jenkins user can pull from the repository but am having > trouble with the Git plugin. When I set the repository URL to: > > [email protected]/[myorg]/[myrepo] > <http://[email protected]/%5Bmyorg%5D/%5Bmyrepo%5D> > > I receive the error message: > > Failed to connect to repository : Command "git ls-remote -h > [email protected]:[myorg]/[myrepo] > HEAD" returned status code 128: > stdout: > stderr: Permission denied (publickey). > fatal: The remote end hung up unexpectedly > > However, from the command line, this works: > > git ls-remote [email protected]:[myorg]/[myrepo] HEAD > d028a33d1bc3bc4cec49ae53f80f3eb58f09f13d HEAD > > and this also gives output: > > git ls-remote -h [email protected]:[myorg/[myrepo] > d028a33d1423bc4cec49ae53f80f3eb5bc09f13d refs/heads/master > > It is the combination of using both -h and HEAD that gives bad output. > > Do I have something wrong with the repository? Or something wrong with > the plugin? Or what am I missing here? > > Thanks, > Tom Hanstra > [email protected] > > > > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/f1fb8b49-ed9f-4f19-ae6e-dc3960b5a212%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/f1fb8b49-ed9f-4f19-ae6e-dc3960b5a212%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGG3U4JUQFDts-WRkgmcXg1GpVxKhbMQTcsVDLex-hhMg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
