Servermove“System.Web.HttpException:无法验证数据”
由于服务器移动,我在某些客户端计算机上收到错误“System.Web.HttpException:无法验证数据”。堆栈跟踪粘贴在下面。
我知道当页面呈现给用户但尚未完全加载(视图状态)并且用户过早单击控件时,可能会发生这种情况。但有没有一种方法可以在不告诉用户放心的情况下解决这个问题呢?另外:位于另一个域(可能更接近或与服务器域相同)的另一台计算机上没有问题。在服务器移动之前它也完美运行。
有什么想法/想法可能有帮助吗?
堆栈跟踪:
[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKey.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +195
System.Web.UI.LosFormatter.Deserialize(String input) +60
[HttpException (0x80004005): Authentication of viewstate failed. 1) If this is a cluster, edit <machineKey> configuration so all servers use the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. 2) Viewstate can only be posted back to the same page. 3) The viewstate for this page might be corrupted.]
System.Web.UI.LosFormatter.Deserialize(String input) +118
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +102
[HttpException (0x80004005): Invalid_Viewstate
Client IP: 10.33.202.162
Port: 2080
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
ViewState: dDwyMDE4ODE0MjgxO3Q8O2w8aTwxPjs+O2w8dDw7bDxpPDM+Oz47bDx0PHQ8O3A8bDxpPDA+O2k8MT47aTwyPjtpPDM+O2k8ND47aTw1PjtpPDY+O2k8Nz47aTw4PjtpPDk+O2k8MTA+O2k8MTE+O2k8MTI+O2k8MTM+O2k8MTQ+O2k8MTU+O2k8MTY+O2k8MTc+O2k8MTg+O2k8MTk+O2k8MjA+O2k8MjE+O2k8MjI+O2k8MjM+O2k8MjQ+O2k8MjU+Oz47bDxwPFVXVi0wNDAwO3V3djA0MDA+O3A8VVdWLTAzMDE7dXd2MDMwMT47cDxVV1YtMDMwMDt1d3YwMzAwPjtwPFVXVi0wMjAyO3V3djAyMDI+O3A8R1ZJIFdlYnNlcnZpY2U7Z3Zpd3M+O3A8UG9saXNQbHVzO3BvbGlzcGx1cz47cDxQb2xpcztwb2xpcz47cDxPRFNGMDAxO29kcz47cDxPRFNGMDAyO29kc0YwMDI+O3A8T0RTRjAwMztvZHNGMDAzPjtwPFVEUFM7VURQUz47cDxVREEwMTAwO1VEQTAxMDA+O3A8VURBMDEwMTtVREEwMTAxPjtwPFVEQTAxMDI7VURBMDEwMj47cDxBVkIwMTtBVkIwMT47cDxBVkIwMjtBVkIwMj47cDxBVkIwMztBVkIwMz47cDxQVkM7cHZjPjtwPEdhayBJbmtpams7MT47cDxVU1pPIElua2lqazs0PjtwPEhHTyBCb3V3OzEwNT47cDxIR08gQlZHOzEwMT47cDxIR08gRGV0YW07MTAyPjtwPEhHTyBHVU87MTAzPjtwPEhHTyBVU1pPOzEwND47cDxIR08gQk9VVyBBRzsxMDY+Oz4+Oz47Oz47Pj47Pj47bDxSZXNwb25zZU9wbWFrZW5DaGVja2JveDs+PjzKtZ2M0RXRnZgX5z4o208+vljZ
Http-Referer: http://be04uap535uwv38.productie.hrc.ba.uwv.nl/soap/suwiml/beheer/KBS012KBS013Vraag.aspx
Path: /soap/suwiml/beheer/KBS012KBS013Vraag.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +443
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +447
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当进行某种负载平衡时,我通常会看到这些类型的错误。旧服务器还在线吗?是否有一个负载均衡器可以将响应从旧服务器发送给用户,然后下一个请求发送到新服务器?也可能会发生一些 DNS 缓存,在某些情况下流量仍然会流向旧服务器。
其他一些问题:
旧服务器离线了吗?人们是否可以打开旧会话(使用旧视图状态密钥)并将这些会话发布回新服务器?
最坏的情况,如果您无法弄清楚为什么会发生这种情况,您可以设置 机器密钥(在machine.config) 在新计算机上与旧计算机相同。这通常不是一个好的做法,但这使得视图状态可以在任何一台机器上加密和解密。
I have usually seen these types of errors when there is some kind of load balancing going on. Is the old server still online? Is there a load balancer that may be sending responses down to the user from the old server, and then the next request goes tot he new server? There could be some DNS caching happening too, where traffic is still going to the older server in some cases.
Some other questions:
Is the old server offline? Could people have old sessions open (with the old viewstate keys) and those are getting posted back to the new server?
Worst case, if you cannot figure out why this is happening, you can set the machine key (in the machine.config) on the new machine to be the same as the old machine. Its not usually a good practice, but this makes it so the viewstate can be encrypted and decrypted on either machine.