Unable to edit blog post after upgrading to 1.8.1

Topics: Troubleshooting
Jul 23, 2014 at 1:55 PM
Edited Jul 23, 2014 at 2:16 PM
I get the following whenever trying to edit a blog post:

Invalid object name 'Containers_CustomPropertiesPartRecord'.
Statement(s) could not be prepared.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'Containers_CustomPropertiesPartRecord'.
Statement(s) could not be prepared.

Source Error:



Line 156: }
Line 157: else if (@event.LockMode == LockMode.None) {
Line 158: @event.Result = ProxyOrLoad(@event, entityPersister, keyToLoad, loadType);
Line 159: }
Line 160: else {


Source File: e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard\Data\Providers\AbstractDataServicesProvider.cs Line: 158

Stack Trace:



[SqlException (0x80131904): Invalid object name 'Containers_CustomPropertiesPartRecord'.
Statement(s) could not be prepared.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +1789294
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction) +5340642
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1691
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +61
System.Data.SqlClient.SqlDataReader.get_MetaData() +90
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +377
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +1421
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +177
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +137
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +41
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12
NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\AdoNet\AbstractBatcher.cs:229
NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:1224
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:419
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:251
NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:1279

[GenericADOException: could not load an entity: [Orchard.Core.Containers.Models.CustomPropertiesPartRecord#16277][SQL: SELECT customprop0_.Id as Id98_0_, customprop0_.CustomOne as CustomOne98_0_, customprop0_.CustomTwo as CustomTwo98_0_, customprop0_.CustomThree as CustomTh4_98_0_ FROM Containers_CustomPropertiesPartRecord customprop0_ WHERE customprop0_.Id=?]]
NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:1287
NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Entity\AbstractEntityLoader.cs:44
NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Entity\AbstractEntityLoader.cs:39
NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs:3483
NHibernate.Event.Default.DefaultLoadEventListener.LoadFromDatasource(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Event\Default\DefaultLoadEventListener.cs:348
NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Event\Default\DefaultLoadEventListener.cs:329
NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Event\Default\DefaultLoadEventListener.cs:110
NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Event\Default\DefaultLoadEventListener.cs:166
Orchard.Data.Providers.OrchardLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) in e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard\Data\Providers\AbstractDataServicesProvider.cs:158
NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Impl\SessionImpl.cs:2529
NHibernate.Impl.SessionImpl.Get(String entityName, Object id) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Impl\SessionImpl.cs:1366
NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Impl\SessionImpl.cs:1303
NHibernate.Impl.SessionImpl.Get(Object id) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Impl\SessionImpl.cs:1287
Orchard.Data.Repository
1.Get(Int32 id) in e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard\Data\Repository.cs:87
Orchard.Data.Repository1.Orchard.Data.IRepository<T>.Get(Int32 id) in e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard\Data\Repository.cs:56
Orchard.ContentManagement.Handlers.StorageFilter
1.GetRecordCore(ContentItemVersionRecord versionRecord) in e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard\ContentManagement\Handlers\StorageFilter.cs:30
Orchard.ContentManagement.Handlers.<>c__DisplayClass1.<Loading>b__0(TRecord prior) in e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard\ContentManagement\Handlers\StorageFilter.cs:54
Orchard.ContentManagement.Utilities.LazyField1.GetValue() in e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard\ContentManagement\Utilities\LazyField.cs:24
lambda_method(Closure , CustomPropertiesPart , List
1 ) +61
System.Web.Mvc.ExpressionUtil.<>c__DisplayClass8.<CompileFromFingerprint>b__4(TIn model) +19
System.Web.Mvc.<>c__DisplayClass12.<FromLambdaExpression>b__0() +79
System.Web.Mvc.ModelMetadata.get_Model() +17
System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData, ExecuteTemplateDelegate executeTemplate) +56
System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData) +66
System.Web.Mvc.Html.TemplateHelpers.TemplateFor(HtmlHelper
1 html, Expression1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData, TemplateHelperDelegate templateHelper) +117
System.Web.Mvc.Html.TemplateHelpers.TemplateFor(HtmlHelper
1 html, Expression1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData) +104
System.Web.Mvc.Html.EditorExtensions.EditorFor(HtmlHelper
1 html, Expression`1 expression) +61
ASP._Page_Core_Containers_Views_EditorTemplates_CustomProperties_cshtml.Execute() in e:\Users\Hong\Documents\Hong\Virtual Home\mydomain.org CMS home\orchard\src\Orchard.Web\Core\Containers\Views\EditorTemplates\CustomProperties.cshtml:4
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +199
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +104
System.Web.WebPages.WebPageBase.ExecutePageHie
Jul 23, 2014 at 2:24 PM
The problem appears to have been solved by removing Custom Properties in the definition of blog post.