Copied to clipboard

Flag this post as spam?

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


  • Daniel 44 posts 187 karma points
    Oct 15, 2012 @ 18:22
    Daniel
    0

    Model.MediaById gives error Error loading MacroEngine script (file: )

    Hi,

    I'm running Umbraco 4.7.1.1 and are fetching media files through an inline macro in a template. This worked as a charm when I find uploaded the project to the server and it still works just fine locally, but suddenly it stopped working on the server.

    The original code is more complex, but I found out that this simple code fails:

                <umbraco:Macro ID="MacroImg" runat="server" language="cshtml">
                @inherits umbraco.MacroEngines.DynamicNodeContext
                @using umbraco.MacroEngines;
                @using umbraco.cms.businesslogic.media;
                        
                <span><img src="@Model.MediaById(1142).umbracoFile" /></span>
                </umbraco:Macro>

    I have made sure that the ID is in fact a valid ID in the media folder and that the file it's pointing to is reachable through a straight URL call.

    The only error message I get is:
    Error loading MacroEngine script (file: )

    Is there anyone who have a clue on why this error suddenly started appearing and what could be done to solve it?

    Or can I get some pointers to how I get a more specific error message?

    See the error live here:
    http://www.nidacatering.com/om-nida/?umbDebugShowTrace=true

    Thanks,
    Daniel

     

     

     

     

     

  • Becky 5 posts 25 karma points
    Nov 19, 2012 @ 17:27
    Becky
    0

    We are currently having a similar issue with our own site, yours appears to be resolved, any chance you could let us know how?

  • Dan 1288 posts 3921 karma points c-trib
    Jun 14, 2013 @ 15:19
    Dan
    0

    Hi,

    Did either of you find a cause/solution for this?  I'm getting the same thing suddenly, despite nothing having changed (code-wise at least) on the site for several weeks.

    Any pointers would be much appreciated.

    Thanks.

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 15, 2013 @ 01:49
    Jeavon Leopold
    1

    I have seen this issue when the Examine index has become corrupted for some other reason. DynamicNode that MediaById is a method of uses Examine as a sort of caching layer for media hence why this issue may occur. To rebuild you Examine indexes you need to do the following, Stop App Pool, Delete all folder and files within App_Data/Temp/ExamineIndexes/ and then Start the App Pool 

  • Dan 1288 posts 3921 karma points c-trib
    Jun 17, 2013 @ 11:17
    Dan
    0

    Nice, thanks Jeavon - that did the trick!

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 17, 2013 @ 11:29
    Jeavon Leopold
    0

    Great to hear, annoying one but just sometimes the indexes do get corrupted for no clear reason.

  • Funka! 398 posts 661 karma points
    Jun 17, 2013 @ 21:29
    Funka!
    0

    Is there a programmatic way to determine if/when Examine indexes may be corrupted? Is this also just a problem of the past i.e., version 4.7.x as OP noted, that may have been fixed in a later version?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 19, 2013 @ 17:49
    Jeavon Leopold
    0

    Hi @Funka!

    That is an interesting idea, I have never tried to check but I guess it must be possible with some exception handling that could then trigger a rebuild.

    As to if it is a problem of the past, from personal experience I would say that it has become a less frequent issue but it does sometimes happen, for example if a server is shutting down, app pool crashes or server runs out of disk space during a index rebuild etc....

    Lucene was upgraded in Umbraco 4.8 so maybe that has stabilised it a bit whilst running, but I am not sure.

    Thanks,
    Jeavon
  • Justin Moore 41 posts 100 karma points
    Jun 23, 2013 @ 23:35
  • Jesper Ordrup 1019 posts 1528 karma points MVP
    May 21, 2014 @ 12:14
    Jesper Ordrup
    0

    I'm having a similar problem in Umbraco 6.11 using Model.MediaById. It returns nothing until I restart app pool ... 

Please Sign in or register to post replies

Write your reply to:

Draft