Application error with templates in DB when deploying
We have recently upgraded our Umbraco from version 4.0.3 to
version 4.7.0. For the upgrade, we also changed our database from a SQL DB to a
SQL Compact Edition database. The primary focus of the upgrade was so that we
could then install and utilise Courier to allow for more streamlined
development and publishing of content.
We did come across some issues in
our Umbraco installation when upgrading such as
missing media recycle bin, all of which now seem to be resolved.
However, when we try to utilise the courier deploy command and publish any
section of the site to a different environment, we get the error as seen at the
foot of this message. We have checked the DB and can confirm that the Base
template is present in cmsTemplate and umbracoNode
tables, and so we are unsure why we are getting the message “
Error retrieving item [Base] from provider.”
Could you please review the full error below and offer any
help/advice with this matter? Your help is much appreicated.
ERROR AS FOLLOWS:
Umbraco.Courier.Core.Exceptions.PackageException:
Unable to load item width id 'Base' from provider 'Templates' --->
Umbraco.Courier.Core.Exceptions.RetrieveException: Error retrieving item [Base]
from provider [25867200-e67e-11df-9492-0800200c9a66]. --->
NHibernate.ObjectNotFoundException: No row with the given identifier
exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
at
NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String
entityName, Object id)
at NHibernate.Proxy.AbstractLazyInitializer.CheckTargetState()
at NHibernate.Proxy.AbstractLazyInitializer.Initialize()
at NHibernate.ByteCode.Castle.LazyInitializer.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at UmbracoNodeProxy3e26461fd39842e5991d9faec2f1cc16.get_CmsTemplates()
at Umbraco.Courier.Persistence.V4.NHibernate.Persisters.TemplateItem.RetrieveItem[T](ItemIdentifier
itemId) in
d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Persistence.NHibernate\Persisters\Template.cs:line
76
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
--- End of inner exception stack trace ---
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
at Umbraco.Courier.ItemProviders.TemplateItemProvider.HandlePack(ItemIdentifier
id) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Providers\ItemProviders\TemplateItemProvider.cs:line
52
at Umbraco.Courier.Core.ItemProvider.Package(ItemIdentifier id)
at Umbraco.Courier.RepositoryProviders.Local.Package(ItemIdentifier itemId) in
d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.RepositoryProviders\Local\Local.cs:line
173
at Umbraco.Courier.Core.PackagingManager.™(ItemIdentifier itemId, ItemProvider
provider, ItemType itemType)
--- End of inner exception stack trace ---
at Umbraco.Courier.Core.PackagingManager.™(ItemIdentifier itemId, ItemProvider
provider, ItemType itemType)
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.PackageQueue()
at Umbraco.Courier.UI.Dialogs.CommitItem.PackageSelectedItems()
at Umbraco.Courier.UI.Dialogs.CommitItem.oneSteptransfer(Object sender,
EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)
Error
retrieving item [Base] from provider [25867200-e67e-11df-9492-0800200c9a66].
Umbraco.Courier.Core.Exceptions.RetrieveException: Error retrieving item [Base]
from provider [25867200-e67e-11df-9492-0800200c9a66]. ---> NHibernate.ObjectNotFoundException:
No row with the given identifier
exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
at
NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String
entityName, Object id)
at NHibernate.Proxy.AbstractLazyInitializer.CheckTargetState()
at NHibernate.Proxy.AbstractLazyInitializer.Initialize()
at NHibernate.ByteCode.Castle.LazyInitializer.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at UmbracoNodeProxy3e26461fd39842e5991d9faec2f1cc16.get_CmsTemplates()
at
Umbraco.Courier.Persistence.V4.NHibernate.Persisters.TemplateItem.RetrieveItem[T](ItemIdentifier
itemId) in
d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Persistence.NHibernate\Persisters\Template.cs:line
76
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
--- End of inner exception stack trace ---
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
at Umbraco.Courier.ItemProviders.TemplateItemProvider.HandlePack(ItemIdentifier
id) in
d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Providers\ItemProviders\TemplateItemProvider.cs:line
52
at Umbraco.Courier.Core.ItemProvider.Package(ItemIdentifier id)
at Umbraco.Courier.RepositoryProviders.Local.Package(ItemIdentifier itemId) in
d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.RepositoryProviders\Local\Local.cs:line
173
at Umbraco.Courier.Core.PackagingManager.™(ItemIdentifier itemId, ItemProvider
provider, ItemType itemType)
No
row with the given identifier
exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
NHibernate.ObjectNotFoundException: No row with the given identifier
exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
at
NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String
entityName, Object id)
at NHibernate.Proxy.AbstractLazyInitializer.CheckTargetState()
at NHibernate.Proxy.AbstractLazyInitializer.Initialize()
at NHibernate.ByteCode.Castle.LazyInitializer.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at UmbracoNodeProxy3e26461fd39842e5991d9faec2f1cc16.get_CmsTemplates()
at Umbraco.Courier.Persistence.V4.NHibernate.Persisters.TemplateItem.RetrieveItem[T](ItemIdentifier
itemId) in
d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Persistence.NHibernate\Persisters\Template.cs:line
76
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
OK Per, we have had a look at the DB and there is no coulmn with the alias base. We do have a column called alias which has a base row in it, which you can see from below. (I have also shown the row from the umbracoNode table which corresponds to this Base template)
One thing we did discover is that the last column (alias: design), which seems to store all the markup for this template, is old. We did a quick check for other templates in this table and they seem to be up to date, but the base row seems to be a good 6 months or more behind, which may be something to do with this issue?
Another thing worth noting, is that we did have an issue at one point with a duplicate Base templates. When we done the upgrade from 4.0.3 to 4.7.0, we tidied up the site to remove this duplicate, but fear this may be having a knock-on effect somehow. Looking back at the old DB, the other Base entry's ID is not referenced anywhere (as a parent for example), so we don't believe that anything is depending on that base. The strangest thing is that the DB entry for the current base doesnt seem to be up to date with the actual markup being used within the site.
Unable to load item width id 'SiteMaster' from provider 'Templates'
However, I actually have a SiteMaster template and it should be valid as far as I know. We also upgraded our sites from 4.0.x to 4.5.2 and finally 4.7.0.
OK, for some unbeknownst reason, it would appear that courier has now began working and we are now having no problems deploying the content between our development and preprod environments. I may be back to visit this forum when it comes to pushing content to the live site, but for now all seems to be well. Unfortunately for anyone else experiencing a similar issue I cannot say what was done to resolve this...it just seemed to 'work' one day.
in order to resolve this, all you need to do is run an upgrade sql script - to be found in the source code of the version of umbraco you're upgrading to
Application error with templates in DB when deploying
We have recently upgraded our Umbraco from version 4.0.3 to version 4.7.0. For the upgrade, we also changed our database from a SQL DB to a SQL Compact Edition database. The primary focus of the upgrade was so that we could then install and utilise Courier to allow for more streamlined development and publishing of content.
We did come across some issues in our Umbraco installation when upgrading such as missing media recycle bin, all of which now seem to be resolved. However, when we try to utilise the courier deploy command and publish any section of the site to a different environment, we get the error as seen at the foot of this message. We have checked the DB and can confirm that the Base template is present in cmsTemplate and umbracoNode tables, and so we are unsure why we are getting the message “
Error retrieving item [Base] from provider.”
Could you please review the full error below and offer any help/advice with this matter? Your help is much appreicated.
ERROR AS FOLLOWS:
Umbraco.Courier.Core.Exceptions.PackageException: Unable to load item width id 'Base' from provider 'Templates' ---> Umbraco.Courier.Core.Exceptions.RetrieveException: Error retrieving item [Base] from provider [25867200-e67e-11df-9492-0800200c9a66]. ---> NHibernate.ObjectNotFoundException: No row with the given identifier exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
at NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id)
at NHibernate.Proxy.AbstractLazyInitializer.CheckTargetState()
at NHibernate.Proxy.AbstractLazyInitializer.Initialize()
at NHibernate.ByteCode.Castle.LazyInitializer.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at UmbracoNodeProxy3e26461fd39842e5991d9faec2f1cc16.get_CmsTemplates()
at Umbraco.Courier.Persistence.V4.NHibernate.Persisters.TemplateItem.RetrieveItem[T](ItemIdentifier itemId) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Persistence.NHibernate\Persisters\Template.cs:line 76
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
--- End of inner exception stack trace ---
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
at Umbraco.Courier.ItemProviders.TemplateItemProvider.HandlePack(ItemIdentifier id) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Providers\ItemProviders\TemplateItemProvider.cs:line 52
at Umbraco.Courier.Core.ItemProvider.Package(ItemIdentifier id)
at Umbraco.Courier.RepositoryProviders.Local.Package(ItemIdentifier itemId) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.RepositoryProviders\Local\Local.cs:line 173
at Umbraco.Courier.Core.PackagingManager.™(ItemIdentifier itemId, ItemProvider provider, ItemType itemType)
--- End of inner exception stack trace ---
at Umbraco.Courier.Core.PackagingManager.™(ItemIdentifier itemId, ItemProvider provider, ItemType itemType)
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.š()
at Umbraco.Courier.Core.PackagingManager.PackageQueue()
at Umbraco.Courier.UI.Dialogs.CommitItem.PackageSelectedItems()
at Umbraco.Courier.UI.Dialogs.CommitItem.oneSteptransfer(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Error retrieving item [Base] from provider [25867200-e67e-11df-9492-0800200c9a66].
Umbraco.Courier.Core.Exceptions.RetrieveException: Error retrieving item [Base] from provider [25867200-e67e-11df-9492-0800200c9a66]. ---> NHibernate.ObjectNotFoundException: No row with the given identifier exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
at NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id)
at NHibernate.Proxy.AbstractLazyInitializer.CheckTargetState()
at NHibernate.Proxy.AbstractLazyInitializer.Initialize()
at NHibernate.ByteCode.Castle.LazyInitializer.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at UmbracoNodeProxy3e26461fd39842e5991d9faec2f1cc16.get_CmsTemplates()
at Umbraco.Courier.Persistence.V4.NHibernate.Persisters.TemplateItem.RetrieveItem[T](ItemIdentifier itemId) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Persistence.NHibernate\Persisters\Template.cs:line 76
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
--- End of inner exception stack trace ---
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
at Umbraco.Courier.ItemProviders.TemplateItemProvider.HandlePack(ItemIdentifier id) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Providers\ItemProviders\TemplateItemProvider.cs:line 52
at Umbraco.Courier.Core.ItemProvider.Package(ItemIdentifier id)
at Umbraco.Courier.RepositoryProviders.Local.Package(ItemIdentifier itemId) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.RepositoryProviders\Local\Local.cs:line 173
at Umbraco.Courier.Core.PackagingManager.™(ItemIdentifier itemId, ItemProvider provider, ItemType itemType)
No row with the given identifier exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
NHibernate.ObjectNotFoundException: No row with the given identifier exists[Umbraco.Courier.Persistence.V4.NHibernate.EntityClasses.UmbracoNode#0]
at NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id)
at NHibernate.Proxy.AbstractLazyInitializer.CheckTargetState()
at NHibernate.Proxy.AbstractLazyInitializer.Initialize()
at NHibernate.ByteCode.Castle.LazyInitializer.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at UmbracoNodeProxy3e26461fd39842e5991d9faec2f1cc16.get_CmsTemplates()
at Umbraco.Courier.Persistence.V4.NHibernate.Persisters.TemplateItem.RetrieveItem[T](ItemIdentifier itemId) in d:\TeamCity6\buildAgent\work\399aef48762b5884\Umbraco.Courier.Persistence.NHibernate\Persisters\Template.cs:line 76
at Umbraco.Courier.Core.ItemCrudProvider.RetrieveItem[T](ItemIdentifier itemId)
I did the grave mistake of installing Windows 7 service pack, it has effectively crippled my develope machine IIS
So can't reproduce and dig deeper into it right now...
But can tell you what the code is doing specificly on those lines in the trace..
It looks in the db, and only in the cmsTemplates table, for the row, with the alias column = "base" (not [base] as in the headline)
so if you have a row with the alias = base, then thats very strange.
Hopefully I got a dev IIS to test this on tomorrow so I can reproduce and find out why this is happening
/Per
That's great Per. Thanks for having a look at this! Will check the DB today with regard to your point above.
Cheers
OK Per, we have had a look at the DB and there is no coulmn with the alias base. We do have a column called alias which has a base row in it, which you can see from below. (I have also shown the row from the umbracoNode table which corresponds to this Base template)
cmsTemplate row:
4 1056 0 Base <%@ Master Language="C#" MasterPageFile="/umbraco/mast...
umbracoNode row:
1056 False -1 0 1 -1,1056 2 80a196cc-eb18-40d2-9403-2830611deac3 Base 6fbde604-4178-42ce-a10b-8a2600a2f07d 10/05/2010 16:00:25
One thing we did discover is that the last column (alias: design), which seems to store all the markup for this template, is old. We did a quick check for other templates in this table and they seem to be up to date, but the base row seems to be a good 6 months or more behind, which may be something to do with this issue?
Another thing worth noting, is that we did have an issue at one point with a duplicate Base templates. When we done the upgrade from 4.0.3 to 4.7.0, we tidied up the site to remove this duplicate, but fear this may be having a knock-on effect somehow. Looking back at the old DB, the other Base entry's ID is not referenced anywhere (as a parent for example), so we don't believe that anything is depending on that base. The strangest thing is that the DB entry for the current base doesnt seem to be up to date with the actual markup being used within the site.
Cheers, Chris
I'm getting the same error
However, I actually have a SiteMaster template and it should be valid as far as I know. We also upgraded our sites from 4.0.x to 4.5.2 and finally 4.7.0.
Here's my cmsTemplate:
and the umbracoNode:
Any ideas?
Thanks,
Jason
I thought maybe it was because the parentId was 0. Set it to NULL. But I'm still getting the error.
OK, I found another difference. The SiteMaster template had a slight issue. There was a macro inserted that had mis-matched start/end tags. Like this:
<umbraco:macro ...> </umbraco:Macro>
I made them both camel-case and now I am able to deploy some of my nodes. More testing is needed, but this is a break-through for me.
J
OK, for some unbeknownst reason, it would appear that courier has now began working and we are now having no problems deploying the content between our development and preprod environments. I may be back to visit this forum when it comes to pushing content to the live site, but for now all seems to be well. Unfortunately for anyone else experiencing a similar issue I cannot say what was done to resolve this...it just seemed to 'work' one day.
in order to resolve this, all you need to do is run an upgrade sql script - to be found in the source code of the version of umbraco you're upgrading to
\umbraco\datalayer\SqlHelpers\SqlServer\Sql\Version4_Upgrade.sql (4.7.1)
hope this helps :)
is working on a reply...