SCM Poll fails using pipeline

404 views
Skip to first unread message

Nick Witkowski

unread,
Apr 22, 2016, 7:25:11 AM4/22/16
to Jenkins Users
Hi,

We're running Jenkins ver. 1.609.3 and I have a pipeline job that registers for polling.

Looking at the "Git Polling Log" I see a permission denied error:
Started on Apr 22, 2016 7:06:00 AM
Using strategy: Default
[poll] Last Built Revision: Revision 256109511639dade5d95c561e54fffcc0e263cb0 (refs/remotes/origin/work/cascade)
 > git --version # timeout=10
 > git ls-remote -h git@mygithub:ORG/project.git # timeout=10
ERROR: polling failed in /app/jenkins/workspace/project-work-cascade-continuous on ab3-centos7-01
hudson.util.IOException2: hudson.plugins.git.GitException: Command "git ls-remote -h git@mygithub:ORG/project.git" returned status code 128:
stdout: 
stderr: Permission denied (publickey).
fatal: The remote end hung up unexpectedly
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:529)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.poll(WorkflowJob.java:531)
	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:510)
	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:539)
	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: hudson.plugins.git.GitException: Command "git ls-remote -h git@mygithub:ORG/project.git" returned status code 128:
stdout: 
stderr: Permission denied (publickey).
fatal: The remote end hung up unexpectedly
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1282)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1273)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2376)
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:583)
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:527)
	... 9 more
Using strategy: Default
[poll] Last Built Revision: Revision 256109511639dade5d95c561e54fffcc0e263cb0 (refs/remotes/origin/work/cascade)
 > git --version # timeout=10
 > git ls-remote -h git@mygithub:ORG/project.git # timeout=10

Normally on job where the polling succeeds (a non pipeline job) I'd expect the following:
Started on Apr 22, 2016 7:02:00 AM
Using strategy: Default
[poll] Last Built Revision: Revision 9e4a511217a2af22478bf1f3959b449d30587981 (refs/remotes/origin/master)
using GIT_SSH to set credentials 
 > git --version # timeout=10
 > git ls-remote -h git@mygithub:ORG/project.git # timeout=10
Found 113 remote heads on git@mygithub:ORG/project.git
[poll] Latest remote head revision on refs/heads/master is: 9e4a511217a2af22478bf1f3959b449d30587981 - already built by 398
Done. Took 0.36 sec
No changes

The main difference is that the job that succeeds uses GIT_SSH to set the credentials. How do I set the GIT_SSH credentials for a pipeline script so that polling works?

Thanks,

Nick

Nick Witkowski

unread,
Apr 22, 2016, 8:22:55 AM4/22/16
to Jenkins Users
Never mind. I had the wrong/invalide credentials string the the git scm step.
Reply all
Reply to author
Forward
0 new messages