At random times, I am getting Authentication error with git checkout. This issue would persist through rebuilding, until the job is reassigned to a new slave. The slaves also have git installed via yum:
Attempting to resolve master from remote references...
> git --version # timeout=10
> git --version # 'git version 1.8.3.1'
using GIT_SSH to set credentials jenkins ssh creds
> git ls-remote -h xxxx
Found match: refs/heads/master revision 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
using credential jenkins_ssh
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url xxxx.git # timeout=10
Fetching without tags
Fetching upstream changes from xxxx.git
> git --version # timeout=10
> git --version # 'git version 1.8.3.1'
using GIT_SSH to set credentials jenkins ssh creds
> git fetch --no-tags --progress xxxx* # timeout=10
Checking out Revision 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd (master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd # timeout=10
Commit message: "DEVOPS-4254: update slack channel to #jenkins_maven_alerts (#186)"
[Checks API] No suitable checks publisher found.
[Pipeline] Start of Pipeline
[Pipeline] node
Running on EC2 (Personalcapital) - Jenkins slave centos (i-0fae3510929c96322) in /home/centos/jenkins/workspace/web_pcap-website_master
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
The recommended git tool is: NONE
using credential pcap_github
Fetching changes from the remote Git repository
Fetching without tags
ERROR: Error fetching remote repo 'origin'
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:957)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1198)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1258)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
stdout:
stderr: warning: invalid credential line: get
remote: Invalid username or password.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
... 4 more
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (Personalcapital) - Jenkins slave centos (i-0fae3510929c96322)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:998)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor639.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy86.execute(Unknown Source)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:955)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1198)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1258)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
... 4 more
I am using the latest git plugin from jenkins. My jenkins version is 2.235.5. Any idea how to resolve this?