When I call UmbracoHelper.TypedMedia(1000),
it seems to work but throws a System.NotSupportedException which is raised by Examine.
This does happen all the time. The medias do exist by the way ;-)
It wouldn't be a problem for me as I can set it to not break when it throws (as the method still works), but it takes incredibly long to get a response from sites which contain media images.
Any ideas?
PS. Umbraco v7.1.8. Media Document Type is the default. ExamineSettings and ExamineIndex.config too. I've also rebuilt the index.
I have solved it myself.
It's only a workaround but fast and reliable so far.
The call to TypedMedia with the handled exception took about 100ms (with a database request), 'cause it couldn't find the media in the index, for whatever reason?!
So I've created my own Examine Index for the media type Image, and searched directly with Examine instead of UmbracoHelper.TypedMedia. I don't have the IPublishedContent anymore, but who cares, as long as I get access to the properties.
I cannot replicate this issue but you should be able to ignore first chance exceptions and I would assume you would only see this issue when you are debugging in Visual Studio. Depending on your debugging settings in Visual Studio it might break on first chance exceptions, so you should really enable the 'Enable Just My Code' in the debugging settings.
You won't see this error without a debugger attached and you won't see any exceptions in the logs because Lucene.Net is handling them internally like it's supposed to.
What I'm not sure about is your statement here:
but it takes incredibly long to get a response from sites which contain media images.
Is this while you are debugging or normally? During app startup or otherwise, etc... ?
The call to TypedMedia with the handled exception took about 100ms (with a database request), 'cause it couldn't find the media in the index, for whatever reason?!
So yes, that is why it is taking a while, so now you need to figure out why TypedMedia isn't finding this in your index since that seems pretty odd if you can just query the index directly for the same information. I also can't replicate this with your steps, all my calls to TypedMedia get a result directly from the index.
You are getting that while debugging right? Are you getting a different error when you are not debugging? I'm assuming you have 'just my code' disabled in Visual Studio and it's breaking on this exception inside of Lucene - but Lucene is expecting that error.
Lucene does a lot of things internally where it's expecting it's own exceptions to be thrown and then it handles them, perhaps this is what you are seeing. As I've pointed out earlier, if you have 'just my code' enabled for debugging you probably won't breakpoint to this issue. Also, I'm assuming you aren't actually see 'problems' when running your site, your debugging tools are just catching this exception whilst debugging right?
I think you are right. It looks like the diagnostic tool are picking up exeptions that are thrown somewhere in the code, but is handled later in the code.
We are experiencing errors on the page, but we have been able to run the page without any of the errors in this post, and still experiencing the same errors, so it looks like these errors don't have anything to do with our problem.
Exactly, diagnostic tools will catch exceptions thrown even if they aren't your exceptions and are still handled (i.e. library or framework), but there should be an option to disable that, just like in Visual Studio to enable 'Just my code'.
Just stumbled across this thread as I'm diagnosing a site which also exhibits this behaviour.
I would agree with the conclusion that it's "just an internal thing" - except for the fact that, as far as I can tell, it is causing a massive delay on our live site.
We were running v6.1.6, just upgraded to v6.2.5 and it's still happening.
When trying to get help here on the forum, it's always best to describe your own problem. I'm not sure exactly what you mean by
It's still happening
or
except for the fact that, as far as I can tell, it is causing a massive delay on our live site.
If you can please describe the actual problem that you are having in detail it will give us all a better chance to understand your particular circumstance.
Calling TypedMedia throws exception by Examine
Hi!
When I call
UmbracoHelper.TypedMedia(1000)
, it seems to work but throws aSystem.NotSupportedException
which is raised by Examine. This does happen all the time. The medias do exist by the way ;-)It wouldn't be a problem for me as I can set it to not break when it throws (as the method still works), but it takes incredibly long to get a response from sites which contain media images.
Any ideas?
PS. Umbraco v7.1.8. Media Document Type is the default. ExamineSettings and ExamineIndex.config too. I've also rebuilt the index.
No one else who experienced this?
I haven't seen this before. Perhaps it's an issue with server rights? The examine indexes are files on the server.
Jeroen
It's easy to reproduce in a new project:
Umbraco.TypedMedia([mediaid])
This will raise the exception ..
I have solved it myself. It's only a workaround but fast and reliable so far.
The call to
TypedMedia
with the handled exception took about 100ms (with a database request), 'cause it couldn't find the media in the index, for whatever reason?!So I've created my own Examine Index for the media type
Image
, and searched directly with Examine instead ofUmbracoHelper.TypedMedia
. I don't have theIPublishedContent
anymore, but who cares, as long as I get access to the properties.Hey, I have the same problem! Tobias, do you have the source code to your solution?
BR, Johan
I cannot replicate this issue but you should be able to ignore first chance exceptions and I would assume you would only see this issue when you are debugging in Visual Studio. Depending on your debugging settings in Visual Studio it might break on first chance exceptions, so you should really enable the 'Enable Just My Code' in the debugging settings.
Which should suppress these types of things. Lots of library code might be doing try/catch on purpose - like Lucene.Net but VS thinks it should break. There's a couple other options to change the debugging process too, see: http://stackoverflow.com/questions/948590/suppress-first-chance-exceptions, http://blog.functionalfun.net/2008/05/debuggernonusercode-suppressing.html
You won't see this error without a debugger attached and you won't see any exceptions in the logs because Lucene.Net is handling them internally like it's supposed to.
What I'm not sure about is your statement here:
Is this while you are debugging or normally? During app startup or otherwise, etc... ?
Ah, sorry i just saw your statement:
So yes, that is why it is taking a while, so now you need to figure out why TypedMedia isn't finding this in your index since that seems pretty odd if you can just query the index directly for the same information. I also can't replicate this with your steps, all my calls to TypedMedia get a result directly from the index.
Hi
I'm workin on a site where we have experienced the same problem. At leas it looks very similar.
We are using Umbraco 7.2.2 and after getting some diagnostic tools in place we started to see alot of these errors.
The details are here:
When looking at the given line number I see that it is this code: @Umbraco.Media("id").Url.
If I remove this, the error stops. Any ide what might cause this error?
You are getting that while debugging right? Are you getting a different error when you are not debugging? I'm assuming you have 'just my code' disabled in Visual Studio and it's breaking on this exception inside of Lucene - but Lucene is expecting that error.
This is the results I see when I run a monitoring agent (Dynatrace) on a Window 2012 server with IIS 8,5.
Lucene does a lot of things internally where it's expecting it's own exceptions to be thrown and then it handles them, perhaps this is what you are seeing. As I've pointed out earlier, if you have 'just my code' enabled for debugging you probably won't breakpoint to this issue. Also, I'm assuming you aren't actually see 'problems' when running your site, your debugging tools are just catching this exception whilst debugging right?
Sorry for the late response.
I think you are right. It looks like the diagnostic tool are picking up exeptions that are thrown somewhere in the code, but is handled later in the code.
We are experiencing errors on the page, but we have been able to run the page without any of the errors in this post, and still experiencing the same errors, so it looks like these errors don't have anything to do with our problem.
Exactly, diagnostic tools will catch exceptions thrown even if they aren't your exceptions and are still handled (i.e. library or framework), but there should be an option to disable that, just like in Visual Studio to enable 'Just my code'.
Just stumbled across this thread as I'm diagnosing a site which also exhibits this behaviour.
I would agree with the conclusion that it's "just an internal thing" - except for the fact that, as far as I can tell, it is causing a massive delay on our live site.
We were running v6.1.6, just upgraded to v6.2.5 and it's still happening.
Hi Chris,
When trying to get help here on the forum, it's always best to describe your own problem. I'm not sure exactly what you mean by
or
If you can please describe the actual problem that you are having in detail it will give us all a better chance to understand your particular circumstance.
is working on a reply...