6

我有一个 svn 存储库,用于使用 svn+ssh 协议签出。它有一些 EXTERNALS 用 svn+ssh URL 引用它自己。

我离开这个项目有一段时间了,直到今天。当我尝试访问 svn+ssh url(几个月前曾经工作过)时,我收到了消息svn: No repository found in 'svn+ssh://my-correct.hostname.com/the/right/path/to/the/repository。我仔细检查了,路径和主机名都是正确的。

我尝试在使用file://URL 托管 repo 的机器上检查它,它成功了,直到它必须检查 EXTERNALS,它在该No repository消息中失败。我在本地和远程使用相同的用户。

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

4

4 回答 4

2

感谢您向我介绍 strace。我使用 strace 来调试命令的原因:

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

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

Host HOSTNAME

要使用 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”还是“hostname”传递给 ssh,这都会导致应用特定于主机的设置。

于 2014-01-11T20:56:26.507 回答
1

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

svn propedit svn:externals path/to/dir

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

于 2011-03-14T12:42:54.613 回答
1

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).

于 2011-03-14T15:04:31.337 回答
0

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

于 2018-02-02T22:20:43.613 回答