Skip to content

MS SDK - Validation of viewstate MAC failed #19

@tarasklimenko

Description

@tarasklimenko

Description:

The MS SDK Webhooks sample app throws an error when attempting to get notifications after a period of time.

Below is the stack trace:

[ViewStateException: Invalid viewstate. 
    Client IP: 50.149.116.161
    Port: 57109
    Referer: https://wdev.code-api-att.com/webhook/Default.aspx?code=BF-ACSI%7e4%7e20150302220353%7ekcM9C5BU98k1rPS97bb9
    Path: /webhook/Default.aspx
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36
    ViewState: /wEPDwUKLTI4NjY2MTEzMA9kFgICAg9kFgoCAQ8PFgIeBFRleHQFHk1vbiwgTWFyIDAyLCAyMDE1IDIyOjA0OjUxIFVUQ2RkAhkPPCsAEQIADxYEHgtfIURhdGFCb3VuZGceC18hSXRlbUNvdW50ZmQBEBYAFgAWAGQCJQ8PFgIeB1Zpc2libGVoZBYCAgUPPCsAEQBkAi8PDxYCHwNoZGQCMQ8PFgIfA2hkZBgCBRBndk1lc3NhZ2VIZWFkZXJzD2dkBQlndkRldGFpbHMPPCsADAEIZmT1bkQ732JsZCaVLZXbiXZskj1/zqWEbqbGlrbT3uVoVg==]

[HttpException (0x80004005): 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.

http://go.microsoft.com/fwlink/?LinkID=314055]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +169
   System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +274
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
   System.Web.UI.HiddenFieldPageStatePersister.Load() +241
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +219
   System.Web.UI.Page.LoadAllState() +43
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
   System.Web.UI.Page.ProcessRequest() +78
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.webhook_default_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\219c23b3\42a24ab9\App_Web_u3btnjco.2.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Actual:

The SDK times out after a period of time and throws the error above.

Expected:

It's expected for the app to run continuously without interruption. Allowing user to get notifications 24 hours a day.

Repro:

  1. Create Notification Channel via MS SDK Webhooks Sample App
  2. Subscribe to Channel
  3. Get Notifications via Subscription to Channel
  4. Wait for a period of time (not determined)
  5. Notice error is thrown (shown above)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions