Copied to clipboard

Flag this post as spam?

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


  • Steve Morgan 1345 posts 4452 karma points c-trib
    Mar 07, 2018 @ 11:17
    Steve Morgan
    0

    Site Fails to Start up on deployment due to missing template

    Hi,

    I think I've worked out the cause but I can't recreate this in a different solution so is this something specific to my solution or a wider bug - I don't know!

    We have automated deployments - at 3am the live site went down following the deployment. I couldn't get into the back office and pages either took an age or failed to load. The app seemed to repeatedly try to restart but never quite made it.

    I think the issue was due to two new doctypes (used for nested doc types) but I'd meant to choose a doc type without a template and didn't. The site failed to load - each page request timed out and the app restarted each time.

    I can see lots of

    INFO  Jumoo.uSync.BackOffice.uSyncAction - Action: Import New Doc Type Umbraco.Core.Models.ITemplate Can't get template path (are template files missing?) 
    

    I can see that this is because I've forgot to include the view in the solution so the error is correct but any ideas why this causes the solution to struggle?

    On a new, clean solution with the same version of uSync 4.02, I can't recreate this behaviour - I think it's only in solutions with a large number of doc types or due to the Models Builder then trying and failing?

    The workaround (in case anyone reading this has this issue) is to set in uSyncBackOffice.config

    <!-- run import at startup -->
      <Import>false</Import> 
    

    and run a full export with delete from the uSync back office - then you can set the setting back. I then removed the offending templates from the doc types and syncing works again.

    Any ideas how to ensure that if a cludgy dev (me) does this again we don't have a live issue?!

    Sorry for the rambley post - I'd like to raise a ticket for it and help fix it if it's a bug but I'm struggling to recreate as I say!

    Cheers and keep up the great work! Steve

  • Steve Morgan 1345 posts 4452 karma points c-trib
    Mar 07, 2018 @ 11:24
    Steve Morgan
    0

    UPDATE:

    I think this is LiveDll mode of ModelsBuilder doing this. Still investigating.

  • Kevin Jump 2309 posts 14673 karma points MVP 7x c-trib
    Mar 07, 2018 @ 11:50
    Kevin Jump
    0

    Hi

    i think uSync will carry on if the template file is missing from the disk, and that shouldn't cause an issue.

    however as you say if you have LiveDLL mode for models builder, then yes i think it would restart your site when it rebuilds the models (everytime a doctype changes?) so that might well be whats going on.

    Don't know enough about models builder's internals - but you could turn off the LiveDLL bit and then hook into uSync's events to trigger a rebuild of the models once the import has been completed (but it might well just restart the site, and you would be in a loop again?)

    Kevin

  • Kevin Jump 2309 posts 14673 karma points MVP 7x c-trib
    Mar 07, 2018 @ 11:52
    Kevin Jump
    100

    further throughts : What a missing template will do is cause uSync to think the doctype that uses that template isn't in sync (because the sync file will have the template set, but it won't exist on the live site - so the doctype will be diffrent)

    This will make uSync try and fix the problem, which will cause a save of the doctype which might be the trigger for models builder to rebuild the models (and restart the site and start again....)

    copy the template file to the server!

  • Steve Morgan 1345 posts 4452 karma points c-trib
    Mar 07, 2018 @ 11:55
    Steve Morgan
    0

    I think you've identified the issue. That's the way I was thinking. Sorry for "blaming" usync - it's obviously a bit of an edge case.

    I'm not sure I can either stop myself or another dev from not adding a View to a solution again in the future so I might switch to dll mode on ModelsBuilder (as LiveDLL causes some serious slow down in the back office anyhow) that way it should be safe.

    Thanks for coming back so quickly.

    Steve

Please Sign in or register to post replies

Write your reply to:

Draft