0

I'm completely stumped by an SVNKit (1.8.5) error that I'm running in to. I'm using the following pattern to build up an Authentication Manager:

public static SVNRepository getSvnRepository(String userName, String pass, String repoURL) throws SVNException
{
      SVNRepository repository;
      repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(repoURL));
      ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(userName, pass);
      repository.setAuthenticationManager(authManager);

      return repository;
}

I use this pattern in several places to make sure that the user can authenticate against the repository, to get a listing of all of the folders in the repository, and even to explore the top level of the subfolders in order to parse a file and build up a dependency graph. All of this succeeds.

But when I attempt to run a checkout, I get an authentication error. Puzzlingly, this error only happens on one computer at our office. Several other computers all running OS X, Windows, and various versions of Ubuntu take no issue with this process and can check out no problem but one particular computer running Ubuntu 12.10 fails hard trying to run the following:

SVNRepository repository = getSvnRepository(userName, pass, url + "/" + subfolder);
SvnOperationFactory factory = new SvnOperationFactory();
SvnCheckout checkout = factory.createCheckout();
checkout.setSource(SvnTarget.fromURL(repository.getLocation()));
checkout.setSingleTarget(SvnTarget.fromFile(location.resolve(project).toFile()));
checkout.run();

The stack trace:

org.tmatesoft.svn.core.SVNAuthenticationException: svn: E170001: Authentication required for '<https://[snip]:443>'
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVNErrorManager.java:47)
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.authenticationFailed(SVNErrorManager.java:41)
        at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getFirstAuthentication(DefaultSVNAuthenticationManager.java:186)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:682)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:371)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:359)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:710)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:627)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:102)
        at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1032)
        at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:175)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:118)
        at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:182)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:45)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.checkout(SvnNgAbstractUpdate.java:756)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:16)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgCheckout.run(SvnNgCheckout.java:10)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
        at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
        at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1149)
        at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
Doug Stephen
  • 7,181
  • 1
  • 38
  • 46
  • Maybe on that particular machine, there is existing (and incorrect) authentication information in the `~/.subversion` folder, and your `DefaultSVNAuthenticationManager` instance tries to use that? See also the answer for this question: http://stackoverflow.com/questions/24403997/svnkit-use-of-auth-folder?rq=1 – Akos Bannerth Oct 03 '14 at 07:15
  • I am facing the same issue on a Windows 7 machine. On this machine Eclipse, Ant, and svn command line can access the svn server at "https:" with no issues. Interestingly, other workstations work fine. The stacktrace is not that useful. Has anyone have any debugging suggestions? – Josef.B Mar 18 '15 at 13:54
  • Update: I found something that helped my issue on Windows, kind of: http://subversion.1072662.n5.nabble.com/SVN-authentication-problem-td1560.html I had to add a jvm argument: -Dsvnkit.http.methods=Basic,Digest,Negotiate,NTLM – Josef.B Mar 18 '15 at 17:06

0 Answers0