apache Subversion 提交问题:XML 数据格式不正确

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/310703/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 16:58:39  来源:igfitidea点击:

Subversion Commit Problem: XML data was not well-formed

svnapachecommitwebdav

提问by

I'm experiencing a strange behavior of SVN. I've got SVN repository running on Apache 2.2.9 with mod_dav, mod_dav_svn and SVN 1.5.2. When I try to check out (from remote 1.5.4 client or server-local 1.5.2 client - both "default" svn binaries), I'm getting something like:

我遇到了 SVN 的奇怪行为。我已经在 Apache 2.2.9 上使用 mod_dav、mod_dav_svn 和 SVN 1.5.2 运行了 SVN 存储库。当我尝试检出(从远程 1.5.4 客户端或服务器本地 1.5.2 客户端 - 都是“默认”svn 二进制文件)时,我得到如下信息:

mx-mac:Test mx$ svn ci -m "" Adding test.txt svn: Commit failed (details follow): svn: XML data was not well-formed

mx-mac:Test mx$ svn ci -m "" 添加test.txt svn: Commit failed (详情如下): svn: XML data was not well-formed

What I've found out by sniffing the HTTP connection is, that one request to remote SVN repository (Apache) ends by "Reset by peer" and not returning the response (used HTTP Scoop to sniff).

我通过嗅探 HTTP 连接发现,对远程 SVN 存储库 (Apache) 的一个请求以“由对等重置”结束,并且不返回响应(使用 HTTP Scoop 进行嗅探)。

As for the configuration of Apache, all modules are loaded. Proper permissions are set for repo and repo was created by svnadmin create and then chowned to apache user (anyway, it did not worked even if I've chmod -R 777 repo directory).

至于Apache的配置,所有模块都加载了。为 repo 设置了适当的权限,repo 是由 svnadmin create 创建的,然后 chown 给 apache 用户(无论如何,即使我有 chmod -R 777 repo 目录,它也不起作用)。

Apache configuration contains DAV and SVNPath directives along with authentication.

Apache 配置包含 DAV 和 SVNPath 指令以及身份验证。

I'm pretty desperate after few long hours of trying, so if someone ever encountered such issue, please let me know. Thanks a lot!

经过几个小时的尝试,我非常绝望,所以如果有人遇到过这样的问题,请告诉我。非常感谢!

回答by

Finally, I figured out that redefined ErrorDocument in .htaccess file for the same VirtualHost as the SVN's caused invalid data to be sent to SVN client on some occasions and for some reason intercepting with commit process.

最后,我发现在 .htaccess 文件中为与 SVN 相同的 VirtualHost 重新定义了 ErrorDocument,导致在某些情况下将无效数据发送到 SVN 客户端,并且由于某种原因拦截了提交过程。

回答by DarenW

While in theory it would be educational to figure out problems like this, life is too short and i'm already expert at other things, for which i'm being paid to be expert at, so my fallback solution to any svn trouble is this: go outside of the working copy, make a new directory somewhere else, make a fresh checkout of whatever branch from the repository, and then manually update the files you know you've changed, by copying from the messed-up checkout.

虽然从理论上讲,找出这样的问题是有教育意义的,但生命太短暂了,而且我已经是其他方面的专家,为此我得到了报酬以成为专家,所以我对任何 svn 问题的后备解决方案是这样的: 离开工作副本,在其他地方创建一个新目录,从存储库中重新签出任何分支,然后通过从混乱的签出中复制来手动更新您知道已更改的文件。

As for apache, i'd bet it's innocent of any trouble. Failed commits are almost always due to something other than the connection to the repository. (Assuming no one was tinkering with apache or the svn server.) No guarantee, but trying the fresh-checkout and manual copying over of files may just work, or at least reveal new diagnostic information.

至于apache,我敢打赌它没有任何麻烦。失败的提交几乎总是由于与存储库的连接之外的其他原因造成的。(假设没有人在修改 apache 或 svn 服务器。)不能保证,但尝试新签出和手动复制文件可能会起作用,或者至少会显示新的诊断信息。

回答by DarenW

Daren, you are not exactly correct right now. I've tried all the possible combinations of working copies, new repositories and so on. I've tried mostly everything. At last, I've found one strange message in NEON debug messages, displaying my 404 page on a homepage, which I mostly forgot about. Then, I've realized - as created long time ago - I've sent improper HTTP status code from the 404 page (200 instead of 404), therefore NEON considered it proper output and processed, leaving it in somehow incorrect state.

达人,你现在不完全正确。我已经尝试了所有可能的工作副本、新存储库等组合。我几乎什么都试过了。最后,我在 NEON 调试消息中发现了一条奇怪的消息,在主页上显示了我的 404 页面,我几乎忘记了。然后,我意识到 - 正如很久以前创建的那样 - 我从 404 页面(200 而不是 404)发送了不正确的 HTTP 状态代码,因此 NEON 认为它是正确的输出并进行了处理,使其处于某种不正确的状态。

So, right now it was apache issue, caused by stupid web developer - me in 2003... :)

所以,现在是 apache 问题,由愚蠢的 Web 开发人员引起的 - 我在 2003 年...... :)

回答by DarenW

I found that this is caused by not using the correct URL to check out the contents. I was using the url served by the web server when I typed the check out command eg "svn co http://blah.com/stuff_in_here/contents" I then played with the url until I found the real svn location that I could use in the command line eg "http://blah.com/svn/contents"

我发现这是由于没有使用正确的 URL 来检查内容造成的。当我输入结帐命令时,我正在使用 Web 服务器提供的 url,例如“svn co http://blah.com/stuff_in_here/contents”然后我使用该 url 直到找到我可以使用的真实 svn 位置在命令行,例如“ http://blah.com/ SVN/内容”

回答by rds

This was bothering me too. I solved it by removing my workspace and checking it out again.

这也困扰着我。我通过删除我的工作区并再次检查来解决它。

回答by Thomas Uttendorfer

I got the same error message:

我收到了同样的错误信息:

svn: Commit failed (details follow): svn: XML data was not well-formed

svn:提交失败(详细信息如下):svn:XML 数据格式不正确

Reason was: Drive on SVN-Repository was full. Some more diskspace and the problem was solved.

原因是:SVN-Repository 上的驱动器已满。再增加一些磁盘空间,问题就解决了。