This is a migrated thread and some comments may be shown as answers.

"This is an invalid webresource request" exception is still occurring

9 Answers 1439 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Graeme Mc
Top achievements
Rank 1
Graeme Mc asked on 06 Jun 2012, 03:59 PM

Good day,

We’ve been experiencing the invalid webresource exception for at least a few weeks now, mainly on IE7 and IE8, although we’ve also seen it on IE9 and Firefox (but far less frequently). 

2012-06-06 14:10:23,238 [20] [admin] [xbqai0wdtzjrg2akwu0hjrc1] [(null)] ERROR Global - Unhandled exception was [System.Web.HttpException (0x80004005): This is an invalid webresource request.

2012-06-06 16:11:49,758 [17] [(null)] [(null)] [(null)] ERROR Global - Application_Error : unhandled exception processing /[AppName]/WebResource.axd?d=Suu-bg3mCuf0dFdR6OaZkvX4qIzt-FMOe6pPRuU-iok0iBRX7G8SkmhJ6f6sVdRz5vgh3rhLmGeuyVCZQ7NlYAkluB8OomTcba5DZz_nqarySe1LWUgUVAdCHlVY9NrY1NCgWnu8yVgPuJfiygFy-Q2&t=634739782657507859


We fixed this by using fixed Machine Keys in IIS, and once all the users had deleted their Temporary Internet Files, we did not see the exception again. At least, until we deployed the latest build of our code onto the server.

Now, the issue is recurring fairly randomly and what happens is on certain pages our application, the selected menu item disappears as do the background images for RadTabStrips. What’s interesting is that it only happens on Internet Explorer (even 9), and if we open Developer Tools and check “Always refresh from server” under Cache, the problem goes away, but returns as soon as we uncheck that option.

We then went to our Temporary Internet Files folder and noticed that there are a number of files with names like: Telerik.Web.UI.WebResource.axd?compress=x&Telerik.Web.UI%2c+Version%3d2012.1.215.40%2c+Culture%3dneutral%2c …

We then opened all of these into Notepad and took the each of the problematic URLs in the error log to try and find the culprit, but to no avail.

We do have the following code on our Master page (if that helps):

<telerik:RadScriptManager ID="RadScriptManager" runat="server" EnableScriptGlobalization="true" EnablePageMethods="true" EnableScriptCombine="true">

<CompositeScript>

                    <Scripts>

                        <asp:ScriptReference Path="~/Javascript/jquery1.js" />

                        <asp:ScriptReference Path="~/Javascript/JavaScript1.js" />

                    </Scripts>

       </CompositeScript>

       </telerik:RadScriptManager>

 

 

We are unable to provide a sample of the issue, as we can’t reproduce it locally (other than with automatically generated keys).

Any advice you can provide would be greatly appreciated.

 

Kind regards,

Graeme

 

9 Answers, 1 is accepted

Sort by
0
Accepted
Kate
Telerik team
answered on 11 Jun 2012, 09:12 AM
Hello Graeme,

The issue that you get seems to be related to how your machine caches the resources need for the page to load correctly (might be the script, the styles or both). Please take a look at the following articles that will provide you with more information on the matter:
  • http://stackoverflow.com/questions/1922910/force-browser-to-clear-cache
  • http://blogs.telerik.com/blogs/posts/07-03-26/debugging-asp-net-2-0-web-resources-decrypting-the-url-and-getting-the-resource-name.aspx
  • http://www.telerik.com/help/aspnet-ajax/menu-output-cache.html

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Graeme Mc
Top achievements
Rank 1
answered on 12 Jun 2012, 11:33 AM
Hi Kate

 

Thanks for your reply. We had already been using the code to decrypt the invalid web resource but it doesn’t actually help because whenever the exception occurs and we put the URL in the decrypter, it simply returns with a message saying it was unable to decrypt.

Regarding the first link you sent, please correct me if I’m wrong, but won’t that simply delay the exceptions until a later date? In my understanding, the issue is that there are cached resources whose URL’s have been encrypted with a machine key, and if the machine key is changed, then those URL’s won’t be valid any longer, hence the “invalid web resource” exception. This is why deleting temporary files fixes the problem. But by changing the expiry date of those cached files, say to six months, will they not become invalid in six-month’s time and we’ll just see the exception thrown then?

We’ve established that when we see the RadTabStrips disappearing, the mark-up contains the following link:

Telerik.Web.UI.WebResource.axd?compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2012.1.215.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ab29b07e8-2c1e-44e5-9e1b-59bb6459fb01%3a45085116%3a5951aeec%3a2b415891%3a8cee9284%3aed057d30%3a1f65231b%3a7f7626a2%3bTelerik.Web.UI.Skins%2c+Version%3d2012.1.215.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ac9ac2006-b530-4a4f-ab3e-0fa33ec3f0c2%3aa18d138c

When opening this link in Web Inspector, we find the URL that’s throwing the exception:

/* START Telerik.Web.UI.Skins.Default.PanelBar.Default.css */

…url('/[AppName]/WebResource.axd?d=XQOw2bi2hiOcI1HrHB63eohqAMQS7-g1y-ESs5J6nduVRycUE7XO1looSbdjHvsEZrEOGCHm9utsWt9n6DDdBItfYUmrOeGXIQkGbRq8UU9jNgUR_5alKPcmClxi376Fpr5yMU_oQKvGmQTbEvWnSA2&t=634750017209629723')

/* END Telerik.Web.UI.Skins.Default.PanelBar.Default.css */

 

We’ve been using the RadPanelBars and the RadTabStrips for the last few years and we’ve never encountered this problem before. The only two things that have changed are that we’ve moved to IIS7 and that we’ve set EnableScriptCombine ="true". 

 

Is it possible that there’s an issue with the way these controls are handled by IIS7?

 

0
Kate
Telerik team
answered on 15 Jun 2012, 10:36 AM
Hi Graeme,

Thank you for the additional information. However, I am not quite sure what is causing the issue that you get and I can only guess on the actual cause. Can you please provide a fiddler log or a live url that we can inspect locally and observe it from our side? Another suggestion that I can come up with is to try using our CDN and see how that will go.

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
BrianS
Top achievements
Rank 1
answered on 13 Nov 2013, 02:57 PM
We're having similar issues as Graeme with our application when updated code was recently deployed to the production IIS 7 machine.  Several users are still generating this error even after we have cleared their cache. Decrypting the resource is not working either. .Net 4.5 and security patches were recently deployed to the server along with updated code.

Did you ever find a solution to this problem?
0
Graeme Mc
Top achievements
Rank 1
answered on 13 Nov 2013, 03:37 PM
Hi Brian,

We added a key to our web.config file, which seems to have solved the problem:
<machineKey decryption="DES" decryptionKey="xxx" validationKey="yyy" />

And then in IIS, under Machine Key for the website, we have
Encryption Method = SHA1
Decryption Method = DES

All the checkboxes for Validation key and Decryption key are unchecked, and then obviously "xxx" and "yyy" are in the key fields.

After making this change, you may need to recycle your app pool, and clear browser caches.

Hope that helps!

Graeme
0
TonyG
Top achievements
Rank 1
answered on 02 Dec 2013, 06:08 PM
And I'm getting this from 2013.3.1114 when running in debug from VS2010 with FireFox.

This is an invalid webresource request.

It happens on the first postback of some controls, not all. :(

(Oh, and I'm not using MVC, I'm using webforms. )
0
Kate
Telerik team
answered on 03 Dec 2013, 12:54 PM
Hi Tony,

The most common cause of such a mysterious issue is a missing file that is requested through the WebResource.axd handler.

Can you get the WebResource URL that is generating this error? If so, please use the approach suggested in this blog post to get the name of this particular resource. This will give us a clue about what is this resource and where it is located. If it is in our assembly, we will investigate it further.

Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
TonyG
Top achievements
Rank 1
answered on 03 Dec 2013, 08:28 PM
I'm sorry, I had to jump to solve other issues and will need to get back to this in a couple days.

The decryption shows the file is WebForms.js. Seeing a couple other reports about this in forum and docs, I've added script references to RadScriptManager:

<asp:ScriptReference Name="WebForms.js" Assembly=" System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly=" System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

That did not resolve the issue.

I'll do more testing and report back with the latest status. I've had to make significant changes to the code and this issue might go away as a result ... as happens with these things.
0
Kate
Telerik team
answered on 05 Dec 2013, 09:37 AM
Hi Tony,

Please take your time for testing and updating the project and let me know should you get any other exceptions or questions.

Regards,
Kate
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Graeme Mc
Top achievements
Rank 1
Answers by
Kate
Telerik team
Graeme Mc
Top achievements
Rank 1
BrianS
Top achievements
Rank 1
TonyG
Top achievements
Rank 1
Share this question
or