Telerik & "Validation of viewstate MAC failed."

Discussion in 'ASP .Net' started by SpaceMarine, Apr 9, 2008.

  1. SpaceMarine

    SpaceMarine Guest

    hello,

    when my page attempts a Telerik RadGrid row insert (AJAX enabled) my
    page throws this exception:

    Validation of viewstate MAC failed. If this application is hosted by a
    Web Farm or cluster, ensure that <machineKey> configuration specifies
    the same validationKey and validation algorithm. AutoGenerate cannot
    be used in a cluster.

    ....my host, www.DataPacket.net, says the site is not on a webfarm, and
    that this error is due to my site exceeding the Application Pool
    resource limits set for it (site is on a shared hosting environment).

    can anyone confirm that this is possible? i dont know much about APs,
    but i am surprised that one page w/ one RadGrid thats attempting to
    insert one row via AJAX could cause my site to exceed CPU/RAM
    resource.

    any thoughts?


    thanks!
    sm =
     
    SpaceMarine, Apr 9, 2008
    #1
    1. Advertising

  2. It's possible but not that likely unless there is a whopper of a viewstate
    field in the page. More likely, the RAD control is modifying the viewstate in
    such a way that it fails the MAC check. You can disable this check in the
    web.config. I think it's <pages enableViewStateMAC = "false" /> or something
    like that.
    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short Urls & more: http://ittyurl.net


    "SpaceMarine" wrote:

    > hello,
    >
    > when my page attempts a Telerik RadGrid row insert (AJAX enabled) my
    > page throws this exception:
    >
    > Validation of viewstate MAC failed. If this application is hosted by a
    > Web Farm or cluster, ensure that <machineKey> configuration specifies
    > the same validationKey and validation algorithm. AutoGenerate cannot
    > be used in a cluster.
    >
    > ....my host, www.DataPacket.net, says the site is not on a webfarm, and
    > that this error is due to my site exceeding the Application Pool
    > resource limits set for it (site is on a shared hosting environment).
    >
    > can anyone confirm that this is possible? i dont know much about APs,
    > but i am surprised that one page w/ one RadGrid thats attempting to
    > insert one row via AJAX could cause my site to exceed CPU/RAM
    > resource.
    >
    > any thoughts?
    >
    >
    > thanks!
    > sm =
    >
     
    Peter Bromberg [C# MVP], Apr 9, 2008
    #2
    1. Advertising

  3. SpaceMarine

    SpaceMarine Guest

    On Apr 9, 12:30 pm, Peter Bromberg [C# MVP]
    <> wrote:
    > It's possible but not that likely unless there is a whopper of a viewstate
    > field in the page. More likely, the RAD control is modifying the viewstate in
    > such a way that it fails the MAC check. You can disable this check in the
    > web.config. I think it's <pages enableViewStateMAC = "false" /> or something
    > like that.


    unfortunately that property is already false -- false is the default.

    i know Telerik's RadGrid is pretty spiffy and uses a large
    viewstate... but how would the viewstate be connected to the App Pool
    for my site? i dont usually work w/ shared sites, so im not sure.

    thanks,
    matt
     
    SpaceMarine, Apr 9, 2008
    #3
  4. SpaceMarine

    SpaceMarine Guest

    On Apr 9, 3:20 pm, SpaceMarine <> wrote:

    > i know Telerik's RadGrid is pretty spiffy and uses a large
    > viewstate... but how would the viewstate be connected to the App Pool


    btw i isolated the viewstate and looked at its size -- 8k. sound large
    enough to jack w/ my app pool?


    sm
     
    SpaceMarine, Apr 9, 2008
    #4
  5. SpaceMarine

    bruce barker Guest

    viewstate is an encrypted hidden field, client code does not touch it.
    the error means the server can not decrypt it. there are two causes:

    1) the data was changed
    2) the mac key has changed

    if the mac key is not specified in the web config, it is generated at
    startup. if your app pool is recycling (check the log) the key can change.

    -- bruce (sqlwork.com)

    SpaceMarine wrote:
    > hello,
    >
    > when my page attempts a Telerik RadGrid row insert (AJAX enabled) my
    > page throws this exception:
    >
    > Validation of viewstate MAC failed. If this application is hosted by a
    > Web Farm or cluster, ensure that <machineKey> configuration specifies
    > the same validationKey and validation algorithm. AutoGenerate cannot
    > be used in a cluster.
    >
    > ...my host, www.DataPacket.net, says the site is not on a webfarm, and
    > that this error is due to my site exceeding the Application Pool
    > resource limits set for it (site is on a shared hosting environment).
    >
    > can anyone confirm that this is possible? i dont know much about APs,
    > but i am surprised that one page w/ one RadGrid thats attempting to
    > insert one row via AJAX could cause my site to exceed CPU/RAM
    > resource.
    >
    > any thoughts?
    >
    >
    > thanks!
    > sm =
     
    bruce barker, Apr 10, 2008
    #5
  6. SpaceMarine

    SpaceMarine Guest

    On Apr 9, 8:06 pm, bruce barker <> wrote:
    > viewstate is an encrypted hidden field, client code does not touch it.
    > the error means the server can not decrypt it. there are two causes:
    >
    > 1) the data was changed
    > 2) the mac key has changed
    >
    > if the mac key is not specified in the web config, it is generated at
    > startup. if your app pool is recycling (check the log) the key can change.


    not sure why youre referencing client code... im not concerned w/
    clientside code. im concerend w/ what my hosting company is telling
    me: that this error is due to my site pegging its app pool; which i
    find hard to believe because its a private site w/ a single user (me),
    doing a single thing (using this control w/ the 8k viewstate).

    they claim their servers are config'ed properly.


    sm
     
    SpaceMarine, Apr 10, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray Stevens

    Validation of viewstate MAC failed

    Ray Stevens, Aug 4, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    837
    Brock Allen
    Aug 9, 2005
  2. Not Me

    Validation of viewstate MAC failed

    Not Me, Dec 8, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    491
    Not Me
    Dec 8, 2005
  3. Sergej Grickov

    Error: Validation of viewstate MAC failed

    Sergej Grickov, Jan 27, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    11,753
    Teemu Keiski
    Feb 4, 2006
  4. aaaaaa
    Replies:
    1
    Views:
    452
    Alvin Bruney - ASP.NET MVP
    Mar 23, 2006
  5. sck10
    Replies:
    6
    Views:
    955
    sck10
    Sep 1, 2006
Loading...

Share This Page