JENKINS - Git插件没有按预期工作

时间:2016-06-26 19:55:35

标签: git jenkins bitbucket jenkins-plugins

我有Jenkins 1.609,Git Plugin 2.4.4,Bitbucket v4.2.0和pull-request-notifier-for-bitbucket v.2.26。 我的工作流程如下:

我已经将pull-request-notifier-for-bitbucket配置为触发正在向主分支打开的任何PR。 在我的jenkins工作中,我已经配置了git存储库(使用ssh凭据),在分支说明符中,我有以下内容“ / pr /

pull-request-notifier-for-bitbucket正在触发Jenkins,有时它正在工作,有时我在jenkins上遇到以下错误:

16:44:29  > git -c core.askpass=true fetch --tags --progress ssh://git@stash.corp.mydomain.com:7999/qa/pd-tests.git +refs/heads/*:refs/remotes/origin/*
16:44:29  > git config remote.origin.url ssh://git@stash.corp.mydomain.com:7999/qa/pd-tests.git # timeout=10
16:44:29  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
16:44:29  > git config remote.origin.url ssh://git@stash.corp.mydomain.com:7999/qa/pd-tests.git # timeout=10
16:44:29 Fetching upstream changes from ssh://git@stash.corp.mydomain.com:7999/qa/pd-tests.git
16:44:29 using GIT_SSH to set credentials tonbuilder-rhel6
16:44:29  > git -c core.askpass=true fetch --tags --progress ssh://git@stash.corp.mydomain.com:7999/qa/pd-tests.git +refs/heads/*:refs/remotes/origin/*
16:44:30  > git rev-parse bc19bbe50001d6e62a200933308458113b367498^{commit} # timeout=10
16:44:30 FATAL: Command "git rev-parse bc19bbe50001d6e62a200933308458113b367498^{commit}" returned status code 128:
16:44:30 stdout: bc19bbe50001d6e62a200933308458113b367498^{commit}
16:44:30 
16:44:30 stderr: fatal: ambiguous argument 'bc19bbe50001d6e62a200933308458113b367498^{commit}': unknown revision or path not in the working tree.
16:44:30 Use '--' to separate paths from revisions, like this:
16:44:30 'git <command> [<revision>...] -- [<file>...]'
16:44:30 
16:44:30 hudson.plugins.git.GitException: Command "git rev-parse bc19bbe50001d6e62a200933308458113b367498^{commit}" returned status code 128:
16:44:30 stdout: bc19bbe50001d6e62a200933308458113b367498^{commit}
16:44:30 
16:44:30 stderr: fatal: ambiguous argument 'bc19bbe50001d6e62a200933308458113b367498^{commit}': unknown revision or path not in the working tree.
16:44:30 Use '--' to separate paths from revisions, like this:
16:44:30 'git <command> [<revision>...] -- [<file>...]'
16:44:30 
16:44:30    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
16:44:30    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1695)
16:44:30    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1691)
16:44:30    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1321)
16:44:30    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1333)
16:44:30    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:678)
16:44:30    at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
16:44:30    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:44:30    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
16:44:30    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:44:30    at java.lang.reflect.Method.invoke(Method.java:606)
16:44:30    at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:326)
16:44:30    at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:301)
16:44:30    at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:260)
16:44:30    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
16:44:30    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
16:44:30    at hudson.remoting.Request$2.run(Request.java:325)
16:44:30    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
16:44:30    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
16:44:30    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
16:44:30    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
16:44:30    at java.lang.Thread.run(Thread.java:745)
16:44:30    at ......remote call to tonat-driver(Native Method)
16:44:30    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1360)
16:44:30    at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
16:44:30    at hudson.remoting.Channel.call(Channel.java:753)
16:44:30    at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:179)
16:44:30    at com.sun.proxy.$Proxy68.revParse(Unknown Source)
16:44:30    at org.jenkinsci.plugins.gitclient.RemoteGitImpl.revParse(RemoteGitImpl.java:555)
16:44:30    at hudson.plugins.git.RevisionParameterAction.toRevision(RevisionParameterAction.java:98)
16:44:30    at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:985)
16:44:30    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1098)
16:44:30    at hudson.scm.SCM.checkout(SCM.java:484)
16:44:30    at hudson.model.AbstractProject.checkout(AbstractProject.java:1270)
16:44:30    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
16:44:30    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
16:44:30    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
16:44:30    at hudson.model.Run.execute(Run.java:1741)
16:44:30    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
16:44:30    at hudson.model.ResourceController.execute(ResourceController.java:98)
16:44:30    at hudson.model.Executor.run(Executor.java:374)
16:44:30 found no commit info

2 个答案:

答案 0 :(得分:2)

我使用jenkins和gerrit插件遇到了类似的问题。通过从头开始新工作解决,开始简单(git w / o gerrit事件,然后添加gerrit事件)。

答案 1 :(得分:0)

我发现git插件(或者可能是SSH凭证一个)很麻烦,因为我没有默认的〜/ .ssh / id_rsa键(或者我有一个,这不是我和Jenkins一起使用的那个)。通过在Jenkins中使用默认的〜/ .ssh / id_rsa来解决。