如何从NetBeans IDE 8和Jenkins重新连接到GitLab上的git存储库? [英] How to reconnect to my git repository on GitLab from NetBeans IDE 8 and Jenkins?

查看:559
本文介绍了如何从NetBeans IDE 8和Jenkins重新连接到GitLab上的git存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的NetBeans git设置似乎出了问题。我在Windows 8.1上使用NetBeans IDE 8.0.1,并且在GitLab.com上有一个专用的git存储库。但自从GitLab 更新至版本7.3 .1 我无法从NetBeans连接到git存储库。如果我抓取,拉或推,并不重要,我会得到相同的响应:无法通过https://gitlab.com/<group-name> /<project-name>连接到远程存储库。 .git(组名和项目名称因隐私原因而被省略)

我发现了类似(较旧)的问题,但我不认为它是同样的问题。我认为我的问题与GitLab Community Edition 7.3.1的发布有关,但我无法确切知道究竟是什么原因造成的。



关于NetBeans社区的这个错误报告有人建议点击被动模式可以解决问题,但我不知道在哪里可以找到这种被动模式。在谷歌搜索被动模式,我认为它与FTP有关,但我使用https选项,而不是FTP选项连接到Git存储库,所以我不认为这真的适用于我的情况(纠正我,如果我'错了)。



此有关NetBeans社区的其他bug报告有一个建议,我需要将以下行添加到我的git配置文件中:

  [http] 
sslVerify = false

我将它添加到我的中。我的项目文件夹中的git / config 文件和我用户文件夹中的 .gitconfig 文件,但这并未解决问题。



再次从GitLab.com克隆git存储库并不能解决问题。事实上,当我尝试克隆时,我得到了相同的错误响应(如上所述)。



如果我使用git,我仍然可以连接到git并执行所有git命令Git Bash for Windows。所以我现在就使用它,但我宁愿能够在NetBeans中使用Git Repository Browser。



编辑:



我也使用自动构建和测试来运行Jenkins,它也连接到GitLab.com上的同一个git存储库。我没有检查它的日志一段时间,但它也无法获取。所以这个问题并不仅限于NetBeans,因为Jenkins也受到了影响。



以下是Jenkins构建尝试的输出:

 由用户开始Pieterjan van Gastel 
在工作空间C中建立:\程序文件(x86)\Jenkins \workspace\< project-name>
> C:\程序文件(x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
从远程Git存储库中获取更改
> C:\ Program Files(x86)\Git\bin\git.exe config remote.origin.url https://gitlab.com/<group-name>/<project-name>
从https://gitlab.com/<group-name>/<project-name>获取上游变更
> C:\程序文件(x86)\Git\bin\git.exe --version
致命错误:无法从https://gitlab.com/<group-name>/<项目名称>
hudson.plugins.git.GitException:无法从https://gitlab.com/<group-name> /<project-name>获取;
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:622)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:854)
at hudson.plugins .git.GitSCM.checkout(GitSCM.java:879)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1254)
at hudson.model.AbstractBuild $ AbstractBuildExecution.defaultCheckout(AbstractBuild.java :624)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:530)
at hudson。 model.Run.execute(Run.java:1732)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
在hudson.model.Executor.run(Executor.java:234)
引起:hudson.plugins.git.GitException:收到致命警报:handshake_failure $ b $在org.jenkinsci.plugins。 gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:2115)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1151)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access $ 200(CliGitAPIImpl.java:87)
at org .jenkinsci.plugins.gitclient.CliGitAPIImpl $ 1.execute(CliGitAPIImpl.java:265)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:620)
... 10 more

同样,组名和项目名称因隐私原因而被省略。



我希望自动执行单元测试,所以很高兴知道发生了什么变化,以及如何修复它。



现在是这个问题也在在NetBeans.org 上的GitLab邮件列表

解决方案

这个问题很容易解决。



< John Gibson( @jgibson 评论了GitLab CE问题#624 ,他遇到了类似的错误。他解释说,他发现服务器上所有可用的密码至少为256位,标准的Oracle Java带有加密算法,对于某些算法而言,其密码限制为128位,安装 Oracle的无限强度加密软件包,问题就消失了。无限制的强度包只在美国合法使用,如果你不在美国,那么我认为OpenJDK会起作用。

他提到的链接下载了Java密码扩展(JCE)无限强度管辖权策略文件7,并遵循随附下载的 readme 文件中的步骤。 p>

我重新启动了NetBeans并解决了问题。



这也适用于Eclipse IDE,如下所示SO问题:



我还没有试图使它与詹金斯合作,但我认为它是一样容易修复。



我差点忘了,我发现这个答案得益于 GitLab邮件列表上的Achilleas Pipis


Something seems to have gone wrong with my NetBeans git set-up. I am using NetBeans IDE 8.0.1 on Windows 8.1 and I have a private git repository hosted on GitLab.com. But ever since GitLab updated to version 7.3.1 I am unable to connect to the git repository from NetBeans. It does not matter if I fetch, pull or push, I get the same response: "Cannot connect to the remote repository at https://gitlab.com/<group-name>/<project-name>.git" (group name and project name omitted for privacy reasons)

I found similar (older) problems, but I don't think it is the same problem. I think my problem is related to the release of GitLab Community Edition 7.3.1, though I cannot see what causes it exactly.

From this bug report on NetBeans community someone suggests clicking "passive mode" would solve the issue, but I don't know where to find this passive mode. On googling passive mode I think it has something to do with FTP, but I'm using the https option and not ftps option for connecting to the git repository, so I don't think this really applies to my situation (correct me if I'm wrong).

This other bug report on NetBeans community has a suggestion that I need to add the following line to my git config file:

[http]
    sslVerify=false

I added it both to my .git/config file in my project folder and to my .gitconfig file in my user folder, but this did not solve the problem.

Also cloning the git repository again from GitLab.com did not solve the issue. In fact, I get the same error response (as mentioned above) when I try to clone.

I can still connect to git and do all my git commands if I use Git Bash for Windows. So I'll use that for now, but I would rather also be able to use the Git Repository Browser in NetBeans.

EDIT:

I am also running Jenkins with automatic builds and testing, which is also connected to the same git repository on GitLab.com. I had not checked its log for a while, but it also fails to fetch. So the problem is not limited to NetBeans alone since Jenkins is also affected.

Here is the output of Jenkins's build attempt:

Started by user Pieterjan van Gastel
Building in workspace C:\Program Files (x86)\Jenkins\workspace\<project-name>
 > C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Fetching changes from the remote Git repository
 > C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url https://gitlab.com/<group-name>/<project-name>
Fetching upstream changes from https://gitlab.com/<group-name>/<project-name>
 > C:\Program Files (x86)\Git\bin\git.exe --version
FATAL: Failed to fetch from https://gitlab.com/<group-name>/<project-name>
hudson.plugins.git.GitException: Failed to fetch from https://gitlab.com/<group-name>/<project-name>
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:622)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:854)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:879)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1254)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
    at hudson.model.Run.execute(Run.java:1732)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Caused by: hudson.plugins.git.GitException: Received fatal alert: handshake_failure
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:2115)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1151)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:265)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:620)
    ... 10 more

Again, group name and project name omitted for privacy reasons.

I would like to have my unit tests executed automatically, so it would be nice to know what changed exactly and how to fix it.

This issue is now also filed as an issue on NetBeans.org and on the GitLab Mailing List.

解决方案

This problem is easily solved.

John Gibson (@jgibson) commented on GitLab CE issue #624 that he encountered a similar error. He explains that he "discovered that all of the available ciphers on the server were at least 256 bits. Standard Oracle Java ships with crypto that's restricted to 128 bits for some algorithms. After installing the unlimited strength crypto package from Oracle the issue went away. Note that the unlimited strength package is only legally available in the US. If you're outside of the US then I think that OpenJDK will work instead."

I followed the link he mentioned, downloaded the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 and followed the steps in the readme-file that came with the download.

I restarted NetBeans and the problem is solved.

This should also work for Eclipse IDE, as seen in the following SO question: "Gitlab cannot open git-upload-pack error"

I haven't tried to make it work with Jenkins yet, but I assume it is just as easily fixed.

I almost forgot, I found this answer thanks to Achilleas Pipis on the GitLab Mailing List.

这篇关于如何从NetBeans IDE 8和Jenkins重新连接到GitLab上的git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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