Jenkins Tomcat - 无法连接到存储库:无法初始化
Jenkins with Tomcat - Failed to connect to repository : Could not init
问题:
我已经在 corporate proxy
后面的 Windows 7 SP1 x64
上设置了 Jenkins v1.605
由 Apache Tomcat 7.0.59
托管
我在Jenkins中配置了JDK、Git和maven安装路径。还在“管理插件”
的“高级”选项卡下配置了代理
我在 Eclipse 上有一个 Java 项目,我使用 EGit 插件托管在 Bitbucket
存储库上,我正在尝试将它连接到詹金斯通过 https
我在 Jenkins 中创建了一个新工作,添加了存储库 URL (https://@bitbucket.org//.git) 并添加了我的凭据在下一步中。这是我收到以下错误的地方:
Failed to connect to repository : Could not init D:\Work\apache-tomcat-7.0.59\temp\hudson4595160075978517187tmp
我试过的:
过去两天我检查了大约 20 个 SO 问题和许多其他网站,并实施了其他人认为有用的解决方案,但无济于事。这是我尝试过的:
在 git 中配置 http/https 代理后,尝试从 Git Bash 克隆存储库(来自 this answer and this 问题) .存储库已成功克隆,但 Jenkins 无法连接到它。
仔细检查了 Jenkins 中的 git 安装路径配置(this 和许多其他答案)
我将 git 和 git 客户端插件分别从最新版本降级到 1.5.0 和 1.0.7(来自 this and many other answers). After this, I entered the URL with my credentials (this 答案),但是得到了相同的结果。之后,我恢复到最新版本。
我尝试连接到 GitHub 存储库,但遇到了同样的问题
尝试以各种格式输入存储库 URL(this and this 个答案)
我清除了 Tomcat 临时文件夹并使用 Tomcat 重新启动 Jenkins(this 回答),但它没有解决问题
谁能告诉我是否遗漏了什么?在代理后面工作时我应该执行一些其他步骤吗?还是其他问题?
我遇到了这个问题,并使用 Process Monitor 调查了服务器上发生的情况。我发现了这个有助于查明问题的特定错误:
java.exe CreateFile C:\Users\...\AppData\Local\GitHub\PortableGit_blabla\cmd init C:\Users\...\AppData\Local\Temp\hudsonblablatmp NAME INVALID
在 cmd
window 中复制并粘贴命令会出现 C:\... is not recognized as an internal or external command...
错误。
Jenkins 试图在临时文件夹中执行 git init
命令。但是我注意到服务器上有问题的命令中 init
选项前面没有 git 可执行文件,这让我转向 Jenkins 配置中的 Path to Git executable
设置。我已经按照上面的样子配置它 (C:\...\cmd
) 但将其视为一个简单的路径(即文件夹链)并且没有指定可执行文件。事实证明,Jenkins 只是获取该值并将其用作可执行文件的绝对路径。所以我通过向它附加 \git.exe
来解决这个问题,瞧!
tl;博士
确保 Jenkins 配置中的 Path to Git executable
是可执行文件的绝对路径,with 路径中存在的可执行文件:
例如c:\Users\User\AppData\Local\GitHub\PortableGit_<guid>\cmd\git.exe
此错误是由于 Git 在服务器上不可用。这可以通过在 Jenkins 服务器上安装 Git 来解决。
yum install -y git
有一个类似的问题,就像上面提到的@balan,它是 CI 服务器上的 git 不可用。为我工作
$sudo apt-get update
$sudo apt-get install git
最初我在 Jenkins -> MyProjectName -> Configure -> Source Code Management =
问题:
我已经在
corporate proxy
后面的 我在Jenkins中配置了JDK、Git和maven安装路径。还在“管理插件”
的“高级”选项卡下配置了代理
我在 Eclipse 上有一个 Java 项目,我使用 EGit 插件托管在
Bitbucket
存储库上,我正在尝试将它连接到詹金斯通过 https我在 Jenkins 中创建了一个新工作,添加了存储库 URL (https://@bitbucket.org//.git) 并添加了我的凭据在下一步中。这是我收到以下错误的地方:
Windows 7 SP1 x64
上设置了 Jenkins v1.605
由 Apache Tomcat 7.0.59
托管
Failed to connect to repository : Could not init D:\Work\apache-tomcat-7.0.59\temp\hudson4595160075978517187tmp
我试过的:
过去两天我检查了大约 20 个 SO 问题和许多其他网站,并实施了其他人认为有用的解决方案,但无济于事。这是我尝试过的:
在 git 中配置 http/https 代理后,尝试从 Git Bash 克隆存储库(来自 this answer and this 问题) .存储库已成功克隆,但 Jenkins 无法连接到它。
仔细检查了 Jenkins 中的 git 安装路径配置(this 和许多其他答案)
我将 git 和 git 客户端插件分别从最新版本降级到 1.5.0 和 1.0.7(来自 this and many other answers). After this, I entered the URL with my credentials (this 答案),但是得到了相同的结果。之后,我恢复到最新版本。
我尝试连接到 GitHub 存储库,但遇到了同样的问题
尝试以各种格式输入存储库 URL(this and this 个答案)
我清除了 Tomcat 临时文件夹并使用 Tomcat 重新启动 Jenkins(this 回答),但它没有解决问题
谁能告诉我是否遗漏了什么?在代理后面工作时我应该执行一些其他步骤吗?还是其他问题?
我遇到了这个问题,并使用 Process Monitor 调查了服务器上发生的情况。我发现了这个有助于查明问题的特定错误:
java.exe CreateFile C:\Users\...\AppData\Local\GitHub\PortableGit_blabla\cmd init C:\Users\...\AppData\Local\Temp\hudsonblablatmp NAME INVALID
在 cmd
window 中复制并粘贴命令会出现 C:\... is not recognized as an internal or external command...
错误。
Jenkins 试图在临时文件夹中执行 git init
命令。但是我注意到服务器上有问题的命令中 init
选项前面没有 git 可执行文件,这让我转向 Jenkins 配置中的 Path to Git executable
设置。我已经按照上面的样子配置它 (C:\...\cmd
) 但将其视为一个简单的路径(即文件夹链)并且没有指定可执行文件。事实证明,Jenkins 只是获取该值并将其用作可执行文件的绝对路径。所以我通过向它附加 \git.exe
来解决这个问题,瞧!
tl;博士
确保 Jenkins 配置中的 Path to Git executable
是可执行文件的绝对路径,with 路径中存在的可执行文件:
例如c:\Users\User\AppData\Local\GitHub\PortableGit_<guid>\cmd\git.exe
此错误是由于 Git 在服务器上不可用。这可以通过在 Jenkins 服务器上安装 Git 来解决。
yum install -y git
有一个类似的问题,就像上面提到的@balan,它是 CI 服务器上的 git 不可用。为我工作
$sudo apt-get update
$sudo apt-get install git
最初我在 Jenkins -> MyProjectName -> Configure -> Source Code Management =