Failed to verify data. in System.Web.Configuration.MachineKeySection.GetDecodedData

I have several websites that get approximately 3,000 page views per day per day, and I get this view error about 5-10 times a day by hitting global.asax:

System.Web.HttpException: Unable to validate data. in System.Web.Configuration.MachineKeySection.GetDecodedData (Byte [] buf, Byte [] modifier, Int32 start, Int32 length, Int32 & dataLength) in System.Web.UI.ObjectStateFormatter.Deserialize (String inputString)

I tried:

  • hard-coded machine key in web.config for all websites
  • hard coding machien key in machine.config
  • Add items to the web.config page section for all websites.

The car key is as follows:

<machineKey validationKey="key goes here" decryptionKey="key goes here" validation="SHA1" decryption="AES" /> 

The page section is as follows:

 <pages renderAllHiddenFieldsAtTopOfForm="true" validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never"> 

The errors are not related to recycling the application pool, as far as I can explain, since the pool is configured to process for every 100,000 requests. I do not have a web farm or a web garden. Quite often, I get two or three of these errors in a line, as if the user was receiving an error, going back and clicking the link again.

Does anyone have any ideas?

+4
source share
1 answer

I saw "random" ViewState errors before being triggered by slow internet connections. Slow connections would cause the page to display visually for the user, however it was not fully loaded. Then the user will take action on the form and, thus, "random" problems will arise.

See if you can match the exception timestamps to specific pages requested in IIS logs. You can then try to recreate the low-bandwidth script using Firefox Throttle .

A similar question below confirms my impressions and probably what you also see:

ASP.NET: unable to validate data

+2
source

Source: https://habr.com/ru/post/1307199/


All Articles