I occassionally get the following exception from an ASP.NET 2.0 Web
Application running on a shared web host.
I have no way of knowing what the actual request page was as it never
happens when I visit the site. The exception is trapped in the
Application_Err or event of global.asax and emailed to me.
The only encryption in the app is the connectionStrin gs section of
web.config.
There is no localization in use.
Can anyone shed any light on how to identify the root cause and correct it?
Could it be a server configuration problem?
Request.Path: /WebResource.axd
Exception Message: Padding is invalid and cannot be removed.
StackTrace: at
System.Security .Cryptography.R ijndaelManagedT ransform.Decryp tData(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer,
Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at
System.Security .Cryptography.R ijndaelManagedT ransform.Transf ormFinalBlock(B yte[]
inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security .Cryptography.C ryptoStream.Flu shFinalBlock()
at System.Web.Conf iguration.Machi neKeySection.En cryptOrDecryptD ata(Boolean
fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean
useValidationSy mAlgo)
at System.Web.UI.P age.DecryptStri ng(String s)
at
System.Web.Hand lers.AssemblyRe sourceLoader.Sy stem.Web.IHttpH andler.ProcessR equest(HttpCont ext
context)
at
System.Web.Http Application.Cal lHandlerExecuti onStep.System.W eb.HttpApplicat ion.IExecutionS tep.Execute()
at System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously)
InnerException:
CurrentExecutio nFilePath: /WebResource.axd
--
AG
Email: discussATadhdat aDOTcom 9 2532
a webresource request has encrypted parameters (assembly name, and resource
id) so a user canot just randomly pluck out resources values (such as a
connect string). after encryption, the parameters are convereted to base64 to
make the strings url safe. due to base64's algrothrym a the string length is
always a mutilpe of three. to get this padding is added.
the error message means the parameter string was truncated (or has illegal
charaters) and does not match the url rendered. this is usally caused by a
proxy server that truncates the url because it too long, or performs some
other translation.
you would to run network traces to see if your end or the other end is
causing the problem.
-- bruce (sqlwork.com)
"AG" wrote:
I occassionally get the following exception from an ASP.NET 2.0 Web
Application running on a shared web host.
I have no way of knowing what the actual request page was as it never
happens when I visit the site. The exception is trapped in the
Application_Err or event of global.asax and emailed to me.
The only encryption in the app is the connectionStrin gs section of
web.config.
There is no localization in use.
Can anyone shed any light on how to identify the root cause and correct it?
Could it be a server configuration problem?
Request.Path: /WebResource.axd
Exception Message: Padding is invalid and cannot be removed.
StackTrace: at
System.Security .Cryptography.R ijndaelManagedT ransform.Decryp tData(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer,
Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at
System.Security .Cryptography.R ijndaelManagedT ransform.Transf ormFinalBlock(B yte[]
inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security .Cryptography.C ryptoStream.Flu shFinalBlock()
at System.Web.Conf iguration.Machi neKeySection.En cryptOrDecryptD ata(Boolean
fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean
useValidationSy mAlgo)
at System.Web.UI.P age.DecryptStri ng(String s)
at
System.Web.Hand lers.AssemblyRe sourceLoader.Sy stem.Web.IHttpH andler.ProcessR equest(HttpCont ext
context)
at
System.Web.Http Application.Cal lHandlerExecuti onStep.System.W eb.HttpApplicat ion.IExecutionS tep.Execute()
at System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously)
InnerException:
CurrentExecutio nFilePath: /WebResource.axd
--
AG
Email: discussATadhdat aDOTcom
Thanks Bruce,
Since I can't run any network traces, it sounds like I have to just ignore
it, unless it becomes more frequent.
--
AG
Email: discussATadhdat aDOTcom
"bruce barker" <br*********@di scussions.micro soft.comwrote in message
news:79******** *************** ***********@mic rosoft.com...
>a webresource request has encrypted parameters (assembly name, and resource
id) so a user canot just randomly pluck out resources values (such as a
connect string). after encryption, the parameters are convereted to base64
to
make the strings url safe. due to base64's algrothrym a the string length
is
always a mutilpe of three. to get this padding is added.
the error message means the parameter string was truncated (or has illegal
charaters) and does not match the url rendered. this is usally caused by a
proxy server that truncates the url because it too long, or performs some
other translation.
you would to run network traces to see if your end or the other end is
causing the problem.
-- bruce (sqlwork.com)
"AG" wrote:
>I occassionally get the following exception from an ASP.NET 2.0 Web Application running on a shared web host.
I have no way of knowing what the actual request page was as it never happens when I visit the site. The exception is trapped in the Application_Er ror event of global.asax and emailed to me.
The only encryption in the app is the connectionStrin gs section of web.config.
There is no localization in use.
Can anyone shed any light on how to identify the root cause and correct it?
Could it be a server configuration problem? Request.Path : /WebResource.axd
Exception Message: Padding is invalid and cannot be removed.
StackTrace: at System.Securit y.Cryptography. RijndaelManaged Transform.Decry ptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at System.Securit y.Cryptography. RijndaelManaged Transform.Trans formFinalBlock( Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security .Cryptography.C ryptoStream.Flu shFinalBlock()
at System.Web.Con figuration.Mach ineKeySection.E ncryptOrDecrypt Data(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationS ymAlgo)
at System.Web.UI.P age.DecryptStri ng(String s)
at System.Web.Han dlers.AssemblyR esourceLoader.S ystem.Web.IHttp Handler.Process Request(HttpCon text context)
at System.Web.Htt pApplication.Ca llHandlerExecut ionStep.System. Web.HttpApplica tion.IExecution Step.Execute()
at System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean& completedSynch ronously)
InnerException :
CurrentExecuti onFilePath: /WebResource.axd
--
AG Email: discussATadhdat aDOTcom
Hi AG,
As for the WebResource.axd , it use machinekey to encrypt the
assembly/resource item parameters. by default, the machinekey of a .NET
application is randomly generated. Thus, if you're using webfarm or your
application will frequently restart due to some reason, you'll likely to
get such invalid exception when a former generated encryption parameter is
passed to webresource.axd .
One thing you can try is manually supply a fixed machinekey for your
ASP.NET application to see whether it helps:
#Getting CryptographicEx ception exception "Padding is invalid and cannot be
removed" after Migrating to ASP.NET 2.0 http://blogs.msdn.com/paraga/rss_tag_ASP.NET+2.0.xml
#ASP.Net¡¯s WebResource.axd and machineKey badness http://blog.aproductofsociety.org/?p=11
The machinekey has many other impacts on ASP.NET services, here is a good
article mentioned them:
#How To: Configure MachineKey in ASP.NET 2.0 http://msdn2.microsoft.com/en-us/library/ms998288.aspx
Hope this also helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
=============== =============== =============== =====
Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Reply-To: "AG" <NO**********@n ewsgroups.nospa m> From: "AG" <NO**********@n ewsgroups.nospa m> References: <eK************ **@TK2MSFTNGP05 .phx.gbl>
<79************ *************** *******@microso ft.com>
>Subject: Re: Exception - Padding is Invalid Date: Wed, 9 Jan 2008 21:05:12 -0500
Thanks Bruce,
Since I can't run any network traces, it sounds like I have to just ignore it, unless it becomes more frequent.
--
AG Email: discussATadhdat aDOTcom
"bruce barker" <br*********@di scussions.micro soft.comwrote in message news:79******* *************** ************@mi crosoft.com...
>>a webresource request has encrypted parameters (assembly name, and
resource
>id) so a user canot just randomly pluck out resources values (such as a connect string). after encryption, the parameters are convereted to
base64
>to make the strings url safe. due to base64's algrothrym a the string
length
>is always a mutilpe of three. to get this padding is added.
the error message means the parameter string was truncated (or has
illegal
>charaters) and does not match the url rendered. this is usally caused by
a
>proxy server that truncates the url because it too long, or performs some other translation.
you would to run network traces to see if your end or the other end is causing the problem.
-- bruce (sqlwork.com)
"
Thanks Steven, I will try that.
--
AG
Email: discussATadhdat aDOTcom
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:KD******** *****@TK2MSFTNG HUB02.phx.gbl.. .
Hi AG,
As for the WebResource.axd , it use machinekey to encrypt the
assembly/resource item parameters. by default, the machinekey of a .NET
application is randomly generated. Thus, if you're using webfarm or your
application will frequently restart due to some reason, you'll likely to
get such invalid exception when a former generated encryption parameter is
passed to webresource.axd .
One thing you can try is manually supply a fixed machinekey for your
ASP.NET application to see whether it helps:
#Getting CryptographicEx ception exception "Padding is invalid and cannot
be
removed" after Migrating to ASP.NET 2.0 http://blogs.msdn.com/paraga/rss_tag_ASP.NET+2.0.xml
#ASP.Net¡¯s WebResource.axd and machineKey badness http://blog.aproductofsociety.org/?p=11
The machinekey has many other impacts on ASP.NET services, here is a good
article mentioned them:
#How To: Configure MachineKey in ASP.NET 2.0 http://msdn2.microsoft.com/en-us/library/ms998288.aspx
Hope this also helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
=============== =============== =============== =====
Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
>>Reply-To: "AG" <NO**********@n ewsgroups.nospa m> From: "AG" <NO**********@n ewsgroups.nospa m> References: <eK************ **@TK2MSFTNGP05 .phx.gbl>
<79************ *************** *******@microso ft.com>
>>Subject: Re: Exception - Padding is Invalid Date: Wed, 9 Jan 2008 21:05:12 -0500
Thanks Bruce,
Since I can't run any network traces, it sounds like I have to just ignore it, unless it becomes more frequent.
--
AG Email: discussATadhdat aDOTcom
"bruce barker" <br*********@di scussions.micro soft.comwrote in message news:79****** *************** *************@m icrosoft.com...
>>>a webresource request has encrypted parameters (assembly name, and
resource
>>id) so a user canot just randomly pluck out resources values (such as a connect string). after encryption, the parameters are convereted to
base64
>>to make the strings url safe. due to base64's algrothrym a the string
length
>>is always a mutilpe of three. to get this padding is added.
the error message means the parameter string was truncated (or has
illegal
>>charaters) and does not match the url rendered. this is usally caused by
a
>>proxy server that truncates the url because it too long, or performs some other translation.
you would to run network traces to see if your end or the other end is causing the problem.
-- bruce (sqlwork.com)
"
Thanks for your reply,
If you got any new results, welcome to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Reply-To: "AG" <NO**********@n ewsgroups.nospa m> From: "AG" <NO**********@n ewsgroups.nospa m> Subject: Re: Exception - Padding is Invalid Date: Thu, 10 Jan 2008 07:54:29 -0500 Thanks Steven, I will try that.
AG Email: discussATadhdat aDOTcom "Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message news:KD******* ******@TK2MSFTN GHUB02.phx.gbl. ..
>Hi AG,
As for the WebResource.axd , it use machinekey to encrypt the assembly/resource item parameters. by default, the machinekey of a .NET application is randomly generated. Thus, if you're using webfarm or your application will frequently restart due to some reason, you'll likely to get such invalid exception when a former generated encryption parameter
is
>passed to webresource.axd .
One thing you can try is manually supply a fixed machinekey for your ASP.NET application to see whether it helps:
#Getting CryptographicEx ception exception "Padding is invalid and cannot be removed" after Migrating to ASP.NET 2.0 http://blogs.msdn.com/paraga/rss_tag_ASP.NET+2.0.xml
#ASP.Net¡¯s WebResource.axd and machineKey badness http://blog.aproductofsociety.org/?p=11
The machinekey has many other impacts on ASP.NET services, here is a good article mentioned them:
#How To: Configure MachineKey in ASP.NET 2.0 http://msdn2.microsoft.com/en-us/library/ms998288.aspx
Hope this also helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead ============== =============== =============== ======
Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each
follow
>up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscripti...t/default.aspx.
============== =============== =============== ======
This posting is provided "AS IS" with no warranties, and confers no rights.
The problem does occur rather frequently - over a hundred times overnight on
one occasion. I'm not able to reproduce it consistently, and have seen only a
handful of errors in 24 hours on most occasions.
Can you determine where did those problem request come from? Is your
appliation an internet application or intranet one?
Best regards,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at: ms****@microsof t.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Thread-Topic: Exception - Padding is Invalid thread-index: AciKLmKHo8lmnQm MQgi5jOiciJcoXg == Subject: Re: Exception - Padding is Invalid Date: Wed, 19 Mar 2008 19:02:00 -0700
> The problem does occur rather frequently - over a hundred times overnight
on
>one occasion. I'm not able to reproduce it consistently, and have seen
only a
>handful of errors in 24 hours on most occasions.
A sampling indicates the requests come from googlebot. The site is hosted at www.dometech.com
Thanks for your reply mudnug,
If googlebot is the source agent, I think you've run into a common problem.
The google cache may contains a cached version of entire page(include the
viewstate hidden field). Thus, it will always send the cached
viewstate(that is specific to the certain machinekey which is used to sign
it). Then, when the application's server-side machinekey has changed, the
request based on the cached page will fail(with the invalid exception you
saw). Here is a web article also mentioned this:
#A Product of Society http://blog.aproductofsociety.org/?p=11
If most of the errors in your site is caused by this, I think you can
simply ignore it.
Best regards,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at: ms****@microsof t.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?TWF0dGhldw= =?= <mu****@communi ty.nospam> References: <eK************ **@TK2MSFTNGP05 .phx.gbl>
<79************ *************** *******@microso ft.com>
<Os************ **@TK2MSFTNGP02 .phx.gbl>
<KD************ *@TK2MSFTNGHUB0 2.phx.gbl>
<93************ *************** *******@microso ft.com>
<iI************ **@TK2MSFTNGHUB 02.phx.gbl>
<E8************ *************** *******@microso ft.com>
<fQ************ **@TK2MSFTNGHUB 02.phx.gbl>
>Subject: Re: Exception - Padding is Invalid Date: Thu, 20 Mar 2008 15:55:01 -0700
> A sampling indicates the requests come from googlebot. The site is hosted
at
>www.dometech.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Toronto Web Designer |
last post by:
I'm having trouble with the padding and margin properties. IE tends to be
happier with the padding and Netscape with the margin property.
So I tried this:
<link href="netscape-styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
@import url(ie-styles.css);
</style>
|
by: Hello |
last post by:
Here problem is that in Mozilla the logo "The Website" will not pad from the
edge.
http://www.clickatus.com/test/
Also, when I put in loose DOCTYPE it blows the whole thing... Help...
http://www.clickatus.com/test/1
|
by: lkrubner |
last post by:
I've come up with a non-frame version of this site:
http://www.lauradenyes.com/
However, the owner doesn't like my version because the content in the
center sits too high in the center part, which wasn't a problem with
the frames.
The advantage of frames is that you can have a height based on a
percent of the frame, even when the frame takes up less than 100% of
|
by: craig |
last post by:
I am wondering if there are some best practices for determining a strategy
for using try/catch blocks within an application.
My current thoughts are:
1. The code the initiates any high-level user tasks should always be
included in a try/catch block that actually handles any exceptions that
occur (log the exception, display a message box, etc.).
2. Low-level operations that are used to carry out the high level tasks
|
by: Nick Flandry |
last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my
development environment (Win2K server running IIS 5) and a test environment (also Win2K server
running IIS 5), but fails on IIS 6 running on a Win2003 server.
The web uses Pages derived from a custom class I wrote (which itself derives from Page) to provide
some common functionality. The Page_Load handler the failing webpage starts out like this:
...
| |
by: MR |
last post by:
I get the following Exception "The data at the root level is invalid. Line
1, position 642" whenever I try to deserialize an incoming SOAP message. The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with...
|
by: Alan Silver |
last post by:
Hello,
I have an error logging system on one of my sites, so that if an
unexpected exception occurs, I get an e-mail sent. The e-mail includes
the name of the page on which the exception occurred, so I can track it
down.
I have been getting a lot of e-mails recently showing the source of the
exception as being WebResource.axd, and I'm not sure what's happening. I
wonder if anyone here has any ideas.
|
by: Francine.Neary |
last post by:
Consider the following situation. I have a large static array s of
structs, say of size 500. I also need a smaller array of chars, say of
size 100, which has nothing to do with the struct.
To conserve memory, I'd like if possible to use (after checking with
offsetof and sizeof that there's enough padding to fit a char -
usually it will be) space between fields in the structs to store these
chars. If the padding is between fields s.a and...
|
by: rdlauer |
last post by:
For some time now we've been seeing seemingly random errors thrown by
an application "Padding is invalid and cannot be removed". Everything
I've read about this online suggests that the machine key is different
between two load-balanced servers, but this application is running on
just one server. The other odd thing is that the errors come in
groups. Over a short period of time (5 minutes or so) many different
users will hit this error...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |