Subversion Write-through proxying 配置时若未加载 proxy 和 proxy_http 模块时的错误提示

当缺少 proxy module 时的错误提示:

svn: E175002: Commit failed (details follow):
svn: E175002: Server sent unexpected return value (405 Method Not Allowed) in response to MKACTIVITY request for '/svn/sandbox/!svn/act/636a31b0-647e-4434-9659-00320a49ed55'

当缺少 proxy_http module 时的错误提示:

仅在 master server 是 http 或 https 协议时,也就是说 SVNMasterURI 是 http 或 https 时需要 proxy_http 模块,不过要做 write-through proxying 也只能是 http 或 https 协议。
svn: E175002: Commit failed (details follow):
svn: E175002: Server sent unexpected return value (500 Internal Server Error) in response to MKACTIVITY request for '/svn/sandbox/!svn/act/aee0aec9-db38-46bf-bc98-4928580201a5'

记下这些错误提示,或许可以帮助到别人。

关于 Write-through proxying 请阅读 Subversion 文档

Advertisements

#apache, #subversion

svn: E175002: 服务器发送了意外的返回值(502 Bad Gateway),在响应 “COPY” 的请求 “……” 中

当利用 mod_proxy 把 Subversion 服务运行于 Apache 反向代理服务器之后时,你会在执行 svn copy(和 move)时得到如下错误:

$ svn cp https://proxy-host.com/svn/sandbox/trunk/ https://proxy-host.com/svn/sandbox/branches/test -m “test copy”
svn: E175002: 服务器发送了意外的返回值(502 Bad Gateway),在响应 “COPY” 的请求 “/svn/sandbox/!svn/rvr/12/trunk” 中

$ env LC_ALL=en_US.UTF-8 svn cp https://proxy-host.com/svn/sandbox/trunk/ https://proxy-host.com/svn/sandbox/branches/test -m “test copy”
svn: E175002: Server sent unexpected return value (502 Bad Gateway) in response to COPY request for ‘/svn/sandbox/!svn/rvr/12/trunk’

经查得知是 DAV module 相关的问题,也得到一解决方案: Subversion behind an Apache Reverse Proxy ,通过在具体运行 Subversion 服务的 Apache 上添加了如下配置解决了问题:

RewriteEngine On
RewriteCond %{HTTP:Destination} .+/(svn/.*$)
RewriteRule ^/svn/.* - [E=MyDestination:http://svn-host/%1,PT]
RequestHeader set Destination %{MyDestination}e env=MyDestination

#apache-http-server, #subversion

Subversion 1.7 的 WC 结构变化后 svn info 输出的变化

Subversion 1.6:
$ svn info
路径: .
URL: https://example.com/svn/foobar/trunk
版本库根: https://example.com/svn/foobar
版本库 UUID: 45048e1e-2893-e011-ba6f-00163e041e7a
版本: 297
节点种类: 目录
调度: 正常
最后修改的作者: jobs
最后修改的版本: 297
最后修改的时间: 2011-10-23 01:53:47 +0800 (日, 2011-10-23)

Subversion 1.7:
$ svn info
路径: .
工作副本根目录: /Users/jobs/Documents/workspace/foobar
URL: https://example.com/svn/foobar/trunk
版本库根: https://example.com/svn/foobar
版本库 UUID: 45048e1e-2893-e011-ba6f-00163e041e7a
版本: 297
节点种类: 目录
调度: 正常
最后修改的作者: jobs
最后修改的版本: 297
最后修改的时间: 2011-10-23 01:53:47 +0800 (三, 2011-10-23)

svn info 的输出中确实是多出一个“工作副本根目录”。

#subversion

操作系统时间不正确导致的 Jenkins svn 取出失败

我的 Subversion 服务器 http://192.168.0.10/svn 是通过 Write-through proxying 建立的一个 slave server。在 slave 服务器操作系统时间偏移过大的时候,jenkins 从 svn 取出数据时失败了,错误日志如下:

Started by user blah
Cleaning workspace /usr/local/jenkins/jobs/blah-project/workspace
Checking out http://192.168.0.10/svn/blah/trunk
ERROR: Failed to check out http://192.168.0.10/svn/blah-project/trunk
org.tmatesoft.svn.core.SVNException: svn: REPORT of /svn/blah-project/!svn/vcc/default: 500 Internal Server Error (http://192.168.0.10)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
	at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getDatedRevision(DAVRepository.java:205)
	at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:477)
	at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:879)
	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:83)
	at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:135)
	at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:747)
	at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:728)
	at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:712)
	at hudson.FilePath.act(FilePath.java:758)
	at hudson.FilePath.act(FilePath.java:740)
	at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:705)
	at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:654)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1184)
	at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:537)
	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:425)
	at hudson.model.Run.run(Run.java:1376)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:466)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:175)
Caused by: org.tmatesoft.svn.core.SVNErrorMessage: svn: REPORT of /svn/blah/!svn/vcc/default: 500 Internal Server Error (http://192.168.0.10)
	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:430)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.readError(HTTPRequest.java:286)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:211)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:364)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:285)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:276)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:264)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:266)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:257)
	at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getDatedRevision(DAVRepository.java:198)
	... 20 more
WARNING: clock of the subversion server appears to be out of sync. This can result in inconsistent check out behavior.
Finished: FAILURE

#jenkins, #subversion