Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27084

SVN authentication fails using subversion plugin v.2.5

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • subversion-plugin
    • None
    • Windows Server 2008 R2,
      Jenkins 1.599

      We're using username and password over HTTP as authentication to the svn server and the Jenkins service is running as the same user.
      Recently we upgraded the subversion plugin to v2.5 from v2.4.5 and this caused svn authentication to fail with the following error:

      svn: E200015: authentication cancelled
      

      Diving deeper into the cause of this revealed that Jenkins no longer tries to login to the svn server using HTTP clear text authorization (don't know the real name for this) but now tries to use NTLMSSP. Jenkins seems to use the correct username using NTLMSSP but the authentication fails.

          [JENKINS-27084] SVN authentication fails using subversion plugin v.2.5

          Amit Ron added a comment -

          I'm also having this issue, Jenkins 1.600, subversion 2.5.7. configuring -Dsvnkit.http.methods=Basic,NTLM,Negotiate,Digest did not help either... re-entering the credentials did not help either...

          Amit Ron added a comment - I'm also having this issue, Jenkins 1.600, subversion 2.5.7. configuring -Dsvnkit.http.methods=Basic,NTLM,Negotiate,Digest did not help either... re-entering the credentials did not help either...

          Rok Banko added a comment -

          I resolved the issue with subversion plugin 2.6 and setting -Dsvnkit.http.methods=Basic parameter in jenkins.xml file. The first time i included it at the end but the parameter didn't get picked up. You should place it before -jar like ".... -Dsvnkit.http.methods=Basic -jar "%BASE%\jenkins.war".
          I used just basic as I don't need anything else. You will see in System information if it gets picked up after restarting jenkins. Check Manage Settings/System Info and search for "svnkit.http.methods".

          Jenkins ver. 2.7.1 / Subversion 2.6

          Rok Banko added a comment - I resolved the issue with subversion plugin 2.6 and setting -Dsvnkit.http.methods=Basic parameter in jenkins.xml file. The first time i included it at the end but the parameter didn't get picked up. You should place it before -jar like ".... -Dsvnkit.http.methods=Basic -jar "%BASE%\jenkins.war". I used just basic as I don't need anything else. You will see in System information if it gets picked up after restarting jenkins. Check Manage Settings/System Info and search for "svnkit.http.methods". Jenkins ver. 2.7.1 / Subversion 2.6

          Ilguiz Latypov added a comment - - edited

          Setting the svnkit.http.methods property to Basic in both the master and the slave did not make a difference for me.

          The source code of svnkit authentication looks like a maze of protocols, managers and special cases. So I followed someone else's work-around by setting the Jenkins project's SCM to None and using the Cygwin's svn command in the first build step to check out the code. I had to add "--username USER --password PASSWORD" in a one-off invocation of the job to get svn store the credentials in the Jenkins agent's home.

          set svn_opts=--non-interactive --trust-server-cert-failures unknown-ca,cn-mismatch,expired
          if exist .svn\nul ( 
              %cygbinslash%svn.exe update %svn_opts%
          ) else (
              %cygbinslash%svn.exe co %svn_opts% https://SERVER:PORT/svn/REPO/trunk/DIR .
          )
          

          Ilguiz Latypov added a comment - - edited Setting the svnkit.http.methods property to Basic in both the master and the slave did not make a difference for me. The source code of svnkit authentication looks like a maze of protocols, managers and special cases. So I followed someone else's work-around by setting the Jenkins project's SCM to None and using the Cygwin's svn command in the first build step to check out the code. I had to add "--username USER --password PASSWORD" in a one-off invocation of the job to get svn store the credentials in the Jenkins agent's home. set svn_opts=--non-interactive --trust-server-cert-failures unknown-ca,cn-mismatch,expired if exist .svn\nul ( %cygbinslash%svn.exe update %svn_opts% ) else ( %cygbinslash%svn.exe co %svn_opts% https://SERVER:PORT/svn/REPO/trunk/DIR . )

          Hello all,
          I have the same issue with Jenkins 1.609.3 and SVN 2.5.7

          The error is intermittent, it works 50% of the time and when it fails, I get the "org.tmatesoft.svn.core.SVNCancelException: svn: E200015: authentication cancelled". If I retry, it will sometimes pass and complete the build.

          Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: 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.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:149)
          at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:77)
          at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1273)
          at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:172)
          at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:118)
          at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:184)
          at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:45)
          at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:160)
          at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:35)
          at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
          at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
          at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
          at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:968)
          at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:873)
          at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:193)

          Channy Tremblay added a comment - Hello all, I have the same issue with Jenkins 1.609.3 and SVN 2.5.7 The error is intermittent , it works 50% of the time and when it fails, I get the "org.tmatesoft.svn.core.SVNCancelException: svn: E200015: authentication cancelled". If I retry, it will sometimes pass and complete the build. Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: 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.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:149) at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:77) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1273) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:172) at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:118) at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:184) at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:45) at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:160) at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:35) at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21) at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235) at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294) at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:968) at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:873) at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:193)

          Jens Bjerre added a comment - - edited

          I have a similar problem with the twist that util/lib is an http://svnbook.red-bean.com/en/1.7/svn.advanced.externals.html directory under the same subversion server.
          The platform is Linux Ubuntu 16.04.

          No changes for svn+ssh://svn.example.com/util since the previous build
          hudson.util.IOException2: revision check failed on svn+ssh://svn.example.com/util/lib
          at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:208)
          at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:138)
          at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:725)
          at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:860)
          at hudson.scm.SCM.checkout(SCM.java:485)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
          at hudson.model.Run.execute(Run.java:1741)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:410)
          Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: 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.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:149)
          at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:77)
          at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1273)
          at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:172)
          at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:118)
          at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:184)
          at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:45)
          at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:160)
          at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:35)
          at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
          at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
          at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
          at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:968)
          at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:873)
          at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:194)
          ... 12 more
          Archiving artifacts

          Jens Bjerre added a comment - - edited I have a similar problem with the twist that util/lib is an http://svnbook.red-bean.com/en/1.7/svn.advanced.externals.html directory under the same subversion server. The platform is Linux Ubuntu 16.04. No changes for svn+ssh://svn.example.com/util since the previous build hudson.util.IOException2: revision check failed on svn+ssh://svn.example.com/util/lib at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:208) at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:138) at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:725) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:860) at hudson.scm.SCM.checkout(SCM.java:485) at hudson.model.AbstractProject.checkout(AbstractProject.java:1269) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: 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.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:149) at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:77) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1273) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:172) at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:118) at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:184) at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:45) at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:160) at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteLog.run(SvnRemoteLog.java:35) at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21) at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235) at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294) at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:968) at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:873) at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:194) ... 12 more Archiving artifacts

          Hi Jens,

          Try adding "additional credentials" in your job with the realm defined as svn+ssh://svn.example.com with credentials that fit with that server/repo.
          Thanks,
          Channy

          Channy Tremblay added a comment - Hi Jens, Try adding "additional credentials" in your job with the realm defined as svn+ssh://svn.example.com with credentials that fit with that server/repo. Thanks, Channy

          Jens Bjerre added a comment - - edited

          Thank you! That worked but I don't understand why it worked? Didn't I just specify the same credentials again without the specific directory?
          Doesn't it try to use the same credentials when resolving an External?
          And previous versions didn't have this problem.

          Jens Bjerre added a comment - - edited Thank you! That worked but I don't understand why it worked? Didn't I just specify the same credentials again without the specific directory? Doesn't it try to use the same credentials when resolving an External? And previous versions didn't have this problem.

          See JENKINS-21785. It's supposedly a security enhancement on forcing externals to be explicitly defined with their credentials. Not sure why only the changelog calculation is affected and not the actual checkout... It definitely does not use the same credentials as the Repository URL anymore when accessing externals.

          Channy Tremblay added a comment - See JENKINS-21785 . It's supposedly a security enhancement on forcing externals to be explicitly defined with their credentials. Not sure why only the changelog calculation is affected and not the actual checkout... It definitely does not use the same credentials as the Repository URL anymore when accessing externals.

          I'm getting the:

          org.tmatesoft.svn.core.SVNCancelException: svn: E200015: authentication cancelled

          When trying to connect to an Assembla SVN repository via SSH. I am able to connect via HTTP with a username and password but not through SSH. I've tried all of the workarounds listed here with no success.

          Assembla requires that an environment variable called REPO_NAME be set and forwarded for svn+ssh. The environment variable is set and the SendEnv is configured in ~/.ssh/config:

          Host subversion.assembla.com
          SendEnv REPO_NAME

          It works via the command line as the Jenkins user. Will this be send through the subversion plugin in Jenkins?

          John Schroeder added a comment - I'm getting the: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: authentication cancelled When trying to connect to an Assembla SVN repository via SSH. I am able to connect via HTTP with a username and password but not through SSH. I've tried all of the workarounds listed here with no success. Assembla requires that an environment variable called REPO_NAME be set and forwarded for svn+ssh. The environment variable is set and the SendEnv is configured in ~/.ssh/config: Host subversion.assembla.com SendEnv REPO_NAME It works via the command line as the Jenkins user. Will this be send through the subversion plugin in Jenkins?

          Brenden Keyes added a comment - - edited

          For what it's worth, I was getting "svn: E200015: authentication cancelled" because my svn repo was using a self signed cert. I had to add that cert to java's cacerts keystore, using portecle on Windows, and then it worked fine.

          Brenden Keyes added a comment - - edited For what it's worth, I was getting "svn: E200015: authentication cancelled" because my svn repo was using a self signed cert. I had to add that cert to java's cacerts keystore, using portecle on Windows, and then it worked fine.

            recena Manuel Recena Soto
            kamrup Rasmus Pedersen
            Votes:
            10 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated: