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='http://weblogs.java.net/blog/fabriziogiudici/archive/2009/03/defining_qualit.html'>his
blog about the quality assurance of BlueMarine ( href='http://bluemarine.tidalwave.it/QA/blueCAT/'>blueCAT), I
invited him to host his continuous integration in href='http://fgaucho.dyndns.org:8080/hudson/'>my personal Hudson
lab. Everything nice and easy except for a strange error during the
first attempt:

started
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(SVNErrorManager.java:37)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:32)
at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getFirstAuthentication(DefaultSVNAuthenticationManager.java:167)
at hudson.scm.FilterSVNAuthenticationManager.getFirstAuthentication(FilterSVNAuthenticationManager.java:38)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:518)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:257)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:245)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:454)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:97)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:664)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.testConnection(DAVRepository.java:96)
at hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(SubversionSCM.java:1519)
at hudson.scm.SubversionSCM.repositoryLocationsExist(SubversionSCM.java:1620)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:455)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:418)
at hudson.model.AbstractProject.checkout(AbstractProject.java:801)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:314)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:266)
at hudson.model.Run.run(Run.java:896)
at hudson.model.Build.run(Build.java:112)
at hudson.model.ResourceController.execute(ResourceController.java:93)
at hudson.model.Executor.run(Executor.java:119)

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='http://wiki.hudson-ci.org/display/HUDSON/Use+Hudson'>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.

Solution:

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="http://weblogs.java.net/blog/felipegaucho/archive/hudson1.png"
width="875" height="366" />

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

hudson2.png src="http://weblogs.java.net/blog/felipegaucho/archive/hudson2.png"
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 java.net 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 !

Comments

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...