jenkins(husdon)检出代码错误
今天碰到了那个问题,那个像幽灵一样的问题,现象描述:
jenkins的job,没有任何人配置,修改,网络环境也没有人动过,突然就不能用了,报出如下错误:
ERROR: svn: authentication cancelled
org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled
全部错误:
Started by user tianhailong Building in workspace /root/.jenkins/workspace/web-query-1.0 Cleaning local Directory . Checking out http://gforge.1verge.net/svn/data_analytics/trunk ERROR: Failed to check out http://gforge.1verge.net/svn/data_analytics/trunk org.tmatesoft.svn.core.SVNException: svn: OPTIONS /svn/data_analytics/trunk failed at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:298) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:283) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:271) at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:533) 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:1011) at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:180) at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:482) at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:876) at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:534) at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:901) at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:84) at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:136) at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:788) at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:769) at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:753) at hudson.FilePath.act(FilePath.java:851) at hudson.FilePath.act(FilePath.java:824) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:743) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:685) at hudson.model.AbstractProject.checkout(AbstractProject.java:1325) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581) at hudson.model.Run.execute(Run.java:1516) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/data_analytics/trunk failed at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:200) at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:146) at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:89) ... 28 more Caused by: org.tmatesoft.svn.core.SVNAuthenticationException: svn: OPTIONS request failed on '/svn/data_analytics/trunk' svn: OPTIONS of /svn/data_analytics/trunk: 403 Forbidden (http://gforge.1verge.net) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:62) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:656) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:292) ... 27 more Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS request failed on '/svn/data_analytics/trunk' at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:200) at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:146) at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:89) at org.tmatesoft.svn.core.SVNErrorMessage.wrap(SVNErrorMessage.java:366) ... 29 more Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS of /svn/data_analytics/trunk: 403 Forbidden (http://gforge.1verge.net) at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:200) at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:181) at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:133) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.createDefaultErrorMessage(HTTPRequest.java:444) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:189) at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:379) ... 28 more FATAL: null java.lang.NullPointerException at java.util.ArrayList.addAll(ArrayList.java:472) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:743) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:685) at hudson.model.AbstractProject.checkout(AbstractProject.java:1325) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581) at hudson.model.Run.execute(Run.java:1516) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236)
查看job配置:
会报svn验证错误:
但是当你输入用户名 密码的时候,它又说是正确的:
验证已通过,用户名、密码以保存,但是返回配置页面却还是错误的。
在谷歌中搜索“jenkins svn: OPTIONS 错误”和“hudson svn checkout Maybe you need to enter credential”(百度无效啊 ╮(╯▽╰)╭),查了好多资料,感觉是svn插件问题
有说是版本问题(我未验证是不是版本问题):
http://stackoverflow.com/questions/8642196/jenkins-build-fails-with-svnexception
有的说是网络问题:
http://serverfault.com/questions/355166/jenkins-missing-scm-options-after-networking-ip-change
Anyone have any ideas of how to fix this? I found some of the old IPs in /var/lib/jenkins/hudson.scm.SubversionSCM.xml and changed them to the new IP and restarted/reloaded, but that did not fix this. The same screen shows up when adding a new job as well. I also noticed there is a .subversion directory in /var/lib/jenkins too.
这个也特别像:
http://issues.hudson-ci.org/browse/HUDSON-4567
后来去插件官网:
https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin
在TroubleShooting找到答案了
最终答案:
Though I do not know why Hudson (SVNKit) cancels the SVN authentication but removing the ‘~/.subversion’ directory solves the issue.
http://blog.vinodsingh.com/2009/08/hudson-svn-authentication-cancelled.html
总结:技术搜索:谷歌靠谱;技术钻研:老外靠谱;到处搜索:不如官网靠谱。 O(∩_∩)O哈哈~