Jul 17, 2011

f Comment

[SOLVED] Fixing 'SVN Cannot Create Tunnel' Error in Eclipse IDE

MenuFixing 'SVN Cannot Create Tunnel' Error
Solving 'Commit Operation Failed' Error
Amazon When I check out SVN project in Eclipse via Subclipse plugin it fails and displays an error dialog "SVN: can't create tunnel". How do I fix it?

Although this article is primarily for Subclipse plugin, it may apply to Subversive plugin as well. If you get this error read on to see if this fix works for you.
A few definitions first. Eclipse is a popular IDE for developing software, particularly Java, PHP, and C++. Subclipse is a plugin that can be installed on Eclipse making SVN tools available to the IDE's user. SVN is Subversion which is one of the most popular free source control software applications.

When I installed Subclipse on Eclipse on Windows 7 platform I didn't have trouble checking out and manipulating my SVN project which is hosted somewhere remotely. However when my friend did he saw the following error when trying to check out an SVN project:

Subclipse SVN Cannot Create Tunnel

If you are using SVN command line then the SVN command to check out a project looks like 'svn co svn+ssh://...'

How do I fix this error?

Possible Solution #1
If you check out an SVN project with SSH meaning that the SVN URL is prefixed with 'svn+ssh://', read on. Otherwise go to Possible Solution #2 below. The svn+ssh combination ensures that your communication with the SVN server is encrypted and secure. This means that Eclipse needs to know how the SSH protocol works.

Here's the solution. Install TortoiseSVN and tell Subversion how to run SSH protocol by following these steps.

Install TortoiseSVN
Download the latest TortoiseSVN from their official website and install it.

Locate Subversion's configuration file
If you are using Windows 7 or Windows Vista it should be located at

C:\Users\[User]\AppData\Roaming\Subversion\config
If you are using Windows XP it should be located at

C:\Documents and Settings\%USERID%\Application Data\Subversion\config
Edit Subversion's configuration file
Open your SVN configuration file and locate the line where 'ssh' is commented out like this:

# ssh = $SVN_SSH ssh
This is where you need to let SVN know where the SSH executable file is. Change the line to

ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe
If you don't want to enter user name and password every time you use SVN then change the line to

ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe -l user -pw password
If you use a private key for authentication then change the line to

ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe -i C:/my-private-key.ppk
Using private/public key authentication to checkout code via SVN is discussed at Guide on How to use Eclipse to SVN+SSH Checkout Code from Amazon EC2. I am using a private key and my subversion configuration file looks like this:
001### This file configures various client-side behaviors.
002###
003### The commented-out examples below are intended to demonstrate
004### how to use this file.
005 
006### Section for authentication and authorization customizations.
007[auth]
008### Set store-passwords to 'no' to avoid storing passwords in the
009### auth/ area of your config directory.  It defaults to 'yes'.
010### Note that this option only prevents saving of *new* passwords;
011### it doesn't invalidate existing passwords.  (To do that, remove
012### the cache files by hand as described in the Subversion book.)
013# store-passwords = no
014### Set store-auth-creds to 'no' to avoid storing any subversion
015### credentials in the auth/ area of your config directory.
016### It defaults to 'yes'.  Note that this option only prevents
017### saving of *new* credentials;  it doesn't invalidate existing
018### caches.  (To do that, remove the cache files by hand.)
019# store-auth-creds = no
020 
021### Section for configuring external helper applications.
022[helpers]
023### Set editor to the command used to invoke your text editor.
024###   This will override the environment variables that Subversion
025###   examines by default to find this information ($EDITOR,
026###   et al).
027# editor-cmd = editor (vi, emacs, notepad, etc.)
028### Set diff-cmd to the absolute path of your 'diff' program.
029###   This will override the compile-time default, which is to use
030###   Subversion's internal diff implementation.
031# diff-cmd = diff_program (diff, gdiff, etc.)
032### Set diff3-cmd to the absolute path of your 'diff3' program.
033###   This will override the compile-time default, which is to use
034###   Subversion's internal diff3 implementation.
035# diff3-cmd = diff3_program (diff3, gdiff3, etc.)
036### Set diff3-has-program-arg to 'true' or 'yes' if your 'diff3'
037###   program accepts the '--diff-program' option.
038# diff3-has-program-arg = [true | false]
039 
040### Section for configuring tunnel agents.
041[tunnels]
042### Configure svn protocol tunnel schemes here.  By default, only
043### the 'ssh' scheme is defined.  You can define other schemes to
044### be used with 'svn+scheme://hostname/path' URLs.  A scheme
045### definition is simply a command, optionally prefixed by an
046### environment variable name which can override the command if it
047### is defined.  The command (or environment variable) may contain
048### arguments, using standard shell quoting for arguments with
049### spaces.  The command will be invoked as:
050###   <command> <hostname> svnserve -t
051### (If the URL includes a username, then the hostname will be
052### passed to the tunnel agent as <user>@<hostname>.)  If the
053### built-in ssh scheme were not predefined, it could be defined
054### as:
055# ssh = $SVN_SSH ssh
056ssh = C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe -i C:/my-ec2-key.ppk
057### If you wanted to define a new 'rsh' scheme, to be used with
058### 'svn+rsh:' URLs, you could do so as follows:
059# rsh = rsh
060### Or, if you wanted to specify a full path and arguments:
061# rsh = /path/to/rsh -l myusername
062### On Windows, if you are specifying a full path to a command,
063### use a forward slash (/) or a paired backslash (\\) as the
064### path separator.  A single backslash will be treated as an
065### escape for the following character.
066 
067### Section for configuring miscelleneous Subversion options.
068[miscellany]
069### Set global-ignores to a set of whitespace-delimited globs
070### which Subversion will ignore in its 'status' output, and
071### while importing or adding files and directories.
072# global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store
073### Set log-encoding to the default encoding for log messages
074# log-encoding = latin1
075### Set use-commit-times to make checkout/update/switch/revert
076### put last-committed timestamps on every file touched.
077# use-commit-times = yes
078### Set no-unlock to prevent 'svn commit' from automatically
079### releasing locks on files.
080# no-unlock = yes
081### Set enable-auto-props to 'yes' to enable automatic properties
082### for 'svn add' and 'svn import', it defaults to 'no'.
083### Automatic properties are defined in the section 'auto-props'.
084# enable-auto-props = yes
085 
086### Section for configuring automatic properties.
087[auto-props]
088### The format of the entries is:
089###   file-name-pattern = propname[=value][;propname[=value]...]
090### The file-name-pattern can contain wildcards (such as '*' and
091### '?').  All entries which match will be applied to the file.
092### Note that auto-props functionality must be enabled, which
093### is typically done by setting the 'enable-auto-props' option.
094# *.c = svn:eol-style=native
095# *.cpp = svn:eol-style=native
096# *.h = svn:eol-style=native
097# *.dsp = svn:eol-style=CRLF
098# *.dsw = svn:eol-style=CRLF
099# *.sh = svn:eol-style=native;svn:executable
100# *.txt = svn:eol-style=native
101# *.png = svn:mime-type=image/png
102# *.jpg = svn:mime-type=image/jpeg
103# Makefile = svn:eol-style=native
You are done. Check out your SVN project in Eclipse again. If this solution does not work for you read on!

Solving 'Commit Operation Failed' Error ▶

If you have any questions please let me know and I will do my best to help you!
Please leave a comment here!
One Minute Information - by Michael Wen
ADVERTISING WITH US - Direct your advertising requests to Michael