Playing with recipes helped me break something

Topics: Customizing Orchard, General, Installing Orchard, Troubleshooting
Jan 23, 2015 at 9:00 PM
Edited Jan 23, 2015 at 9:01 PM
I was playing around with recipes, but I am not sure if that is what caused this problem. When I attempt to go to the admin/navigation menu i get a big long error (see below). I don't need to save the menu's but just need a quick solution to get this test site running again because I have some data I need to preserve. Any suggestion appreciated

as a side note, other areas of the site are working fine just the navigation.

2015-01-23 12:22:38,490 [18] Orchard.Exceptions.DefaultExceptionPolicy - Default - An unexpected exception was caught
NHibernate.Exceptions.GenericADOException: could not execute query
[ SELECT this_.Id as Id330_3_, this_.Number as Number330_3_, this_.Published as Published330_3_, this_.Latest as Latest330_3_, this_.Data as Data330_3_, this_.ContentItemRecord_id as ContentI6_330_3_, titlepartr1_.Id as Id387_0_, titlepartr1_.Title as Title387_0_, titlepartr1_.ContentItemRecord_id as ContentI3_387_0_, contentite2_.Id as Id329_1_, contentite2_.Data as Data329_1_, contentite2_.ContentType_id as ContentT3_329_1_, contenttyp3_.Id as Id331_2_, contenttyp3_.Name as Name331_2_ FROM Orchard_Framework_ContentItemVersionRecord this_ inner join Title_TitlePartRecord titlepartr1_ on this_.Id=titlepartr1_.Id inner join Orchard_Framework_ContentItemRecord contentite2_ on this_.ContentItemRecord_id=contentite2_.Id inner join Orchard_Framework_ContentTypeRecord contenttyp3_ on contentite2_.ContentType_id=contenttyp3_.Id WHERE contenttyp3_.Name = @p0 and this_.Published = @p1 ORDER BY titlepartr1_.Title asc ]
Name:cp0 - Value:Menu Name:cp1 - Value:True
[SQL: SELECT this_.Id as Id330_3_, this_.Number as Number330_3_, this_.Published as Published330_3_, this_.Latest as Latest330_3_, this_.Data as Data330_3_, this_.ContentItemRecord_id as ContentI6_330_3_, titlepartr1_.Id as Id387_0_, titlepartr1_.Title as Title387_0_, titlepartr1_.ContentItemRecord_id as ContentI3_387_0_, contentite2_.Id as Id329_1_, contentite2_.Data as Data329_1_, contentite2_.ContentType_id as ContentT3_329_1_, contenttyp3_.Id as Id331_2_, contenttyp3_.Name as Name331_2_ FROM Orchard_Framework_ContentItemVersionRecord this_ inner join Title_TitlePartRecord titlepartr1_ on this_.Id=titlepartr1_.Id inner join Orchard_Framework_ContentItemRecord contentite2_ on this_.ContentItemRecord_id=contentite2_.Id inner join Orchard_Framework_ContentTypeRecord contenttyp3_ on contentite2_.ContentType_id=contenttyp3_.Id WHERE contenttyp3_.Name = @p0 and this_.Published = @p1 ORDER BY titlepartr1_.Title asc] ---> System.Data.SqlClient.SqlException: Invalid object name 'Title_TitlePartRecord'.
Statement(s) could not be prepared.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.SqlAzure.ReliableSqlConnection.<>c__DisplayClassc
1.<ExecuteCommand>b__a() in :line 0
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) in :line 0
at Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.SqlAzure.ReliableSqlConnection.<>c__DisplayClassc
1.<ExecuteCommand>b__9() in :line 0
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0() in :line 0
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) in :line 0
at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction(Action action) in :line 0
at Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.SqlAzure.ReliableSqlConnection.ExecuteCommand[T](IDbCommand command, RetryPolicy retryPolicy, CommandBehavior behavior) in :line 0
at NHibernate.SqlAzure.ReliableSqlCommand.ExecuteReader() in c:\TeamCity\buildAgent\work\99f31db0d548c7b7\NHibernate.SqlAzure\ReliableSqlCommand.cs:line 85
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\AdoNet\AbstractBatcher.cs:line 229
at 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:line 1224
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:line 419
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:line 251
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:line 1564
--- End of inner exception stack trace ---
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:line 1571
at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:line 1472
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet
1 querySpaces, IType[] resultTypes) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Loader\Loader.cs:line 1465
at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Impl\SessionImpl.cs:line 1975
at NHibernate.Impl.CriteriaImpl.List(IList results) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Impl\CriteriaImpl.cs:line 265
at NHibernate.Impl.CriteriaImpl.ListT in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Impl\CriteriaImpl.cs:line 276
at Orchard.ContentManagement.DefaultContentQuery.Slice(Int32 skip, Int32 count) in c:\Devel\OrchardSource\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 161
at Orchard.ContentManagement.DefaultContentQuery.ContentQuery1.Orchard.ContentManagement.IContentQuery<T>.List() in c:\Devel\OrchardSource\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 262
at Orchard.Core.Navigation.Controllers.AdminController.Index(NavigationManagementViewModel model, Nullable
1 menuId) in c:\Devel\OrchardSource\src\Orchard.Web\Core\Navigation\Controllers\AdminController.cs:line 51
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase
1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41()
Developer
Jan 24, 2015 at 1:46 AM
This is the key: "System.Data.SqlClient.SqlException: Invalid object name 'Title_TitlePartRecord'." Your TitlePartRecord table was dropped...
Jan 25, 2015 at 3:09 AM
Any suggestions on fixing that?
Jan 26, 2015 at 6:59 PM
Edited Jan 26, 2015 at 7:14 PM
Ok, so I have am trying to upgrade Orchard.Core.Title.Migrations using the following

public int UpdateFrom2()
    {
        SchemaBuilder.CreateTable("TitlePartRecord",
            table => table
                .ContentPartVersionRecord()
                .Column<string>("Title", column => column.WithLength(1024))
            );
        return 3;
    }
This worked for recreating my missing table, not sure what happened to it in the first place but I am glad to have it fixed. Maybe this will help someone else.