svn 存储库停止与 svn+ssh 一起工作(但在服务器本地工作)

发布于 2024-10-21 23:56:39 字数 413 浏览 5 评论 0原文

我有一个 svn 存储库,用于通过 svn+ssh 协议签出。它有一些外部文件通过 svn+ssh URL 引用自身。

直到今天我才离开这个项目一段时间。当我尝试访问 svn+ssh url(几个月前可以使用)时,我收到消息 svn: Norepository find in 'svn+ssh://my- Correct.hostname.com/the/right /路径/到/存储库。我仔细检查了一下,路径和主机名都是正确的。

我尝试使用 file:// URL 在托管存储库的计算机上检查它,它成功了,直到它必须检查 EXTERNALS,它失败并显示 No repository消息。我在本地和远程使用相同的用户。

我应该在哪里查找日志/调试信息来解决此问题?

I had an svn repository that I used to checkout with the svn+ssh protocol. It has some EXTERNALS in it that refer to itself with the svn+ssh URL.

I was off this project for a while until today. When I try to access the svn+ssh url (that used to work some months ago) I get the message svn: No repository found in 'svn+ssh://my-correct.hostname.com/the/right/path/to/the/repository. I double checked, and both the path and the hostname are correct.

I tried to check it out on the machine hosting the repo using a file:// URL, and it succeeded until it had to checkout the EXTERNALS, where it failed with the No repository message. I used the same user locally and remotely.

Where should I look for logs/debug information to solve this issue?

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

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

发布评论

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

评论(4

允世 2024-10-28 23:56:39

感谢您向我介绍 strace。我使用 strace 来调试为什么命令:

svn+ssh://HOSTNAME/path/to/svn/directory

无法识别 ~/.ssh/config 中的这一行:

Host HOSTNAME< /code>

要使用 strace,请在 ~/.subversion/config 的 [tunnels] 部分中。我将其更改为:

ssh = ssh -o ControlMaster=no

更改为:

ssh = strace -o tmp ssh -o ControlMaster=no

然后我运行了以下命令:

svn list svn+ssh://HOSTNAME/path/to/svn/directory

查看进入文件“tmp”的 strace 输出,我可以看到“HOSTNAME”作为“主机名”传递给 ssh 命令”。快速解决方法是将 ~/.ssh/config 中的这一行:

Host HOSTNAME

更改为:

Host HOSTNAME hostname

这会导致应用主机特定设置,无论名称如何主机的名称作为“HOSTNAME”或“主机名”传递给 ssh。

Thanks for introducing me to strace. I used strace to debug why the command:

svn+ssh://HOSTNAME/path/to/svn/directory

will not recognize this line in ~/.ssh/config:

Host HOSTNAME

To use strace, in the [tunnels] section of ~/.subversion/config. I changed this:

ssh = ssh -o ControlMaster=no

to this:

ssh = strace -o tmp ssh -o ControlMaster=no

Then I ran this command:

svn list svn+ssh://HOSTNAME/path/to/svn/directory

Looking at the output of strace that went into file "tmp" I could see that "HOSTNAME" was passed to the ssh command as "hostname". The quick fix was to change this line in ~/.ssh/config:

Host HOSTNAME

to this:

Host HOSTNAME hostname

Which causes the host specific settings to be applied whether the name of the host is passed to ssh as "HOSTNAME" or "hostname".

咽泪装欢 2024-10-28 23:56:39

我不知道在哪里可以找到日志,但我认为您可以使用以下命令删除/更改该目录中的外部属性:

svn propedit svn:externals path/to/dir

请参阅:
http://svnbook.red-bean.com/en/1.0/ch07s03.html

I don't know where you can find the logs but I think you could remove/change the the externals property in that directory with this command:

svn propedit svn:externals path/to/dir

see:
http://svnbook.red-bean.com/en/1.0/ch07s03.html

凝望流年 2024-10-28 23:56:39

我找到了出路。我写在这里供以后参考。

编辑:事实证明,一位同事在没有通知的情况下修改了该文件。然而找到问题的原因却比理想的情况要困难。

长话短说:即使我使用了 url svn+ssh://my- Correct.hostname.com/the/right/path/to/the/repository ,在服务器上查找的真实路径是/var/svn/the/right/path/to/the/repository。确实是一条错误的道路。但我认为我为找到此问题所做的步骤可能对其他人有用,因此我将在这里报告它们。

首先,我将(在服务器上) /usr/bin/svnserve 移动到 /usr/bin/svnserve.orig 并将我自己的 svnserve 包含以下内容:

#!/bin/bash
strace -o /tmp/svntrace /usr/bin/svnserve.orig $@ | tee /tmp/svnserve-out

然后我再次运行结帐,然后 /tmp/svntrace<服务器上的 /code> 的尾部包含我解决问题所需的所有信息。

似乎在文件 /var/svn/svnwrapper.sh 中,使用 -r 选项设置了 svn 的新根。删除后,一切都像魅力一样。

我仍然无法理解发生了什么(它过去曾经有效,我几乎确定我没有改变任何东西)。

I found my way through. I'm writing it here for future reference.

EDIT: It turns out a fellow colleague modified that file without notifying. Yet finding the cause of the problem was more difficult than ideal.

Long story short: even if I used the url svn+ssh://my-correct.hostname.com/the/right/path/to/the/repository the real path looked up on the server was /var/svn/the/right/path/to/the/repository. A wrong path indeed. But I think that the steps I did to find this might be useful to others, so I'll report them here.

First I moved (on the server) /usr/bin/svnserve to /usr/bin/svnserve.orig and put my own svnserve with these contents:

#!/bin/bash
strace -o /tmp/svntrace /usr/bin/svnserve.orig $@ | tee /tmp/svnserve-out

Then I run my checkout again, and after that /tmp/svntrace on the server had in its tail all the info I needed to troubleshoot the problem.

It seems that in the file /var/svn/svnwrapper.sh a new root for svn was set with the -r option. After removing that all worked like a charm.

I still can't understand what happened (it used to work in the past and I'm almost sure I didn't change anything).

羅雙樹 2024-10-28 23:56:39

strace 帮助隔离了问题。我的存储库位于 /var/svn/repos 但跟踪显示它无法找到 /repos/format。我在 /repos 处添加了一个指向 /var/svn/repos 的符号链接,它再次开始工作。

strace helped isolate the issue. My repository was located at /var/svn/repos but the trace showed that it failed to find /repos/format. I added a symbolic link at /repos pointing to /var/svn/repos and it started working again.

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