- PR -

Webページでのエラー

投稿者投稿内容
Masa
ベテラン
会議室デビュー日: 2007/03/19
投稿数: 65
投稿日時: 2008-09-24 10:38
こんにちは。

現在VB2005で作成したWebページ上でエラーが発生してしまい大変困っております。

エラーは以下の通りです。

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

他端末と同時にポストバックが走ると上記エラーが表示されます。

google等で調べてみましたが該当する情報がありませんでした。

ご存知の方がいらっしゃいましたらご教授願います。
テッテ
ベテラン
会議室デビュー日: 2008/03/16
投稿数: 91
投稿日時: 2008-09-24 10:47
Validation of viewstate MAC failed で Google で検索したら15000件ヒットしましたが…?これをチェックしても該当するものがなかったということでしょうか?

とりあえず、どんなコードを書いているのかとか、どんなコントロールをどういう風に使っているのかくらいは書いていただかないと。

GridView 等のデータバインドコントロールを使用しているなら、そのビューステートを無効にしたら解決したりしないでしょうか?
Masa
ベテラン
会議室デビュー日: 2007/03/19
投稿数: 65
投稿日時: 2008-09-24 11:10
テッテ様

ありがとうございます。

すみません。かなりテンパッテいるため大した情報も書かずに投稿してしまいました。

googleで検索した結果ですが英文のものばかりで・・・。

実際にはInfragistics社のUltraWebGridを利用しております。
そこへSQLDATASOURCEを使いデータバインドしております。

EnableViewstateをFalseにしてテストしてみましたがやはりだめなようです。

Server Error in '/main-kintai' Application.
--------------------------------------------------------------------------------

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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: 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.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:


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

[ViewStateException: Invalid viewstate.
Client IP: XXX.XXX.XXX.XXX
Port: XXXX
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
ViewState: /wEPDwULLTE2NTEzMzUzOTJkGAMFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYDBQ5XZWJUZXh0RWRpdF9JRAUQV2ViVGV4dEVkaXRfUGFzcwUObG9naW5fV0lCdXR0b24FEFdlYlRleHRFZGl0X1Bhc3MPZWQFDldlYlRleHRFZGl0X0lED2VkYfV9SmzUPVW6/0JYFs2NKfG0+IM=
Referer: httpX://XXXXXXXXX.co.jp/XXXX/login.aspx
Path: /XXXX/XXX.aspx]

[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.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +116
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +251
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() +220
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83
System.Web.UI.Page.LoadAllState() +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6978
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.login_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

[ メッセージ編集済み 編集者: Masa 編集日時 2008-09-24 12:04 ]
さかもと
ぬし
会議室デビュー日: 2004/05/14
投稿数: 586
投稿日時: 2008-09-24 11:22
さかもとと申します。

検索しただけで内容の確認まではしていませんが、
http://support.microsoft.com/kb/831150/ja

この情報に一致しませんでしょうか?
_________________
------------------------------------------
拝啓、さかもとと申します♪
Masa
ベテラン
会議室デビュー日: 2007/03/19
投稿数: 65
投稿日時: 2008-09-24 11:31
引用:

さかもとさんの書き込み (2008-09-24 11:22) より:
さかもとと申します。

検索しただけで内容の確認まではしていませんが、
http://support.microsoft.com/kb/831150/ja

この情報に一致しませんでしょうか?




さかもと様

ありがとうございます。

せっかくいただきました情報ですがどうやら.netframework1.1のもののようです。
さかもと
ぬし
会議室デビュー日: 2004/05/14
投稿数: 586
投稿日時: 2008-09-24 11:54
さかもとです。

そうでしたか、すいません中身読んでいなかったので・・・。

ところで、Masaさんが作成中と思われるシステムへのログイン画面が記述されています。)。契約上どうなっているかは分かりませんが、こうした場に表示されるとまずいケースが多いと思います。

コメントは編集可能ですので、その部分は伏せる方が良いかと。
もし、問題ないとの認識の上記述されていましたら無視してください。


_________________
------------------------------------------
拝啓、さかもとと申します♪
rain
ぬし
会議室デビュー日: 2006/10/19
投稿数: 549
投稿日時: 2008-09-24 11:54
例外情報を見た限りでは、↓のURLから辿った先の、
http://bbs.wankuma.com/index.cgi?mode=al2&namber=16578&KLOG=33

↓の内容が近い気がします。...英語ですが(汗
http://blogs.msdn.com/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx
Masa
ベテラン
会議室デビュー日: 2007/03/19
投稿数: 65
投稿日時: 2008-09-24 12:37
引用:

さかもとさんの書き込み (2008-09-24 11:54) より:
ところで、Masaさんが作成中と思われるシステムへのログイン画面が記述されています。)。契約上どうなっているかは分かりませんが、こうした場に表示されるとまずいケースが多いと思います。



さかもと様

うっかりしていました。
ご指摘ありがとうございます。

スキルアップ/キャリアアップ(JOB@IT)