Skip to main content

Hudson SVNCancelException: No credential to try. Authentication failed

Posted by felipegaucho on March 12, 2009 at 12:55 PM PDT

As soon Fabrizio published href=''>his
blog about the quality assurance of BlueMarine ( href=''>blueCAT), I
invited him to host his continuous integration in href=''>my personal Hudson
lab. Everything nice and easy except for a strange error during the
first attempt:

ERROR: svn: No credential to try. Authentication failed
org.tmatesoft.svn.core.SVNCancelException: svn: No credential to try. Authentication failed
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(
at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getFirstAuthentication(
at hudson.scm.FilterSVNAuthenticationManager.getFirstAuthentication(
at hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(
at hudson.scm.SubversionSCM.repositoryLocationsExist(
at hudson.scm.SubversionSCM.checkout(
at hudson.scm.SubversionSCM.checkout(
at hudson.model.AbstractProject.checkout(
at hudson.model.AbstractBuild$AbstractRunner.checkout(
at hudson.model.AbstractBuild$
at hudson.model.ResourceController.execute(

The authentication failure warning was useless because we tried
our passwords some times without any luck. After few minutes of
frustration, we figured out the problem was caused by a misconfiguration
of the SVN repositories accessed by blueMarine. It is probably
documented somewhere in the href=''>Hudson
pages (the impedance between humans and manuals, you know :).

The problem: SVNCancelException ... Authentication failed

When you configure a module in Hudson, it offers you a text field
where you type the SVN URL and it also gives you a chance to type the
user/password required to access the repository. Problem is: it only
asks you 1 svn credential, but sometimes your module and its submodules
access different repositories - what was exactly the case of blueMarine.


The solution is simple but the useless error message and the lack
of information in the Hudson GUI didn't helped at the first moment.

Hudson allows you to map diverse SVN URL to
user/password credentials
(or other authentication mechanism) - and not
only the one asked by Hudson after you leave the text field. In order to
do that, you need to click on the Help icon beside the text field and
then to map all SVN repositories used by your application to the
respective credentials.

hudson1.png src=""
width="875" height="366" />

After clicking the above buttons, an authentication
is shown and you have a chance to type how many repositories and
password you need.

hudson2.png src=""
width="570" height="567" />

Nothing else to say, it is really simple to fix the problem as
soon as you know what is about :) A last hint: for projects you
can use guest as user and leave the password blank - what is
recommended to protect your password and also to guarantee the code
downloaded in the host machine will have read-only access to the SVN -
protecting also the code in case a hacker comes for a visit...

Hudson rocks !


LOL! I always do things that break something. ;-) As I finish to fix a couple of things in blueMarine I'll also blog something about Hudson, as Felipe gave me the opportunity of greatly simplifying the procedure to compile blueMarine. For the moment I'm only saying a big THANKS to Felipe for the hospitality on his server... "Faster" builds take 1.5/2 hours on my server (because it's only 2GB of RAM and does too many other things), and just a few minutes on Felipe's. PS I think that very soon a bottle of italian wine will make its way to Zurich...