![Jenkins 构建脚本上 bower angular-card-input 安装的 HTTP 请求失败](https://linux22.com/image/1554638/Jenkins%20%E6%9E%84%E5%BB%BA%E8%84%9A%E6%9C%AC%E4%B8%8A%20bower%20angular-card-input%20%E5%AE%89%E8%A3%85%E7%9A%84%20HTTP%20%E8%AF%B7%E6%B1%82%E5%A4%B1%E8%B4%A5.png)
运行 bower 脚本以在 angular 中构建前端时出现错误:
bower angular-ui-utils#bower ECMDERR 无法执行“git ls-remote --tags --headshttps://github.com/angular-ui/ui-utils.git“,退出代码为 #128 错误:访问时 https://github.com/angular-ui/ui-utils.git/info/refs 致命:HTTP 请求失败
前面的链接指出:
“请升级你的 git 客户端。GitHub.com 不再支持通过 dumb-http 进行 git: https://github.com/blog/809-git-dumb-http-transport-to-be-turned-off-in-90-days“
因此,看起来我的机器有一个旧版本的 Git 客户端......但我刚刚更新了(yum update):
- Git客户端到当前最新版本(1.7.1-9)
- jenkins 升级到当前最新的每周版本 (2.109)。
并且仍然发生相同的错误。此外,它不应该发生,因为上面的 github 链接说:
“从 2011 年 6 月 7 日开始,GitHub 将不再支持通过 Git 的“愚蠢”HTTP 传输机制进行抓取。除非您运行的是 v1.6.6 之前的 git 版本并使用 http 远程 URL 进行抓取,否则这不会对您产生影响。”
并且我的 git 客户端版本 (1.7.x) 高于最低要求 (1.6.6)。所以我认为这不是问题所在。
npm 或 bower 是否有一个可能已经过时的内部 git 客户端?
任何关于如何解决这个问题的提示都非常受欢迎。谢谢
这是詹金斯构建日志的一部分:
+ sudo -E npm update
+ bower install
bower angular-ui-utils extra-resolution Unnecessary resolution: angular-ui-utils#bower
+ bower update
bower angular-card-input#* not-cached https://github.com/OutlawAndy/angular-card-input.git#*
bower angular-card-input#* resolve https://github.com/OutlawAndy/angular-card-input.git#*
bower angular-ui-utils#bower not-cached https://github.com/angular-ui/ui-utils.git#bower
bower angular-ui-utils#bower resolve https://github.com/angular-ui/ui-utils.git#bower
bower angular#1.4.8 cached https://github.com/angular/bower-angular.git#1.4.8
bower angular#1.4.8 validate 1.4.8 against https://github.com/angular/bower-angular.git#1.4.8
bower angular-sanitize#1.4.8 cached https://github.com/angular/bower-angular-sanitize.git#1.4.8
bower angular-sanitize#1.4.8 validate 1.4.8 against https://github.com/angular/bower-angular-sanitize.git#1.4.8
bower font-awesome#~4.2.0 cached https://github.com/FortAwesome/Font-Awesome.git#4.2.0
bower font-awesome#~4.2.0 validate 4.2.0 against https://github.com/FortAwesome/Font-Awesome.git#~4.2.0
bower json3#~3.3.1 cached https://github.com/bestiejs/json3.git#3.3.2
bower json3#~3.3.1 validate 3.3.2 against https://github.com/bestiejs/json3.git#~3.3.1
bower angular-resource#1.4.8 cached https://github.com/angular/bower-angular-resource.git#1.4.8
bower angular-resource#1.4.8 validate 1.4.8 against https://github.com/angular/bower-angular-resource.git#1.4.8
bower es5-shim#~4.0.3 cached https://github.com/es-shims/es5-shim.git#4.0.6
bower es5-shim#~4.0.3 validate 4.0.6 against https://github.com/es-shims/es5-shim.git#~4.0.3
bower angular-bootstrap-show-errors#* cached https://github.com/paulyoder/angular-bootstrap-show-errors.git#2.3.0
bower angular-bootstrap-show-errors#* validate 2.3.0 against https://github.com/paulyoder/angular-bootstrap-show-errors.git#*
bower angular-ui-router#~0.2.11 cached https://github.com/angular-ui/angular-ui-router-bower.git#0.2.18
bower angular-ui-router#~0.2.11 validate 0.2.18 against https://github.com/angular-ui/angular-ui-router-bower.git#~0.2.11
bower ngstorage#~0.3.6 cached https://github.com/gsklee/ngStorage.git#0.3.11
bower ngstorage#~0.3.6 validate 0.3.11 against https://github.com/gsklee/ngStorage.git#~0.3.6
bower angular-translate-handler-log#~2.8.0 cached https://github.com/PascalPrecht/bower-angular-translate-handler-log.git#2.8.1
bower angular-translate-handler-log#~2.8.0 validate 2.8.1 against https://github.com/PascalPrecht/bower-angular-translate-handler-log.git#~2.8.0
bower angular-translate#~2.8.0 cached https://github.com/PascalPrecht/bower-angular-translate.git#2.8.1
bower angular-translate#~2.8.0 validate 2.8.1 against https://github.com/PascalPrecht/bower-angular-translate.git#~2.8.0
bower famfamfam-flags-sprite#~1.0.0 cached https://github.com/atelierspierrot/famfamfam-flags-sprite.git#1.0.0
bower famfamfam-flags-sprite#~1.0.0 validate 1.0.0 against https://github.com/atelierspierrot/famfamfam-flags-sprite.git#~1.0.0
bower angular-bootstrap#~0.11.2 cached https://github.com/angular-ui/bootstrap-bower.git#0.11.2
bower angular-bootstrap#~0.11.2 validate 0.11.2 against https://github.com/angular-ui/bootstrap-bower.git#~0.11.2
bower moment-timezone#~0.4.1 cached https://github.com/moment/moment-timezone.git#0.4.1
bower moment-timezone#~0.4.1 validate 0.4.1 against https://github.com/moment/moment-timezone.git#~0.4.1
bower angular-moment#~0.9.0 cached https://github.com/urish/angular-moment.git#0.9.2
bower angular-moment#~0.9.0 validate 0.9.2 against https://github.com/urish/angular-moment.git#~0.9.0
bower moment#~2.9.0 cached https://github.com/moment/moment.git#2.9.0
bower moment#~2.9.0 validate 2.9.0 against https://github.com/moment/moment.git#~2.9.0
bower jstzdetect#~1.0.6 cached https://github.com/HenningM/jstimezonedetect.git#1.0.6
bower jstzdetect#~1.0.6 validate 1.0.6 against https://github.com/HenningM/jstimezonedetect.git#~1.0.6
bower angular-messages#1.4.8 cached https://github.com/angular/bower-angular-messages.git#1.4.8
bower angular-messages#1.4.8 validate 1.4.8 against https://github.com/angular/bower-angular-messages.git#1.4.8
bower angular-mocks#1.4.8 cached https://github.com/angular/bower-angular-mocks.git#1.4.8
bower angular-mocks#1.4.8 validate 1.4.8 against https://github.com/angular/bower-angular-mocks.git#1.4.8
bower angular-scenario#1.4.8 cached https://github.com/angular/bower-angular-scenario.git#1.4.8
bower angular-scenario#1.4.8 validate 1.4.8 against https://github.com/angular/bower-angular-scenario.git#1.4.8
bower angular-ui-utils#bower ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/angular-ui/ui-utils.git", exit code of #128 error: while accessing https://github.com/angular-ui/ui-utils.git/info/refs fatal: HTTP request failed
Additional error details:
error: while accessing https://github.com/angular-ui/ui-utils.git/info/refs
fatal: HTTP request failed
Build step 'Execute shell' marked build as failure
[WARNINGS] Skipping publisher since build result is FAILURE
Archiving artifacts
Finished: FAILURE
答案1
我们的 Jenkins 服务器上也遇到了同样的问题。我们尝试了:
- 更新 git
git config --global url."https://".insteadOf git://
- .bowerrc “简写解析器”模式
什么都没起作用。
解决问题的办法似乎是升级 nss libcurl 和 curl - 基本上是 (旧) jenkins 框上的 SSL 支持库。同样,理论上这与 GitHub 最近的 DDOS 解决方案有关,需要在客户端进行 SSL 更新。
答案2
不久前我们也遇到过类似的问题。我们通过确保支持库(nss、libcurl、openssl 等)已更新,然后更新到最新版本的 git 来修复此问题。我们从源代码编译了 git,因为我们使用的 repo 中的软件包落后了好几个版本。