我们已经使用VisualSVN (标准版)几年了,没有任何问题。我们有一个在SVN中存储数据的C#应用程序。使用SharpSvn (https://sharpsvn.open.collab.net)库访问SVN。有时,应用程序会执行服务器端SVN COPY命令(SharpSvn的"RemoteCopy"),以基于存储库文件中现有的一系列分支来创建分支。
我们最近将VisualSVN从版本2.5.2更新到了3.2.2,还购买了一个许可证来解锁该产品的企业特性。我们启用了集成的Windows身份验证,但也保留了基本身份验证以实现向后兼容。
在运行了一周没有任何问题(仅从SVN执行读取)后,我们的应用程序第一次尝试执行复制,但失败了,并出现以下错误,报告其中一个必须复制的文件:
“'/svn/repository/!svn/rvr/12345/trunk/file.xml‘上的复制请求失败: 501方法未实现”
服务器日志显示以下信息:
Level,Date and Time,Source,Event ID,Task Category
Error,2015-03-03 9:37:26 AM,VisualSVN Server 3.2,1001,Apache,"Multi-author commits not supported. [501, #175002] [client 192.168.1.100]"
Error,2015-03-03 9:37:26 AM,VisualSVN Server 3.2,1001,Apache,"Could not fetch resource information. [501, #0] [client 192.168.1.100]"
Error,2015-03-03 9:37:26 AM,VisualSVN Server 3.2,1001,Apache,"SSPI Challenge failed: The token supplied to the function is invalid [client 192.168.1.100]"
Error,2015-03-03 9:37:21 AM,VisualSVN Server 3.2,1001,Apache,"SSPI Challenge failed: The token supplied to the function is invalid [client 192.168.1.100]"重新启动VisualSVN服务后,命令完成,没有任何问题。在旧版本的VisualSVN中,这种情况从未发生过。
下面是我们使用SharpSvn创建分支的方法:
private static void Branch(ICollection<SvnUriTarget> sources, Uri targetUri, string comment, string userName, string password)
{
if (sources == null) throw new ArgumentNullException("sources");
if (targetUri == null) throw new ArgumentNullException("targetUri");
if (comment.IsNullEmptyOrSpaces()) throw new ArgumentNullException("comment");
if (userName.IsNullEmptyOrSpaces()) throw new ArgumentNullException("userName");
if (password.IsNullEmptyOrSpaces()) throw new ArgumentNullException("password");
using (var client = new SvnClient())
{
client.Authentication.Clear();
client.Authentication.DefaultCredentials = new NetworkCredential(userName, password);
client.Authentication.SslServerTrustHandlers += (sender, e) => { e.AcceptedFailures = e.Failures; e.Save = true; };
SvnCommitResult commitResult;
if (!client.RemoteCopy(sources, targetUri, new SvnCopyArgs { CreateParents = true, LogMessage = comment }, out commitResult))
throw new ApplicationException("Failed to create tag/branch in Repository");
}
}在我们的应用程序中,我们仍然使用基本身份验证,并将凭据显式传递给每个SharpSvn调用。应用程序向用户请求凭据,然后使用这些凭据执行一次"Branch“方法调用。两个不同的用户尝试在两台不同的机器上使用自己的凭据执行此操作,但结果相同。只有重新启动VisualSVN服务才能解决此问题。我担心这个问题可能会再次出现...
发布于 2015-03-05 23:48:41
如果您要为操作指定凭据,则应禁用SharpSvn (和Subversion)以使用集成身份验证('ntlm‘和'negotiate')。
尝试像这样添加代码:
client.Configuration.SetOption("servers", "global", "http-auth-types", "basic");这可能是Subversion、SharpSvn或serf中的错误,但建议的解决方法应该可以工作。
https://stackoverflow.com/questions/28865431
复制相似问题