1
votes

Performing SVN operations within Netbeans - 8.0.2, but version is not relevant - such as 'Show annotations', or 'Search History', with the built-in clients such as CLI, JavaHL or SvnKit, connecting to a remote repository via svn+ssh, and an ssh tunnel - configured in .ssh/config - I get a connection error from Netbeans, but not when I do SVN operations from Terminal. I'm using OS X.

The tunnels are setup correctly in ~/.ssh/config because I can perform SVN operations, that go to the remote repository, such as checkout, blame, log, on the command line via terminal, but when I try to show annotations in Netbeans, I get the connection failure.

The error I'm getting from Netbeans is

org.apache.subversion.javahl.ClientException: E210002: There was a problem while connecting to [URL] on port 22

I have tried some suggestions from the Netbeans Subversion SSH FAQ, but it has not solved my problem entirely.

Namely I tried editing ~/.subversion/config and changing the default line of ssh = $SVN_SSH ssh to ssh = $SVN_SSH ssh -q, since the server I'm connecting to returns a banner, and restarted Netbeans, but I get the same error.

1

1 Answers

2
votes

I found my own answer. First in Netbeans preferences I changed the SVN client to CLI. This gave better error messages than having it set to SvnKit or JavaHL

You can also check for Netbeans error messages at ~/Library/Application\ Support/NetBeans/8.0/var/log/messages.log (on OS X)

The server banner was still showing in this message, because I had two ssh hops to the remote server (in my .ssh/config using nc), so looking up man ssh_confg I found a LogLevel QUIET parameter that I added to my hosts involved in the tunnel.

This removed the server banner from the error message, but I was still getting this error

/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
svnserve: warning: cannot set LC_CTYPE locale
svnserve: warning: environment variable LC_CTYPE is UTF-8
svnserve: warning: please check that your locale name is correct

When I go to Terminal.app and run locale I get LC_CTYPE="en_AU.UTF-8", but when I go to terminal window in Netbeans I get LC_CTYPE="UTF-8" presumably because on OS X applications need to setup their own environment variables - the shell doesn't expose them.

In this case I can edit /etc/ssh_config on my own machine with sudo vim /etc/ssh_config and I commented out the lines below (shown after commenting out).

# Host *
#  SendEnv LANG LC_*

and this solved my problem. I can now perform all the svn functions I normally would, such as show annotations and search history when connected via the ssh tunnel. This worked for CLI, but not SvnKit