Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tobias Klika 101 posts 570 karma points c-trib
    Oct 26, 2014 @ 19:20
    Tobias Klika
    0

    Calling TypedMedia throws exception by Examine

    Hi!

    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 ;-)

    enter image description here

    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.

  • Tobias Klika 101 posts 570 karma points c-trib
    Oct 27, 2014 @ 10:26
    Tobias Klika
    0

    No one else who experienced this?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Oct 27, 2014 @ 12:08
    Jeroen Breuer
    0

    I haven't seen this before. Perhaps it's an issue with server rights? The examine indexes are files on the server.

    Jeroen

  • Tobias Klika 101 posts 570 karma points c-trib
    Oct 27, 2014 @ 14:36
    Tobias Klika
    0

    It's easy to reproduce in a new project:

    1. Create ASP.NET Web App in VS.
    2. Add Umbraco 7.1.8 from NuGet
    3. Setup (I did it with SQLExpress DB)
    4. In the backend create a media folder and place an "Image" in it.
    5. In the frontend call Umbraco.TypedMedia([mediaid])

    This will raise the exception ..

  • Tobias Klika 101 posts 570 karma points c-trib
    Oct 27, 2014 @ 17:06
    Tobias Klika
    101

    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.

  • Johan Uddståhl 5 posts 25 karma points
    Feb 27, 2015 @ 11:38
    Johan Uddståhl
    0

    Hey, I have the same problem! Tobias, do you have the source code to your solution?

    BR, Johan

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Apr 07, 2015 @ 03:37
    Shannon Deminick
    0

    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.

    Just my code

    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:

    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... ?

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Apr 07, 2015 @ 03:40
    Shannon Deminick
    0

    Ah, sorry i just saw your statement:

    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.

  • Petter Christie 5 posts 26 karma points
    Apr 29, 2015 @ 18:39
    Petter Christie
    0

    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?

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Apr 29, 2015 @ 22:56
    Shannon Deminick
    0

    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.

  • Petter Christie 5 posts 26 karma points
    Apr 30, 2015 @ 12:55
    Petter Christie
    0

    This is the results I see when I run a monitoring agent (Dynatrace) on a Window 2012 server with IIS 8,5.

     

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    May 05, 2015 @ 05:46
    Shannon Deminick
    0

    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?

  • Petter Christie 5 posts 26 karma points
    May 12, 2015 @ 09:59
    Petter Christie
    0

    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.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    May 12, 2015 @ 10:01
    Shannon Deminick
    0

    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'.

  • Chris Roberts 74 posts 106 karma points c-trib
    Sep 23, 2015 @ 13:46
    Chris Roberts
    0

    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.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Sep 23, 2015 @ 17:56
    Shannon Deminick
    0

    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

    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.

Please Sign in or register to post replies

Write your reply to:

Draft