Hudson 无法访问 Subversion(svn:服务器拒绝连接)

发布于 2024-10-04 10:24:22 字数 1759 浏览 3 评论 0原文

在装有 Vista 32Bit SP2(激活 UAC、激活防火墙的 Kaspersky Security Suite)的 PC 上,我设置了 Subversion 服务器(使用 SlikSVN 安装程序 1.6.13)、Tomcat 7.0、Java 6u21 和 Hudson 1.386。我使用 Firefox 3.6 ("http://localhost:8080/hudson") 通过 http 接口访问 Hudson。我下载了一个简单的演示存储库并启动了 subversion 服务器,添加了存储库。当命令

“svn列表 svn://localhost/gameoflife/trunk"

服务器会打印出列表。我也可以通过在 Windows 资源管理器中右键单击其文件夹来使用 TortoiseSVN 访问存储库。一切似乎都已设置完毕但以下两件事不起作用:

  1. 在浏览器中输入 "svn://localhost/gameoflife/trunk" 浏览器请求他是否应该使用 TortoiseSVN 打开它,但同意后,TortoiseSVN无法连接(“被服务器拒绝”)。

  2. 更重要的是,我的问题的原因是Hudson无法连接到SVN构建日志显示。 “错误:无法签出 svn://localhost/gameoflife/trunk” 项目配置抱怨无法访问存储库 URL“svn://localhost/gameoflife/trunk”( “svn:连接被服务器拒绝”)并建议添加授权信息。但我还没有在svn服务器上设置用户或密码。我已将 Hudson Subversion 插件从 1.20 更新到 1.21,但这并没有改变任何东西。禁用防火墙并没有改变任何东西。

我非常确定在设置构建服务器时我严格遵循了详细的分步说明,但由于我既不是 Subversion 也不是 Hudson 的专业人士,所以我现在陷入了困境。因此我的问题是:Hudson 无法访问 Subversion 的原因是什么?我怎样才能让它工作?

更新:我确保 Vista 的主机文件中包含“127.0.0.1 localhost”(但即使输入 127.0.0.1 而不是 localhost,URL 也不起作用)。我检查了端口 3690 没有被防火墙阻止。我的错误消息没有说明它有身份验证错误,也没有说明服务器主动拒绝连接。这与输入不存在的 URL 时收到的错误消息相同。如果完全相同的 URL 在控制台提示符下不起作用,我会认为其中有拼写错误,但我仔细检查了几次。这可能是 Vista 的问题,但我仍然找不到解决方案。

更新 2:我越来越确信这一定是我的 Vista 系统(错误)配置方式的副作用。 Hudson 有效,Subversion 有效。但如果两者都在同一台机器上运行,它们将无法一起工作。我能够毫无问题地从 Hudson 内部访问远程 Subversion 服务器。但同一个 Hudson 无法在本地访问 Subversion。当我在类似配置的 Vista-PC 上进行设置时,我重现了“在本地无法协同工作”的行为(主要区别是这次使用 64 位版本以及 Avira 免费软件而不是卡巴斯基)。

我尝试将 Subversion 发行版更换为其他发行版 (VisualSVN-Server 2.1.4),并尝试使用 https 访问它。最初我似乎取得了进展,但现在当要从存储库检索文件时,由于握手错误而失败。

由于我无法找到问题的原因,所以我现在切换到不同的 CI-Build-Tool。尽管如此,还是感谢您投入时间来帮助我。

On a PC with Vista 32Bit SP2 (UAC activated, Kaspersky Security Suite with firewall activated) I have set up a Subversion server (using the SlikSVN installer 1.6.13), a Tomcat 7.0, Java 6u21 and Hudson 1.386. I am accessing Hudson through the http-Interface using Firefox 3.6 ("http://localhost:8080/hudson"). I downloaded a simple demo repo and started the subversion server, adding the repo. When the command

"svn list
svn://localhost/gameoflife/trunk"

is entered at the command prompt the server prints out the list. I can access the repo with TortoiseSVN by right-clicking on its folder at the Windows Explorer, too. Everything seems to be set up correctly. But the following two things don't work:

  1. Entering "svn://localhost/gameoflife/trunk" in the browser. The browser requests whether he should use TortoiseSVN to open it, but after agreeing, TortoiseSVN can't connect ("refused by server").

  2. Much more important and the reason for my question is that Hudson can't connect to the SVN. The build log shows "ERROR: Failed to check out svn://localhost/gameoflife/trunk". The project configuration complains that the repository URL "svn://localhost/gameoflife/trunk" can't be accessed ("svn:connection refused by the server") and suggests to add authorization information. But I haven't set up a user or password on the svn server. I have updated the Hudson Subversion plugin from 1.20 to 1.21, but that didn't change anything. Disabling the firewall didn't change anything.

I am quite sure I followed detailed step-by-step instructions closely when I set up the build server, but being no pro with Subversion nor Hudson I am stuck now. Hence my question: What is the reason Hudson can't access Subversion and how can I make it work?

UPDATE: I made sure that Vista's host file has "127.0.0.1 localhost" in it (but URL doesn't work even when entering 127.0.0.1 instead of localhost). I checked that port 3690 is not blocked by a firewall. My error message doesn't state it has authentication errors, nor does it say that the server actively refuses the connection. It is the same error message one gets when entering a not existing URL. If the very same URL would not work at the console prompt I'd assume I had a typo in it, but I double-checked several times. It might be a Vista problem, but I still can't find the solution.

UPDATE 2: I am more and more convinced it must be a side-effect of the way my Vista system is (mis)configured. Hudson works, Subversion works. But they won't work together if both are running on the same machine. I was able to access a remote Subversion server from within Hudson without a problem. But the same Hudson wasn't able to access Subversion locally. I reproduced the "doesn't work together locally" behaviour when setting it up on a similar configured Vista-PC (main difference using 64 bit versions this time and Avira freeware instead of Kaspersky).

I tried exchanging the Subversion distribution with a different one (VisualSVN-Server 2.1.4) and tried accessing it with https. Initially I seemed to make progress, but now it failed with an handshake error when the files were about to be retrieved from the repo.

Since I can't locate the cause of my problem, I am switching to a different CI-Build-Tool now. Nonetheless thank you for investing your time to help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

忱杏 2024-10-11 10:24:22

首先,你可以以你的Hudson用户(即运行Hudson服务器的用户)身份登录,看看该Hudson用户是否可以访问subversion数据库?

大约 90% 的情况下这会指出问题。这通常是一些小问题,例如错误的路径或错误的身份验证。如果您可以以 Hudson 用户身份从命令行进行签出和构建,那么您应该能够通过 Hudson 来完成此操作。

我知道在Windows上,一个服务器进程可以生成一些服务器用户,该用户无法从命令行登录,但您也可以指定一个真实用户作为服务器过程也。最好使用 Subversion 和 Hudson 来指定真实用户,这样您就可以在必要时进行命令行调试。

听起来您正在尝试通过 Web 浏览器浏览使用 svnserve 服务器的 Subversion 存储库。大多数网络浏览器无法正常处理 svn 协议。

你应该做的是使用类似 ViewVCSventon 用于在网络浏览器中浏览存储库。 Hudson 与这两个包配合得很好,并将其变更报告与这些包集成。单击文件名将显示构建中使用的版本与先前版本之间的差异。

ViewVC使用Python,Sventon是一个Java包。我更喜欢 Sventon,因为它不需要驻留在 Subversion 存储库服务器上。

First of all, can you log in as your Hudson user (i.e., the user who runs the Hudson server), and see if that Hudson user can access the subversion database?

That will point out the problem about 90% of the time. It usually is some minor issue such as a bad PATH or bad authentication. If you can checkout and build from the command line as the Hudson user, you should be able to do it through Hudson.

I know on Windows, a server process can generate some server user which can't be logged in from the command line, but you can also specify a real user as the server process too. It's better with Subversion and Hudson to specify a real user, so you can do command line debugging when necessary.

It sounds like you're trying to browse a Subversion repository which is using the svnserve server with a web browser. Most web browsers can't normally handle the svn protocol.

What you should do is use something like ViewVC or Sventon for browsing the repository in a web browser. Hudson plays nicely with both of these packages and will integrate it's change report with these packages. Clicking on a file name will show you the diffs between the version that was used in the build, and the previous version.

ViewVC uses Python and Sventon is a Java package. I prefer Sventon because it doesn't need to live on your Subversion repository server.

蒗幽 2024-10-11 10:24:22

Hudson 无法使用标准默认值匿名连接到 Windows 7(64 位)上的 svnserve。命令行中添加以下参数成功。

svnserve -d --监听端口 3690 --监听主机 127.0.0.1 -r svn-repos

Hudson could not connect anonymously to svnserve on Windows 7 (64 Bit) with the standard defaults. The following parameters added to the command line were successful.

svnserve -d --listen-port 3690 --listen-host 127.0.0.1 -r svn-repos

倾城泪 2024-10-11 10:24:22

听起来你需要身份验证才能与 subversion 交谈。如果匿名读取对您的公司来说不是问题,我建议您将服务器设置为允许匿名读取请求。

如果出现问题,您可以在 hudson 中输入身份验证详细信息。

如果您使用现代版本,它应该通知您身份验证失败,您需要输入凭据。

It sounds like you need authentication to talk to subversion. If anonymous read isn't a problem for your company I suggest you set up your server to allow anonymous read requests.

If it is a problem you can enter authentication details in hudson.

If your using a modern version it should inform you authentication has failed and you need to enter credentials.

甲如呢乙后呢 2024-10-11 10:24:22

尝试使用 telnet (telnet localhost 3690) 连接到端口 3690。如果它不起作用,请检查您是否安装了 svnserve 守护程序/服务并且它正在运行。

您是否为 JVM 配置了代理
(在 Windows 上这可以用 Java 完成
控制面板,默认情况下是 Internet
使用资源管理器设置)。如果是这样,
尝试禁用代理。

这两个技巧取自 http: //old.nabble.com/SVN-protocol.-Connection-refused-by-the-server-tt22481558.html#a22481558

最后一条评论说:

...我只是好奇为什么这样的行为
SVNKit 和命令行 SVN 有何不同?

Try to connect to port 3690 using telnet (telnet localhost 3690). If it doesn't work, check that you have svnserve daemon/service installed and that it is running.

Do you have proxy configured for JVM
(on Windows this could be done in Java
Control Panel, and by default Internet
Explorer settings are used). If so,
try disabling proxy.

These two tips are taken from http://old.nabble.com/SVN-protocol.-Connection-refused-by-the-server-tt22481558.html#a22481558

The last comment says:

... I'm just curious why behaviour of
SVNKit and command line SVN differs?

梦在深巷 2024-10-11 10:24:22

其他解决方案...

svn 服务器仅响应 ipv6... 我无法解释为什么,我既不是 Windows 也不是网络专家,但它可以工作...

我的 /windows/system32/drivers/etc/hosts:

127.0.0.1       localhost4
::1             localhost6
::1             local-svn
127.0.0.1       local-tomcat

我访问 svn使用 svn://local-svn//trunk/...
我使用 http://local-tomcat:8080/ 访问 tomcat

尝试使用 ipv6 访问 tomcat 失败。
尝试使用 ipv4 访问 svn 失败。

Other solution...

Svn server only responds to ipv6... I cannot explain why, I am not neither a windows or network guru, but it works...

My /windows/system32/drivers/etc/hosts:

127.0.0.1       localhost4
::1             localhost6
::1             local-svn
127.0.0.1       local-tomcat

I acces svn using svn://local-svn//trunk/...
I access tomcat using http://local-tomcat:8080/

Trying to use ipv6 to access tomcat fails.
Trying to use ipv4 to access svn fails.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文