"Forms authentication failed for the request." 导致 503 服务在共享主机中不可用

"Forms authentication failed for the request." causes 503 service unavailable in shared hosting

我快绝望了。我的 ASP NET 网站不断崩溃,我得到 503 服务不可用。

我正在使用 hostgator 共享主机。他们说在 IIS 中触发 503 错误是因为该应用程序在短时间内给出了 X 多个错误。

我无法直接访问服务器日志,但他们发送给我的内容如下所示:

Event code: 4005 
Event message: Forms authentication failed for the request. 
Event time: 4/11/2018 12:18:30 PM 
Event time (UTC): 4/11/2018 5:18:30 PM 
Event ID: 15efc898b8054a1e8aef9915b181307e 
Event sequence: 6 
Event occurrence: 1 
Event detail code: 0 

Application information: 
Application domain: /blah blah
Trust level: HG_Full 
Application Virtual Path: / 
Application Path: [somethingsomething]\httpdocs\ 


Process information: 
Process ID: 50012 


Request information: 
Request URL: [somethingsomething]/login.aspx
Request path: .../login.aspx 

我确实在网站上使用表单登录,但从未造成任何问题。我该怎么办?

现在唯一的解决办法是我打电话给他们,他们重置了应用程序池,这非常令人沮丧,因为我必须通过他们的呼叫中心。

无论我做什么,我都无法让网站在登录页面出现任何可见的错误。

我已经阅读了其他帖子,指出我可以通过清除 application_error 中的错误来隐藏 global.asax 中的错误,但我怀疑这是要走的路

我还设置了非常高的身份验证 > 表单超时,我现在将其更改为 30 分钟 - 不确定是否有任何作用,因为我可以看到生成的 cookie 过期日期是 1969

请帮忙!

这是托管服务提供商的描述:

 Per the time stamps these errors are occurring in approximately one minute intervals. Please bear in mind that after a website has hard-crashed multiple times in close succession the Rapid Fail Protection feature of IIS will be triggered which monitors your site for hard-crashes, and if a certain number of errors occur in a certain amount of time then the site will be deactivated with a 503 error message in order to protect the stability of the server. If the site hard-errors more than 5 times in 5 minutes then the website is most likely malfunctioning, or exceeding its allocated resources in the shared environment, and will need to be reviewed by a developer to determine what aspect of the site is causing the application pool to crash. 

This is an intentional configuration of the server to help ensure that no single user impacts other shared users by causing resource exhaustion issues on the server. 

默认情况下,如果应用程序池在 5 分钟内崩溃超过 5 次,您将收到 503 服务不可用错误。

现在重要的问题是找出应用程序池崩溃的原因。可能有多种原因,Forms 身份验证绝对不是其中之一。这是您可以执行的操作。

  1. 联系服务提供商并在问题发生期间从事件查看器请求 "System" 日志。您会发现以下任一错误消息。

服务于应用程序池“%1”的进程与 Windows 进程激活服务发生致命通信错误。进程 ID 为“%2”。数据字段包含错误编号。

服务于应用程序池“%1”的进程意外终止。进程 ID 为“%2”。进程退出代码为“%3”。

  1. 一旦您确定应用程序池正在崩溃,请与托管服务提供商核实您是否可以设置一个规则来捕获 w3wp 进程的转储。分析转储将准确告诉您应用程序中出了什么问题。

有关设置崩溃规则的更多详细信息here

如果您有任何后续问题,请告诉我。