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

Thread is closed for posting
11 posts, 1 answers
  1. Graeme Mc
    Graeme Mc avatar
    17 posts
    Member since:
    Aug 2009

    Posted 06 Jun 2012 Link to this post

    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

     

  2. Answer
    Kate
    Admin
    Kate avatar
    1898 posts

    Posted 11 Jun 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Graeme Mc
    Graeme Mc avatar
    17 posts
    Member since:
    Aug 2009

    Posted 12 Jun 2012 Link to this post

    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?

     

  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 15 Jun 2012 Link to this post

    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.
  6. BrianS
    BrianS avatar
    25 posts
    Member since:
    Sep 2006

    Posted 13 Nov 2013 Link to this post

    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?
  7. Graeme Mc
    Graeme Mc avatar
    17 posts
    Member since:
    Aug 2009

    Posted 13 Nov 2013 Link to this post

    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
  8. TonyG
    TonyG avatar
    239 posts
    Member since:
    Feb 2006

    Posted 02 Dec 2013 Link to this post

    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. )
  9. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 03 Dec 2013 Link to this post

    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.
  10. TonyG
    TonyG avatar
    239 posts
    Member since:
    Feb 2006

    Posted 03 Dec 2013 Link to this post

    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.
  11. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 05 Dec 2013 Link to this post

    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.
  12. Tom
    Tom avatar
    8 posts
    Member since:
    Jun 2011

    Posted 24 Apr 2014 Link to this post

    What is the status of this issue cause im pulling my hairs out for this ....
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017