2

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.

PJvG
  • 1,310
  • 3
  • 16
  • 33

1 Answers1

5

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.

Community
  • 1
  • 1
PJvG
  • 1,310
  • 3
  • 16
  • 33