Invalid length for a Base-64 char array

Discussion in 'ASP .Net' started by Wayne Sepega, Feb 19, 2007.

  1. Wayne Sepega

    Wayne Sepega Guest

    I'm receiving the above error from time to time with one of our web pages.
    What would cause this?
    Thanks
    Wayne

    The following is the stacktrace from the exception:

    System.Web.HttpUnhandledException: Exception of type
    'System.Web.HttpUnhandledException' was thrown. ---> System.FormatException:
    Invalid length for a Base-64 char array. at
    System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32
    length) at System.Web.HttpServerUtility.UrlTokenDecode(String input) at
    System.Web.UI.Page.DecryptString(String s) at
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
    Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack
    trace --- at System.Web.UI.Page.HandleError(Exception e) at
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
    Boolean includeStagesAfterAsyncPoint) at
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
    Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at
    System.Web.UI.Page.ProcessRequest(HttpContext context) at
    ASP.alerts_add_aspx.ProcessRequest(HttpContext context) at
    System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously)
     
    Wayne Sepega, Feb 19, 2007
    #1
    1. Advertising

  2. Most likely your alerts_add_aspx page has data being posted that fails
    validation (illegal characters, elements added to a dropdownlist after the
    page was rendered, etc).

    There are attributes to turn page validation and event validation off, but
    they also
    come with less security protection, which may or may not be an issue in your
    environment.
    Peter
    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "Wayne Sepega" wrote:

    > I'm receiving the above error from time to time with one of our web pages.
    > What would cause this?
    > Thanks
    > Wayne
    >
    > The following is the stacktrace from the exception:
    >
    > System.Web.HttpUnhandledException: Exception of type
    > 'System.Web.HttpUnhandledException' was thrown. ---> System.FormatException:
    > Invalid length for a Base-64 char array. at
    > System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32
    > length) at System.Web.HttpServerUtility.UrlTokenDecode(String input) at
    > System.Web.UI.Page.DecryptString(String s) at
    > System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
    > Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack
    > trace --- at System.Web.UI.Page.HandleError(Exception e) at
    > System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
    > Boolean includeStagesAfterAsyncPoint) at
    > System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
    > Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest()
    > at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at
    > System.Web.UI.Page.ProcessRequest(HttpContext context) at
    > ASP.alerts_add_aspx.ProcessRequest(HttpContext context) at
    > System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    > at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    > completedSynchronously)
    >
    >
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Feb 19, 2007
    #2
    1. Advertising

  3. Wayne Sepega

    Wayne Sepega Guest

    The application has been in production for little over a year now. From what
    I have been told these exceptions happen from time to time, only reason I
    saw the one below was due to the fact that we just did a big deployment and
    I had to monitor our systems after it.

    I know about the attributes to turn off the page validation, I went to great
    lengths to keep this on when writing the app, so at this point turning it
    off isn't an option.

    We do our own encryption and decryption of the query strings, but that code
    isn't showing in the stack trace, and as such I'm a bit lost on what the
    issue could be. I just forced the decryption to except by modifying the
    query string and I get a different exception, as well as the stack trace
    includes my method for decrypting the query string.

    Any suggestions on what I can do to track this down?
    Wayne


    "Peter Bromberg [C# MVP]" <> wrote in
    message news:...
    > Most likely your alerts_add_aspx page has data being posted that fails
    > validation (illegal characters, elements added to a dropdownlist after the
    > page was rendered, etc).
    >
    > There are attributes to turn page validation and event validation off, but
    > they also
    > come with less security protection, which may or may not be an issue in
    > your
    > environment.
    > Peter
    > --
    > Site: http://www.eggheadcafe.com
    > UnBlog: http://petesbloggerama.blogspot.com
    > Short urls & more: http://ittyurl.net
    >
    >
    >
    >
    > "Wayne Sepega" wrote:
    >
    >> I'm receiving the above error from time to time with one of our web
    >> pages.
    >> What would cause this?
    >> Thanks
    >> Wayne
    >>
    >> The following is the stacktrace from the exception:
    >>
    >> System.Web.HttpUnhandledException: Exception of type
    >> 'System.Web.HttpUnhandledException' was thrown. --->
    >> System.FormatException:
    >> Invalid length for a Base-64 char array. at
    >> System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32
    >> length) at System.Web.HttpServerUtility.UrlTokenDecode(String input) at
    >> System.Web.UI.Page.DecryptString(String s) at
    >> System.Web.UI.Page.ProcessRequestMain(Boolean
    >> includeStagesBeforeAsyncPoint,
    >> Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack
    >> trace --- at System.Web.UI.Page.HandleError(Exception e) at
    >> System.Web.UI.Page.ProcessRequestMain(Boolean
    >> includeStagesBeforeAsyncPoint,
    >> Boolean includeStagesAfterAsyncPoint) at
    >> System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
    >> Boolean includeStagesAfterAsyncPoint) at
    >> System.Web.UI.Page.ProcessRequest()
    >> at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at
    >> System.Web.UI.Page.ProcessRequest(HttpContext context) at
    >> ASP.alerts_add_aspx.ProcessRequest(HttpContext context) at
    >> System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    >> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    >> completedSynchronously)
    >>
    >>
    >>
    >>
     
    Wayne Sepega, Feb 20, 2007
    #3
    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. =?Utf-8?B?ZGFuYw==?=

    Invalid length for a Base-64 char array

    =?Utf-8?B?ZGFuYw==?=, Dec 16, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    12,568
    lwnuclear
    Dec 19, 2008
  2. =?Utf-8?B?SmVzcyBBbmRlcnNlbg==?=

    Error in mscorlib (invalid length for a base-64 char array.)

    =?Utf-8?B?SmVzcyBBbmRlcnNlbg==?=, Oct 10, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,827
    =?Utf-8?B?SmVzcyBBbmRlcnNlbg==?=
    Oct 12, 2005
  3. =?Utf-8?B?c29tZSBvbmU=?=

    Invalid length for a Base-64 char array ,Invalid_Viewstate

    =?Utf-8?B?c29tZSBvbmU=?=, Dec 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    7,267
    albert braun
    Dec 15, 2005
  4. Wayne Sepega

    Invalid length for a Base-64 char array

    Wayne Sepega, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    607
    Wayne Sepega
    Feb 19, 2007
  5. Larry Hengen
    Replies:
    0
    Views:
    547
    Larry Hengen
    Sep 17, 2007
Loading...

Share This Page