The Hudson was building all projects without any issues since it was installed. All of a sudden yesterday my inbox was filled with failure reports, Hudson was not able to build any of the projects. Logs were having stacktrace like mentioned below-
ERROR: svn: authentication cancelled
org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled
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.getNextAuthentication(DefaultSVNAuthenticationManager.java:200)
at hudson.scm.FilterSVNAuthenticationManager.getNextAuthentication(FilterSVNAuthenticationManager.java:42)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:537)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:273)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:261)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:516)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:98)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1001)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.testConnection(DAVRepository.java:97)
at hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(SubversionSCM.java:1686)
at hudson.scm.SubversionSCM.repositoryLocationsExist(SubversionSCM.java:1826)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:506)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:469)
at hudson.model.AbstractProject.checkout(AbstractProject.java:898)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:391)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:340)
at hudson.model.Run.run(Run.java:1090)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:301)
at hudson.model.ResourceController.execute(ResourceController.java:93)
at hudson.model.Executor.run(Executor.java:122)
Skipping sonar analysis due to bad build status FAILURE
Finished: FAILURE
The stack trace talks about authentication cancellation not failure, which is quite strange. I still thought that it might be an authentication failure and tried to authenticate against SVN server using same credentials as used by Hudson. Authentication was successful using various methods (browser, command line client, TortoiseSVN). Google search did not provided any relevant information and I was running out of clues :-(
After putting lots of pondering I remembered that day before I did a manual (from console) project checkout on the same machine and during checkout svn client (1.6.4) asked to save the password and I said 'no'. Will that make any difference? I think it should not.
Just for the sake of trial I deleted the '~/.subversion' directory and did a Hudson build after that. Now Hudson was able to do SVN checkout/update and build project. After several trials, I concluded that if password is not saved during manual checkout, Hudson will fail with above-mentioned error. Though it will wok fine if password was saved. Another observation was that Hudson SVN client (SVNKit 1.3.0) does not create '~/.subversion/auth', while 'svn' command does, irrespective of one chooses to save the password or not.
Though I do not know why Hudson (SVNKit) cancels the SVN authentication but removing the '~/.subversion' directory solves the issue.
Saturday, August 15, 2009
Hudson: svn authentication cancelled
Subscribe to:
Post Comments (Atom)

10 Comments:
thanks a lot, you just saved me some time.
Thanks!
Although, it makes me wonder why things were working fine before... all of my builds failed this morning without any changes to the workspace or job setting... just running them again fixed the issue... very strange.
Thanks a ton Vinod. This helped me save a lot of time. Was wondering what had gone wrong and was even thinking of re-installing hudson!!
I was trying to write a ant script to checkout code from svn.I did got a similar error something like
checkout:
[svn] started ...
[svn] svn: authentication cancelled
[svn] svn: authentication cancelled
[svn] failed !
dont know where can I find ~/.subversion directory to delete it.I am trying to checkout for the very first time and its failing.However when trying the same credentials via TortoiseSVN ,it goes without any error.I am kind of new to this and urgent help is needed.
Thanks
~/ means current user's home directory.
I get the same error. But I don't see a .subversion directory under ~/ . Please help
I'm having the same problem, but deleting the .subversion directory doesn't solve the problem. This seems like a fundamental flaw in hudson which makes it unusable for me, I'm going to have to look for a different CI build tool. Can't believe this HUGE bug has been outstanding for over 3 years and they haven't bothered fixing it.
1. Make sure you update the credentials in the job configs / (you may want/need to override global settings)
2. check log on svn server to find our which user is being used
3. There is no need to delete the .subversion directory of the user hudson is running with. The clearing the subfolder "auth" of all contained files is sufficient.
Clearing auth is not a sane option as well as erasing whole ~/.subversion.
I've looked inside of the auth files after this bug was hit and i see that passwd information is missing, i.e. hudson erased it (in direct or indirect way).
after commands like:
chown root -R ~hudson/.subversion/auth/svn.simple;
chmod 755 ~hudson/.subversion/auth/svn.simple;
chmod 644 ~hudson/.subversion/auth/svn.simple/*
i haven't observed this issue again.
Post a Comment