Copied to clipboard

Flag this post as spam?

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


  • Trey 14 posts 107 karma points
    Aug 08, 2016 @ 17:33
    Trey
    0

    This SqlTransaction has completed; it is no longer usable. Exception thrown during import

    Version: (uSync.BackOffice 3.1.4.740) (uSync.Core 5.3.5.740)

    We began getting this error when syncing downstream environments during the initial startup sync. The specific changes that appear to cause this to happen are the moving of a property in a composition from one tab to another.

    If sync on start up is turned off, we are able to access the site and back office, and some changes have been synced. At this point, a manual import from the backoffice will cause the same exception to be thrown.

    We have seemingly been able to work around this by manually doing the changes on the new environment. These changes overwrite the compositions def.config.

    Once the changes have been made manually, an import triggered in the backoffice will succeed without throwing the exception.

    I do not know if the SQL connection is terminated in response to another exception, or if a normal clean up procedure is run while there are still changes left to be synced.

    Below is the exception event log:

    <Event>
    <System>
    <Provider Name="ASP.NET 4.0.30319.0"/>
    <EventID>1309</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>Keywords</Keywords>
    <TimeCreated SystemTime="2016-08-08T16:22:54Z"/>
    <EventRecordID>1715487593</EventRecordID>
    <Channel>Application</Channel>
    <Computer>RD0003FF1DC726</Computer>
    <Security/>
    </System>
    <EventData>
    <Data>3005</Data>
    <Data>An unhandled exception has occurred.</Data>
    <Data>8/8/2016 4:22:54 PM</Data>
    <Data>8/8/2016 4:22:54 PM</Data>
    <Data>32991f861a024c9d83324f81e27fc413</Data>
    <Data>2</Data>
    <Data>1</Data>
    <Data>0</Data>
    <Data>/LM/W3SVC/446857867/ROOT-2-131151469299712672</Data>
    <Data>Full</Data>
    <Data>/</Data>
    <Data>D:\home\site\wwwroot\</Data>
    <Data>RD0003FF1DC726</Data>
    <Data/>
    <Data>21092</Data>
    <Data>w3wp.exe</Data>
    <Data>IIS APPPOOL\{removed}-intranet__1516</Data>
    <Data>HttpException</Data>
    <Data>
    This SqlTransaction has completed; it is no longer usable. at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at     System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) This     SqlTransaction has completed; it is no longer usable. at Jumoo.uSync.BackOffice.uSyncApplicationEventHandler.Setup() at Jumoo.uSync.BackOffice.uSyncApplicationEventHandler.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) at Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(    UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) at Umbraco.Core.CoreBootManager.<Complete>b__a(IApplicationEventHandler x) at Umbraco.Core.EnumerableExtensions.ForEach[TItem](IEnumerable`1 items, Action`1 action) at Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete) at     Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) at Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) at Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e)
    </Data>
    <Data>
    https://{removed}-intranet-umbraco-staging.azurewebsites.net:443/umbraco/
    </Data>
    <Data>/umbraco/</Data>
    <Data>{removed}</Data>
    <Data/>
    <Data>False</Data>
    <Data/>
    <Data>IIS APPPOOL\{removed}-intranet__1516</Data>
    <Data>9</Data>
    <Data>IIS APPPOOL\{removed}-intranet__1516</Data>
    <Data>False</Data>
    <Data>
    at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[]     handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
    </Data>
    </EventData>
    </Event>
    <Event>
    <System>
    <Provider Name="ASP.NET 4.0.30319.0"/>
    <EventID>1309</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>Keywords</Keywords>
    <TimeCreated SystemTime="2016-08-08T16:33:33Z"/>
    <EventRecordID>1716126906</EventRecordID>
    <Channel>Application</Channel>
    <Computer>RD0003FF1DC726</Computer>
    <Security/>
    </System>
    <EventData>
    <Data>3005</Data>
    <Data>An unhandled exception has occurred.</Data>
    <Data>8/8/2016 4:33:33 PM</Data>
    <Data>8/8/2016 4:33:33 PM</Data>
    <Data>cdf498f5b15b46c7a9cf0cd2981613cf</Data>
    <Data>6</Data>
    <Data>1</Data>
    <Data>0</Data>
    <Data>/LM/W3SVC/446857867/ROOT-1-131151475617259214</Data>
    <Data>Full</Data>
    <Data>/</Data>
    <Data>D:\home\site\wwwroot\</Data>
    <Data>RD0003FF1DC726</Data>
    <Data/>
    <Data>13852</Data>
    <Data>w3wp.exe</Data>
    <Data>IIS APPPOOL\{removed}-intranet__1516</Data>
    <Data>HttpException</Data>
    <Data>
    This SqlTransaction has completed; it is no longer usable. at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at     System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) This     SqlTransaction has completed; it is no longer usable. at Jumoo.uSync.BackOffice.uSyncApplicationEventHandler.Setup() at Jumoo.uSync.BackOffice.uSyncApplicationEventHandler.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) at Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(    UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) at Umbraco.Core.CoreBootManager.<Complete>b__a(IApplicationEventHandler x) at Umbraco.Core.EnumerableExtensions.ForEach[TItem](IEnumerable`1 items, Action`1 action) at Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete) at     Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) at Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) at Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e)
    </Data>
    <Data>
    https://{removed}-intranet-umbraco-staging.azurewebsites.net:443/en
    </Data>
    <Data>/en</Data>
    <Data>{removed}</Data>
    <Data/>
    <Data>False</Data>
    <Data/>
    <Data>IIS APPPOOL\{removed}-intranet__1516</Data>
    <Data>11</Data>
    <Data>IIS APPPOOL\{removed}-intranet__1516</Data>
    <Data>False</Data>
    <Data>
    at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[]     handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
    </Data>
    </EventData>
    </Event>    
    
  • Trey 14 posts 107 karma points
    Aug 08, 2016 @ 17:36
    Trey
    0

    One of the def.config files that trigger this error:

    Version on environment before the sync:

    <?xml version="1.0" encoding="utf-8"?>
    <DocumentType>
      <Info>
        <Key>bc60c313-baf8-4880-a1f9-4b13d29a618a</Key>
        <Name>Main Content</Name>
        <Alias>mainContent</Alias>
        <Icon>icon-document</Icon>
        <Thumbnail>folder.png</Thumbnail>
        <Description></Description>
        <AllowAtRoot>False</AllowAtRoot>
        <IsListView>False</IsListView>
        <Folder>Components</Folder>
        <Compositions />
        <DefaultTemplate></DefaultTemplate>
        <AllowedTemplates />
      </Info>
      <Structure />
      <GenericProperties>
        <GenericProperty>
          <Key>0618230c-c2f2-464f-b907-b565f66e2f0e</Key>
          <Name>Main Content Repeatable</Name>
          <Alias>mainContentRepeatable</Alias>
          <Definition>8cd2810d-df64-4709-af8b-f836077e416d</Definition>
          <Type>Our.Umbraco.Vorto</Type>
          <Mandatory>false</Mandatory>
          <Validation></Validation>
          <Description><![CDATA[]]></Description>
          <SortOrder>0</SortOrder>
          <Tab>Content</Tab>
        </GenericProperty>
      </GenericProperties>
      <Tabs>
        <Tab>
          <Caption>Content</Caption>
          <SortOrder>0</SortOrder>
        </Tab>
      </Tabs>
    </DocumentType>    
    

    def.config of the new version being pushed to the environment:

    <?xml version="1.0" encoding="utf-8"?>
    <DocumentType>
      <Info>
        <Key>bc60c313-baf8-4880-a1f9-4b13d29a618a</Key>
        <Name>Main Content</Name>
        <Alias>mainContent</Alias>
        <Icon>icon-document</Icon>
        <Thumbnail>folder.png</Thumbnail>
        <Description></Description>
        <AllowAtRoot>False</AllowAtRoot>
        <IsListView>False</IsListView>
        <Folder>Components</Folder>
        <Compositions />
        <DefaultTemplate></DefaultTemplate>
        <AllowedTemplates />
      </Info>
      <Structure />
      <GenericProperties>
        <GenericProperty>
          <Key>951995eb-f3fd-4be1-b58f-08d8aa73ee3b</Key>
          <Name>Main Content Grid</Name>
          <Alias>mainContentGrid</Alias>
          <Definition>cbcf8fb1-ddba-46b6-9353-e91c8a2aeedf</Definition>
          <Type>Umbraco.Grid</Type>
          <Mandatory>false</Mandatory>
          <Validation></Validation>
          <Description><![CDATA[]]></Description>
          <SortOrder>1</SortOrder>
          <Tab>Main Content Grid</Tab>
        </GenericProperty>
        <GenericProperty>
          <Key>0618230c-c2f2-464f-b907-b565f66e2f0e</Key>
          <Name>Old Main Content</Name>
          <Alias>mainContentRepeatable</Alias>
          <Definition>8cd2810d-df64-4709-af8b-f836077e416d</Definition>
          <Type>Our.Umbraco.Vorto</Type>
          <Mandatory>false</Mandatory>
          <Validation></Validation>
          <Description><![CDATA[]]></Description>
          <SortOrder>0</SortOrder>
          <Tab>Main Content Area</Tab>
        </GenericProperty>
      </GenericProperties>
      <Tabs>
        <Tab>
          <Caption>Main Content Grid</Caption>
          <SortOrder>0</SortOrder>
        </Tab>
        <Tab>
          <Caption>Main Content Area</Caption>
          <SortOrder>1</SortOrder>
        </Tab>
      </Tabs>
    </DocumentType>
    
  • Kevin Jump 985 posts 5475 karma points mvp c-trib
    Aug 08, 2016 @ 21:38
    Kevin Jump
    100

    Hi

    It looks like something is closing down the SQL Connection, probably because things are running for two long.

    uSync doesn't do any DB stuff directly. it uses the Umbraco Core API to make all it's changes to Umbraco. that doesn't mean it isn't usync kicking off some mega sql, it's just that the SQL will be in Umbraco.

    large SQL transactions can happen when uSync is removing or adding doctype properties on sites with lots of content, because when you remove a property it will cause Umbraco to remove the property value from all content nodes. I'm not sure it does this when you add something too, but i can't quite recall (i think it might not).

    uSync will make all changes to a doctype and then call Save which will cause umbraco to ripple changes around the system, so it may be the combination of adding to a large content set, and renaming things that is doing it (although renaming is usually quite cheap) - which is why it might work from the front end.

    Looking at the above files - uSync should only call a rename for the property, and move it's tab. This shouldn't cause much sql, even if the Property key and guid in the DB don't match uSync would match from alias (which isn't changing) so that should still be a rename.

    if you turn on uSync debugging (add the following to log4net.config)

    <logger name="Jumoo.uSync"><level value="Debug"/></logger>
    

    then you might get more insight in umbracotracelog (in app_data/logs) even without debug you might be able to see the last thing usync was doing before the SQL Error occured, and I have been working on the Exceptions that bubble up for the next release so hopefully this will be easier to pinpoint on the next release.

    Kevin

  • Trey 14 posts 107 karma points
    Sep 02, 2016 @ 01:16
    Trey
    0

    Hey Kevin,

    To follow up on this:

    I ended up working around this by manually doing the composition changes that we had suspected were timing out on each environment before attempting an import.

    We updated to a newer version of usync which seemingly improved the errors messages from usync (i think? or this is an unrelated issue!). Sometime after we got another YSOD on the startup import. I noticed that there was an exception being thrown in the middle of the usync import logs relating to some stuff we had in the PublishedContent_Deleted event where we were doing some cleanup of some extra DB tables we had made.

    Upon further digging, we realized that we had been passing some malformed sql down into the umbraco DB methods that were throwing exceptions there and presumably bubbling up during the import (curious as to what all triggers the content deleted event?).

    This bug would have been in place when we were having the issues with the sql transaction being closed prematurely, so it may be possible that this bug was the source.

    Either way, thanks for the new version and your continued work on usync!

Please Sign in or register to post replies

Write your reply to:

Draft