ScriptResources Error : This is an invalid script resource request
Asked Answered
F

2

18

We catch this error sporadically. Does anyone know what could it be?

The URL give by our error logging get this weird url for this error :

http://ourWebSite.com/ScriptResource.axd?d=-TlQhVhw2O9j_FRLgdQvFzJxWKYVH6aV62Jse0uO_9PoMsQJaDGiZYtRoBbTATQiWul69JuMDMqOA-yDDycgyNFrGPA_wlnKXZEyWGfJeCg1&t=3717b609

And the error is :

Error : This is an invalid script resource request.

We also get the stacktrace :

System.Web.HttpException: This is an invalid script resource request. at System.Web.Handlers.ScriptResourceHandler.Throw404() at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context) at System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

What could it be? And how can it be solve?

Figwort answered 1/11, 2010 at 13:0 Comment(0)
D
30

I get this error quite often, doing some research I have found the following.

  1. If you have a web farm your machine keys might not be setup, if this is the case you can resolve the issue by setting the machine key for each server in your web farm. The error can also happen if the machine key changes between post backs which can sometime happen. I believe if you are not using a web farm this is well not happen very often. If you have a web farm this is the most likely cause.
    http://msdn.microsoft.com/en-us/library/ms998288.aspx

  2. It can be caused by spiders, a robots.txt file may help, but only if they are well behaved. A better solution might be to log the IP address of the clients causing the error and if they look like a spider, ban the IP address, be careful not to block legitimate users though.

Sample robots.txt

User-agent: *  
Disallow: /WebSite/ScriptResource.axd  
Disallow: /WebSite/WebResource.axd  

3. The users session timing out will also cause this error.

Hope one of these answers helps

Sources
1) System.Web.HttpException: This is an invalid script resource request
2) http://www.mojoportal.com/Forums/Thread.aspx?pageid=5&mid=34&ItemID=2&thread=4501&pagenumber=1
3) http://www.thestudentroom.co.uk/showthread.php?t=1258531#post25063929

Decile answered 10/1, 2011 at 11:28 Comment(1)
Here's a resource I found useful: blogs.telerik.com/aspnet-ajax/posts/07-03-27/…. There is a link to a standalone page near the end of the article. You add it to your project and click "browse with..." in Visual Studio. You paste the d=... query string and it tells you to what the query string refers.Promenade
C
3

You may be using AJAX. ScriptResource.axd is a handler meant to serve your scripts that are in turn stored inside your assembly.

http://forums.asp.net/t/1258715.aspx

The URL isn't weird if you think about it. It has two parameters d and t. Can you reproduce this error at will?

Cesarcesare answered 1/11, 2010 at 13:36 Comment(4)
We are not able to determine exactly why or even where it occurs. We have in any case never managed to recreate the problem. It seems that it happens sporadically. Fortunately, this does not occur more than once or twice for all the sites we have a day. But we'd like to know the reason ...Recap
Yeah ok, maybe its AJAX as you said but, "we" do not use AJAX in our site exept a Compoment we've bought from a trust compagny. But is there anything we can do to stop receive this error?Recap
Normally, 404 means a resource is not found. Now, this can be a liar message, simply because if there are file types blocked on your server or URL Scan is installed it would block it every time. Since you said that it happens only once in a while, to troubleshoot it, you should take a look at your IIS Logs and figure out what is the error code along with 404. support.microsoft.com/kb/943891. Notice the code after 404. Check the KB article for more. 404.6 for instance will be verb denied!Cesarcesare
We'll check with our web hoster so maybe we could try to find a solution. Thank you Rahul... but I still can figure out why it happens "sometime"...Recap

© 2022 - 2024 — McMap. All rights reserved.