Once you added JGit to the system, then the job definition will have an
additional choice added in the "Git" section.  Use that choice to switch
from "Default" to "jgit".

You mentioned the .ssh directory on the computer.  That should be
irrelevant for a service, particularly since a service typically runs as a
service user, so does not have the .ssh directory you might usually expect.

If you are using the contents of the .ssh directory on your Jenkins server,
then you'll need to assure that the Jenkins process is using the .ssh
directory you think it is using.  To test that, you might read the "ssh"
man page and use it to report information about the default private key
that is being read from the .ssh directory.

I recommend you not rely on the contents of the .ssh directory.  You should
create a Jenkins credential (from the Jenkins "Credentials") and use that
in your job definition.  Relying on the .ssh directory then requires that
you must copy that .ssh directory to every node.  The Jenkins Credentials
are automatically used on each node, without requiring additional
configuration from you.

Mark Waite

On Thu, Jul 28, 2016 at 9:26 AM Ranjit kumar Kundu <ranjitkun...@gmail.com>
wrote:

> No passphrase used for the private key.
>
> I have added JGit .
>
>
> *My git config file as below*
>
> *[core]*
> * repositoryformatversion = 0*
> * bare = false*
> * symlinks = false*
> * ignorecase = true*
> *    filemode = true*
> *    logallrefupdates = true*
> *    precomposeunicode = true*
> *[remote "origin"]*
> * url =
> http://git.covisintrnd.com/CovisintAutomationFramework/PRD-IDM-API.git
> <http://git.covisintrnd.com/CovisintAutomationFramework/PRD-IDM-API.git>*
> *    fetch = +refs/heads/*:refs/remotes/origin/**
> * User = sAdministrator *
> *[branch "master"]*
> *    remote = origin*
> *    merge = refs/heads/master*
>
> *My config file in .ssh folder *
>
> *Host gitlab.com <http://gitlab.com>*
> *Hostname git.covisintrnd.com <http://git.covisintrnd.com>*
> *Port 22*
> *PreferredAuthentications publickey *
> *IdentityFile ~/.ssh/id_rsa*
> *User sAdministrator*
>
>
> Once i added JGit what to don next if you can post some walk through it
> will be very help full.
>
> Let me know if you need more info
>
>
> On Thursday, 28 July 2016 17:06:00 UTC+5:30, Mark Waite wrote:
>
>> It appears from the output that you've defined an RSA private key
>> credential in Jenkins and that you selected that credential as part of the
>> job definition.  That's good.  It also looks like you're using the command
>> line git implementation (rather than JGit).  That's generally the preferred
>> git implementation, so that's good also.
>>
>> Is the RSA private key that you are using protected by a passphrase?  If
>> so, then you are encountering a known bug that a Windows service cannot use
>> a passphrase protected ssh key with the current git plugin.  A pull request
>> is pending which may help with that problem, but it needs more evaluation
>> before it can be included in the plugin.
>>
>> If you require a passphrase protected RSA private key, then you might try
>> enabling the JGit implementation on your Jenkins "Global Tools
>> Configuration", then use JGit.  i believe the git plugin implementation
>> that uses JGit may work with a passphrase protected RSA private key.
>>
>> If those guesses inferred from your pasted output are not correct, you'll
>> need to provide more details about your environment so that someone else
>> can duplicate the problem.  I regularly test private key based access to
>> the publicly hosted GitLab instance with the git plugin and can confirm
>> that it works in my test cases.
>>
>> Mark Waite
>>
>> On Thu, Jul 28, 2016 at 1:14 AM Ranjit kumar Kundu <ranjit...@gmail.com>
>> wrote:
>>
>
>>> Building in workspace C:\Program Files (x86)\Jenkins\jobs\ApiV1\workspace
>>>  > C:\Program Files\Automation\Git\bin\git.exe rev-parse 
>>> --is-inside-work-tree # timeout=10
>>> Fetching changes from the remote Git repository
>>>  > C:\Program Files\Automation\Git\bin\git.exe config remote.origin.url 
>>> http://git.covisintrnd.com/CovisintAutomationFramework/PRD-IDM-API.git # 
>>> timeout=10
>>> Fetching upstream changes from 
>>> http://git.covisintrnd.com/CovisintAutomationFramework/PRD-IDM-API.git
>>>  > C:\Program Files\Automation\Git\bin\git.exe --version # timeout=10
>>> using GIT_SSH to set credentials PrivateKey
>>> using .gitcredentials to set credentials
>>>  > C:\Program Files\Automation\Git\bin\git.exe config --local 
>>> credential.username sAdministrator # timeout=10
>>>  > C:\Program Files\Automation\Git\bin\git.exe config --local 
>>> credential.helper store 
>>> --file=\"C:\Windows\TEMP\git1290652479642764419.credentials\" # timeout=10
>>>  > C:\Program Files\Automation\Git\bin\git.exe -c core.askpass=true fetch 
>>> --tags --progress 
>>> http://git.covisintrnd.com/CovisintAutomationFramework/PRD-IDM-API.git 
>>> +refs/heads/*:refs/remotes/origin/*
>>>
>>> ERROR: Timeout after 10 minutes > C 
>>> <http://stacktrace.jenkins-ci.org/search?query=%20%3E%20C>:\Program 
>>> Files\Automation\Git\bin\git.exe config --local --remove-section credential 
>>> # timeout=10
>>> ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException 
>>> <http://stacktrace.jenkins-ci.org/search?query=hudson.plugins.git.GitException>:
>>>  Failed to fetch from 
>>> http://git.covisintrnd.com/CovisintAutomationFramework/PRD-IDM-API.git
>>>     at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:799) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitSCM.fetchFrom&entity=method>
>>>     at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1055) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitSCM.retrieveChanges&entity=method>
>>>     at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitSCM.checkout&entity=method>
>>>     at hudson.scm.SCM.checkout(SCM.java:485) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.scm.SCM.checkout&entity=method>
>>>     at hudson.model.AbstractProject.checkout(AbstractProject.java:1276) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractProject.checkout&entity=method>
>>>     at 
>>> hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
>>>  
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout&entity=method>
>>>     at 
>>> jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=jenkins.scm.SCMCheckoutStrategy.checkout&entity=method>
>>>     at 
>>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
>>>  
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.run&entity=method>
>>>     at hudson.model.Run.execute(Run.java:1738) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.execute&entity=method>
>>>     at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.FreeStyleBuild.run&entity=method>
>>>     at hudson.model.ResourceController.execute(ResourceController.java:98) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.execute&entity=method>
>>>     at hudson.model.Executor.run(Executor.java:410) 
>>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.run&entity=method>
>>> Caused by: hudson.plugins.git.GitException 
>>> <http://stacktrace.jenkins-ci.org/search?query=hudson.plugins.git.GitException>:
>>>  Command "C:\Program Files\Automation\Git\bin\git.exe -c core.askpass=true 
>>> fetch --tags --progress 
>>> http://git.covisintrnd.com/CovisintAutomationFramework/PRD-IDM-API.git 
>>> +refs/heads/*:refs/remotes/origin/*" returned status code -1:
>>> stdout:
>>> stderr:
>>>     at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
>>>     at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
>>>     at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
>>>     at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
>>>     at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
>>>     ... 11 more
>>> ERROR: nullFinished 
>>> <http://stacktrace.jenkins-ci.org/search?query=Finished>: FAILURE
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Developers" group.
>>>
>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to jenkinsci-de...@googlegroups.com.
>>
>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-dev/40b8c78e-6607-456a-863a-4da9e98c89e5%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-dev/40b8c78e-6607-456a-863a-4da9e98c89e5%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 Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/421ae39e-3c54-4c6c-9cdf-f3876cd78a8e%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/421ae39e-3c54-4c6c-9cdf-f3876cd78a8e%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 Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAO49JtE%3DrKLzQ-M5CZz%2BcdE9C0T2U9owfBLpoyWnYkGmyGV1KQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to