views:

1744

answers:

4

Hi, We keep getting this exception "Application_Error: Unhandled exception has been occured while requesting:/~/media/Flash Movies/nameoftheItem.ashx System.ArgumentNullException: Value cannot be null. Parameter name: ownerType while requesting a media item."

We've lots of media items and they're all working fine. We get this exception just for two specific items (one of them is a flash movie the other one is an image).

I'm quite sure that's something wrong with that items but I can't find anything.

Do you have any idea what can it be?

Thanks, Zerdush

A: 

Try Publishing the items in question again and checking the 'web' database that the field 'ownerType' is populated for the item. This ALWAYS gets me...

Trevor
A: 

Your URL fragment /~/media/Flash Movies/nameoftheItem.ashx is appears to be badly formed.

Typically you'd start a URL in ASP.NET with a tilde ~ to indicate the root of your web application. ASP.NET would then figure out how that translates to a full URL. It could be on the root of the domain or in a virtual directory somewhere, but the idea is that your application shouldn't care. The tilde simply indicates the root of your application.

Unfortunately, in this case it appears that a slash got prepended onto the front, so that the interpretation is that the full url will be something like http://www.mydomain.com/~/media/Flash Movies/nameoftheItem.ashx as the tilde is no longer on the front of the URL fragment that ASP.NET sees.

Colin Mackay
A: 

Maybe you just don't have this item in web database because of rights, publishing restrictions or maybe flash movie upload failed and caused corrupted media item. (You would see error on log file if upload failed for some user) To confirm that item exist in web database. Login to Shell as Administrator then on right bottom next to clock click database icon and try to switch to webdatabase. Then launch content editor and browse to media item and see that item is there. If not try to republish and check out rights and publish settings.

jpkeisala
A: 

I have been looking at this error in our logs, and the missing parameter is actually thrown by a Sitecore logging method. It might mean that it's a Sitecore bug. I saw a post in their (password-protected) developer forums that was basically this question, and got no reply...

If I end up posting a support ticket for it I'll follow up here with what I find out.

Here's the stack trace that makes me think Sitecore's got the bug:

System.ArgumentNullException: Value cannot be null. Parameter name: ownerType at Sitecore.Diagnostics.Error.AssertObject(Object argument, String name) at Sitecore.Diagnostics.Log.Error(String message, Exception e, Type ownerType) at Sitecore.Web.WebUtil.TransmitStream(Stream stream, HttpResponse response, Int32 blockSize) at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext context) at Sitecore.Resources.Media.MediaRequestHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

jbgoode
I've contacted to their support recently about this issue, and they said that it is bug in their system and it was fixed in the latest version. We are going to upgrade our site and give it a try next week. I'll let you know guys if it fixes the issue.
Zerdush
Yes, I found out recently that Sitecore 6.1 fixes this issue. We've not upgraded yet, but supposedly that's the deal. Keep us posted!
jbgoode