团队测试:负载失败。请求失败:服务器违反了协议。部分 = 响应标头详细信息 = CR 后必须跟 LF
QA 部门的人员使用 Visual Studio Team Test (2008 IIRC) 对我们的 Web 应用程序运行负载测试。
最新的一组测试在几个页面上都失败了。报告的错误是
请求失败:服务器违反了协议。 Section=ResponseHeader Detail=CR 后面必须跟 LF
使用 google 搜索此内容会产生相当多的结果。该错误消息似乎是从 .Net 框架 WebRequest 类生成的(即,它不是 Visual Studio 特定的消息)。最有用的结果是 这个,详细说明了我的确切问题以及如何抑制错误。
但当然,我想首先弄清楚为什么会出现这个错误。以下是更多事实: -
- 当针对旧版本的 Web 应用程序运行测试时,从来不会发生此错误。网络应用程序。在这两种情况下,主机操作系统和 Web 服务器(Win 2003 和 IIS 6)是相同的。
- 并非所有页面都会生成此错误 - 只有部分页面会生成此错误。
- 这些页面的唯一重大变化(我能想到的)是它们现在使用了一些 AJAX,而之前它们没有使用 (IIRC)。
为了缩小问题范围,我创建了可以复制问题的最简单的页面。幸运的是,这并不太难。然后,我使用 Fiddler 检查了标头中的字节,但找不到 CR (0x0D) 后面没有跟随 LF (0x0A) 的情况。
原始 HTTP 响应(通过响应保存字节从 Fiddler 存储 - 因此在保存过程中不应更改其编码)是/原始输出。 txt?psid=1" rel="nofollow" title="response file">此处为文本 如果您不相信我!
所以现在我认为所谓的错误可能是误报。还有其他人有这方面的经验/可以帮助阐明吗?
The folk in the QA department use visual studio team test (2008 IIRC) to run load tests against our web application.
The latest set of tests have failed on several pages. The error reported is
Request failed: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
Searching for this using google yields quite a few results. it would appear that this error message is generated from the .Net framework WebRequest class (i.e. it is not a visual studio specific message). The most useful result is this one, which details my exact problem and how to suppress the error.
But of course, I want to get to the bottom of why this error occurs in the first place. Here are some more facts: -
- This error never used to occur when the tests were run against an older version of the web app. The web app. host OS and web server (Win 2003 and IIS 6) are identical in both cases.
- Not all the pages generate this error - only some.
- The only significant change to these pages (that I can think of) is that they now use some AJAX whereas before they did not (IIRC)
In order to narrow down the problem, I created the simplest page that I could to replicate the problem. Luckily, that was not too hard. I then inspected the bytes in the header using Fiddler but I could not find an occurrence of a CR (0x0D) that was not followed by a LF (0x0A).
The raw HTTP response (as stored from Fiddler by response saving bytes - so its encoding should not have been altered during the save) is here as text if you don't believe me!
So now I am left thinking that the supposed error might be a false alarm. Does anyone else have experience of this/can help shed light?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这绝对不是误报 - 在尝试与 Facebook API 通信时,我的应用程序中经常遇到此错误。
我刚刚偶然发现了 Steven Cheng 的回复 - http://www.velocityreviews.com/forums/t302174-why-do-i-get-the-server-comfilled-a-protocol-violation。 html - 让我引用他的话:
如果现在有帮助,将尝试并稍后发布结果
This is definitely not a false alarm - I've been getting this error in my app a lot while trying to communicate with Facebook API.
I've just stumbled upon this response from Steven Cheng - http://www.velocityreviews.com/forums/t302174-why-do-i-get-the-server-committed-a-protocol-violation.html - and let me quote him:
Will try if this helps right now and post results later