由于服务器移动我在某些客户端计算机上收到错误“System.Web.HttpException:无法验证数据”。堆栈跟踪粘贴在下面。
我知道当页面呈现给用户但尚未完全加载(viewstate)并且用户过早点击控件时,可能会发生这种情况。但有没有办法解决它而不告诉用户放轻松?另外:另一台计算机上没有问题,该计算机位于另一个域(可能更接近或与服务器域相同)。它在服务器移动之前也完美无缺。
任何可能有帮助的想法/想法?
堆栈跟踪:
[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
答案 0 :(得分:0)
当存在某种负载平衡时,我经常会看到这些类型的错误。旧服务器仍在线吗?是否存在可能从旧服务器向用户发送响应的负载均衡器,然后下一个请求是新服务器?可能还会发生一些DNS缓存,在某些情况下流量仍然会流向旧服务器。
其他一些问题: 旧服务器是否脱机?人们可以打开旧会话(使用旧的viewstate键),然后将这些会话发回新服务器吗?
最糟糕的情况是,如果您无法弄清楚为什么会发生这种情况,您可以将新机器上的machine key(在machine.config中)设置为与旧机器相同。它通常不是一个好习惯,但这使得视图状态可以在任何一台机器上加密和解密。