简体   繁体   English

Azure /映像请求502(错误网关)错误 - 间歇性

[英]Azure / Image request 502 (Bad gateway) error - intermittent

I'm working on http://www.lovethesales.com - and have come up against an annoying issue. 我正在http://www.lovethesales.com工作 - 并且遇到了一个恼人的问题。

As you'll probably be able to see for yourself on the homepage, sometimes, and intermittently, image requests will fail with a 502 Bad Gateway error. 正如您可能在主页上看到的那样,有时候,间歇性地,图像请求将因502 Bad Gateway错误而失败。 This seems to happen in all browsers - (you can see the red failed requests in the Chrome developer tools, for example) 这似乎发生在所有浏览器中 - 例如,您可以在Chrome开发人员工具中看到红色失败的请求

The resource in question /imageproxy can never return anything other than a 200, or a 304. 问题/ imageproxy中的资源永远不会返回除200或304以外的任何内容。

1) This page (set to show 500 results) never seems to have broken images, even though it's making similar / the same requests, but showing even more of them: 1)这个页面(设置为显示500个结果)似乎永远不会有破坏的图像,即使它正在进行相似/相同的请求,但显示更多它们:

http://www.lovethesales.com/sales/?take=500 http://www.lovethesales.com/sales/?take=500

2) If you CTRL + refresh - it's always fine, it's only if you do a 'soft' headers refresh do you receive a 502 error. 2)如果你按CTRL +刷新 - 它总是很好,只有你做'软'标题刷新才会收到502错误。 (Just clicking the refresh button) (只需点击刷新按钮)

The handler is a standard IHttpHandler, registered as follows: 处理程序是标准的IHttpHandler,注册如下:

<add name="ImageProxy" path="/home/imageproxy*" verb="*" type="LoveTheSales.Handlers.ImageProxy" resourceType="Unspecified" preCondition="integratedMode" />

Any advice / ideas on how to tack this down would be most appreciated. 关于如何解决这个问题的任何建议/想法都将受到最高的赞赏。

Cheers, Dave 干杯,戴夫

[EDIT] I have managed to recreate the issue on my test Azure instance (only me using it) - and, after turning on full web/request logging - I can see that the 502 requests are never even making it to my application - they aren't even in the logs. [编辑]我设法在我的测试Azure实例上重新创建了这个问题(只有我使用它) - 并且,在打开完整的Web /请求日志记录后 - 我可以看到502请求甚至从未进入我的应用程序 - 他们甚至没有在日志中。 I guess this must be an Azure error? 我想这一定是Azure错误?

[EDIT 2] This also happens on non-Imageproxy requests, so, simple static images too [编辑2]这也发生在非Imageproxy请求上,因此,也是简单的静态图像

a few things i tend to do with issues like this 我倾向于做一些像这样的问题

1) Make a fiddler trace. 1)做一个小提琴手。 This issue seems hard to reproduce for some users/circumstances. 对于某些用户/环境,此问题似乎很难重现。 tools like Fiddler allows you to record exactly what is happening. 像Fiddler这样的工具可以让你准确记录发生的事情。 Especialy interesting would be what (if anything) is different between failing and succeeding requests/responses 特别有趣的是失败和后续请求/响应之间的差异(如果有的话)

2) Make it so the user don't notice it. 2)使用户不要注意它。 For example a jquery error handler that just resubmits the request. 例如,刚刚重新提交请求的jquery错误处理程序。 I've had it happen just once (of course before i turned on fiddler myself). 我曾经只发生过一次(当然在我自己打开小提琴手之前)。 If the issue is rare enough maybe it's just good enough to handle that 0.1% of the cases where it goes wrong gracefully. 如果问题非常罕见,那么它可能足以处理0.1%的优先出错的情况。

3) perform a serious load test (locally). 3)执行严重的负载测试(本地)。 if you look here http://blog.wouldbetheologian.com/2014/07/502-bad-gateway-error-on-azure-websites.html there might be a underlying causes that crashes your app pool. 如果你看这里http://blog.wouldbetheologian.com/2014/07/502-bad-gateway-error-on-azure-websites.html可能有一个潜在的原因导致你的应用程序池崩溃。 This would not get logged, a new instance gets spinned up but you get a 502 requests on requests to your old instance. 这不会被记录,新实例会被调整,但是对旧实例的请求会收到502个请求。

Especially this last case is something that would fit the little i can see of your scenario. 特别是这最后一种情况适合我可以看到的场景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 来自Azure AppService的GET请求返回自身将返回502 Bad Gateway错误 - GET Request from an Azure AppService back to itself returns a 502 Bad Gateway error 上传大文件 - Azure App Service 上的 502 bad gateway 错误 - Upload large file - 502 bad gateway error on Azure App Service 502 错误:使用 IronPDF 的 Azure 应用服务上的网关错误 - 502 Error: Bad Gateway on Azure App Service with IronPDF 通过SSL通过HttpWebRequest发送请求时出现错误502(错误网关) - Error 502 (Bad Gateway) when sending a request with HttpWebRequest over SSL 如何解决 502 Bad Gateway 错误 - How to troubleshoot 502 Bad Gateway error 为什么会发生“(502) Bad Gateway”错误? - Why "(502) Bad Gateway" error happen? 错误(502)错误的网关:当尝试使用WebChat通道访问Azure上部署的聊天机器人时 - Error (502) Bad Gateway: When trying to access chatbot deployed on Azure using WebChat channel Azure CDN终结点通过502提供错误的网关 - Azure CDN endpoint giving 502 bad gateway with https 远程服务器返回了意外的响应:(502)Azure WCF中的错误网关 - The remote server returned an unexpected response: (502) Bad Gateway in Azure WCF ASP.Net 请求引发 502 Bad Gateway 或 TimeOut - ASP.Net request raises 502 Bad Gateway or TimeOut
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM