如何调试无法运行程序“C:\ Program Files \Git”在詹金斯的工作? [英] How to debug Cannot run program "C:\Program Files\Git" in a Jenkins job?

查看:2189
本文介绍了如何调试无法运行程序“C:\ Program Files \Git”在詹金斯的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jenkins来构建我的git项目,这是我在看到日志时遇到的错误。

我在jenkins中使用git插件。

I'm using jenkins to build my git project, this is the error I am getting when see the log.
I am using git plugin in jenkins.

您如何排除该错误讯息?

How would you troubleshoot that error message?

Started by user anonymous
Building in workspace E:\sw\jenkins\workspace\se12
ERROR: Workspace has a .git repository, but it appears to be corrupt.
hudson.plugins.git.GitException: Error performing command: git rev-parse --is-inside-work-tree

org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1180)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1150)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1146)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:962)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:972)
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:651)
        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git" (in directory "E:\sw\jenkins\workspace\se12"): CreateProcess error=5, Access is denied
        at java.lang.ProcessBuilder.start(Unknown Source)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1169)
        ... 16 more
    Caused by: java.io.IOException: CreateProcess error=5, Access is denied
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 22 more
    Cloning the remote Git repository
    Cloning repository $ git clone \\SE12\Adempiere370new\.git
    Fetching upstream changes from $ git clone \\SE12\Adempiere370new\.git
    ERROR: Error cloning remote repo 'origin'
    hudson.plugins.git.GitException: Error performing command: git fetch --tags --progress $ git clone \\SE12\Adempiere370new\.git +refs/heads/*:refs/remotes/origin/*
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1180)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1043)
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:651)
        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)

    Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git" (in directory "E:\sw\jenkins\workspace\se12"): CreateProcess error=5, Access is denied
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1169)
        ... 14 more


推荐答案

也许你错误地设置了git可执行文件路径。

Maybe you incorrectly set the git executable path.

它不应该是 C:\ Program Files \Git ,但是 C:\ Program Files \Git\bin\git.exe

(类似于 JENKINS-6181

Git插件页面提到:

The Git plugin page does mention:


如果您看到Git无法克隆的输出,如下面的输出,请转到 Jenkins配置设置(不是项目设置,全局设置),然后将Git路径更改为完全限定的路径(例如,不是 git ,而是 / usr / bin / git 或者Git二进制文件的安装位置)。

If you are seeing output indicating Git could not clone, something like the output below, go to to the Jenkins configuration settings (not the project settings, the global ones) and change the Git path to a fully qualified path (eg. not "git" but "/usr/bin/git" or wherever your Git binary is installed).

在你的情况下,检查 C:\ Program Files \Git 的确是你的Git安装路径。

In your case, check that C:\Program Files\Git is indeed your Git installation path.

这篇关于如何调试无法运行程序“C:\ Program Files \Git”在詹金斯的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆