29

I've updated the Subversion plugin of jenkins to version 2.2

Now i get following error for repos which build the first time after the upgrade and for repos where something within an external changed. It works for all other builds as expected.

I tried to add additional credentials but this did not help.

Now i hope someone has an idea what else can be tried to fix this annyoing issue.

The error:

hudson.util.IOException2: revision check failed on http://XXX/svn/XXX/Website/Config/trunk
    at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:189)
    at hudson.scm.SubversionChangeLogBuilder.run(SubversionChangeLogBuilder.java:132)
    at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:738)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:899)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:671)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
    at hudson.model.Run.execute(Run.java:1670)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:231)
Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: OPTIONS /svn/XXX/Website/Config/trunk failed
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:384)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:373)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:361)
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:707)
    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:1020)
    at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:180)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:118)
    at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:148)
    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:20)
    at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1238)
    at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
    at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:967)
    at org.tmatesoft.svn.core.wc.SVNLogClient.doLog(SVNLogClient.java:872)
    at hudson.scm.SubversionChangeLogBuilder.buildModule(SubversionChangeLogBuilder.java:177)
    ... 11 more
Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: 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:185)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:694)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:382)
    ... 29 more
mikepenz
  • 12,708
  • 14
  • 77
  • 117
  • 1
    it seems that more and more people get this issue after the upgrade. here's another official bug report for this error: https://issues.jenkins-ci.org/browse/JENKINS-21785 – mikepenz Mar 13 '14 at 09:38
  • Before the "credentials error", the log shows `Caused by: org.tmatesoft.svn.core.SVNCancelException: svn: E200015: OPTIONS /svn/XXX/Website/Config/trunk failed`. – Clifford Mar 14 '14 at 13:40
  • 1
    it can checkout the source. but it fails when it tries to retrieve the changelog. – mikepenz Mar 15 '14 at 10:55
  • @mikepenz Hey...We are also facing the same issue. Were youb able to resolve this one? Please have a look at https://stackoverflow.com/questions/52810210/svn-e200015-authentication-cancelled-jenkins for more details. – CK5 Oct 15 '18 at 09:59

5 Answers5

22

Ok after many comments on the official bug report we were able to solve this issue.

So to get it working you have to update to the newest 2.3-snaptshot of the subversion plugin, which can be found here:

https://jenkins.ci.cloudbees.com/job/plugins/job/subversion-plugin/

(Download the .hpi file and install it on your jenkins)

  1. After that you have to fix your build. I've written a small tutorial on how you can do this here.
  2. open the build configuration
  3. scroll down to the source-code-management section
  4. click on the "Add additional credentials..." button
  5. define as realm the specific identifier for our svn server --> (<prot://ip:port > Company Subversion Repository)
    • if it should work for a different svn you need to use the realm of this server
    • checkout a repo on this server via the command-line --> svn --username {username} --password {password} checkout prot://ip:port/svn/repo <-- you can cancel this after it has started the checkout
    • read all realms available on your mac with this cmd --> find ~/.subversion/auth/svn.simple/ -type f -exec cat {} + | grep -A 2 realmstring
      • there's also another option to get the realmstring. on a pc which was not connected to the svn before, do the following in the therminal: "svn info prot://ip:port/pathtorepo" --> this will output something like "Authentication realm: Company Subversion Repository"
  6. select the credentials --> buildmaster/****** (<prot://ip:port> Company Subversion Repository)

NOTE : If you are using svn+ssh, your realm would look like "svn+ssh://server-name" without double-quotes. No pointy brackets, port or realm name needed.

  1. save and be happy!
Channy
  • 43
  • 5
mikepenz
  • 12,708
  • 14
  • 77
  • 117
  • 3
    Just a note that the realm that I needed to enter was " VisualSVN Server" – Rocklan Apr 22 '14 at 02:18
  • @LachlanB it depends on whats your SVN-Sever setup it always follows the same pattern for us it was <[protocol]://[ipadress]:[port]> SVN Server Name. If you understand this principe it's really straight forward but yeah no-one really knew how to fix this issue until we found out that the update of the subversion plugin requires this new configuration – mikepenz Apr 22 '14 at 06:57
  • I wonder when the Jenkins team finally comes up with a fix, so this bullsh*t workaround is no longer necessary. I've used relative externals to bypass this issue before, but that doesn't seem to be sufficient anymore. All other SVN software works fine with a single set of credentials for externals in the same repository, so Jenkins should be able to do the same. – Tom Lint Nov 08 '14 at 14:46
  • @TomLint i think never, because now it works as it should work :D. Perhaps using GIT is a better solution :P (it won't have externals but yeah pretty love git since switching many many projects) – mikepenz Nov 09 '14 at 19:54
  • https://jenkins.ci.cloudbees.com/job/plugins/job/subversion-plugin/336/org.jenkins-ci.plugins$subversion/ the link does not exists – RCBian Aug 04 '15 at 12:14
  • 1
    @RCBian this build is not available anymore. you can simple update to the latest version of the plugin – mikepenz Aug 04 '15 at 13:10
  • for someone looking for basic help on adding credentials to SVN via pipeline declarative syntax see https://stackoverflow.com/questions/36881132/checkout-svn-with-credentials-in-jenkins-pipeline – AdamE Apr 17 '23 at 23:36
3

I had same error. Since the svn repo was password protected. when I add the credential and use it for svn check out, it works fine.

enter image description here

karim
  • 15,408
  • 7
  • 58
  • 96
1

I was getting the exactly same exception and it was because of using build parameter in repository path, e.g.:

http://reposerver/svn/project/${SVN_BRANCH}

even in case ${SVN_BRANCH} was correctly set to 'trunk' It was not working

when I changed repository path to:

http://reposerver/svn/project/trunk

everything works fine now

This issue occurred after upgrading svn plugin from 1.54 to 2.2, so it looks like there is some bug in new version of svn jenkins plugin

martinsefcik
  • 346
  • 9
  • 20
1

I'd like to emphasize a point in mikepenz' answer: In the text field Realm of your job configuration (after clicking Add additional credentials...) you don't enter merely your SVN realm but your realm and the complete URL of your external repo. This tripped me up.

So this part of your job config ends up looking like this:

enter image description here

Edit:

As it turns out, the above did not improve the situation: The credential error still occurred and moreover commits to external repos did not trigger Jenkins to build the software.

I followed the recommendation here (that also mentions security concerns with the approach described above) and used modules in Jenkins for my external repositories.

This is how my module configuration looks for an external repo:

jenkins external repo as module

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
0

When you update subversion plugin, you should do one of the below.

  • Clean of the up jenkins Workspace because metainfo is related to old version of subversion

or

  • Update Work-space manually, it prompts you to update version of client click yes
Guru
  • 419
  • 4
  • 13
  • Hey. Thanks for your answer. Can you please give a bit more detailed info on how i can fix this? I tried to delete the workspace for a project tried to build (after updating one external) and it failed again with the same error message. Thanks! – mikepenz Feb 28 '14 at 09:50
  • Check for SVN -Version on client machine and update it, or go to Manage Jenkin->select subversion release version matching to client. – Guru Feb 28 '14 at 16:56
  • hopefully this one will work, if not Google it around same jenkins or do manuall check out and save svn credentials in slave box. – Guru Feb 28 '14 at 17:38
  • and also try write shell script command to do svn checkout and see the difference. – Guru Feb 28 '14 at 17:39
  • the strange thing is that it's working the second time if i try to build again. and it is just not working if there's an update in one of the externals – mikepenz Mar 01 '14 at 19:22
  • You already said the answer..the problem is with .svn files under your work space so you have to investigate and see where is mismatching meta info of svn. Until you figure it out the solutions use clean up work space option before build it will not give a trouble – Guru Mar 02 '14 at 02:09
  • Yeah it would be great if it would work with fresh out a clean copy each time. but even with this option we get the same error. it's really strange. and we don't have any ideas what we should try else. – mikepenz Mar 02 '14 at 17:45
  • i've found that for externals i have to set additional credentials even if they are on the same svn server. but what should i set for the realm value? – mikepenz Mar 03 '14 at 10:54
  • Lets try one more thing.. there would be .subversion/XXX security file storing passwords and usernames in Linux box and delete that file and try it(backup before doing it).. and try this one use same Jenkins and connect to different Linux box and try to do SVN checkout using jenkins and manuall press.. – Guru Mar 03 '14 at 17:11
  • in my /var/lib/jenkins/.subversion isn't a security file just default config and default servers file. i even tried to delete this one. but no change. – mikepenz Mar 04 '14 at 07:26
  • Did you resolve this @mikepenz ? I have exact same problem since upgrade – sipickles Mar 10 '14 at 16:11
  • No i still haven't found a solution :/ if you find something please let me know – mikepenz Mar 10 '14 at 20:16
  • Previously we too had it..but stopped using plugin and started using shell script to check out .. – Guru Mar 11 '14 at 02:11
  • 1
    It should not be the solution to stop using the official jenkins subversion plugin just to get it working. there should be a fix from the plugin-devs. It's kinda strange. Perhaps you have a hint what i could try for the additional credentials. i'm not sure what i could try for the field realm. there's nowhere a real doc if it supports wildcards etc... – mikepenz Mar 11 '14 at 07:27