【问题标题】:JENKINS - Git Plugin not working as expectedJENKINS - Git 插件没有按预期工作
【发布时间】:2016-06-26 19:55:34
【问题描述】:

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

我已经配置了 pull-request-notifier-for-bitbucket 来触发所有正在打开到 master 分支的 PR。 在我的詹金斯工作中,我已经配置了 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

【问题讨论】:

    标签: git jenkins bitbucket jenkins-plugins


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2010-11-26
        • 2018-01-15
        • 2014-07-25
        • 2015-03-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-04-09
        • 1970-01-01
        相关资源
        最近更新 更多