1.5.1 upgrade problem

Topics: Installing Orchard
Aug 1, 2012 at 7:08 PM

I've recently tried to upgrade my site to 1.5.1.  I'm not 100% of what version I was on before and I was stupid and didn't make a backup first.  Now I get "The page cannot be displayed because an internal server error has occurred." on every page hit.  I've replaced everything on the site except the App_Data folder and media.  I know this is awfully vague, but even with custom errors turned off, I don't get any error to go on.  Any idea where I can start?

Aug 1, 2012 at 7:57 PM
Edited Aug 1, 2012 at 7:58 PM

I have a 20MB log file (compressed to 300KB) that I uploaded to my web site in case anyone can look at it and see something.

http://www.ariankulp.com/orchard-error.log.zip

 

Thanks!

Developer
Aug 2, 2012 at 1:38 AM

This one jumps out right to my eye: Invalid column name 'SiteTimeZone'.
Not sure if that column should be there or not, but some code is trying to access it. Or perhaps all you need to do is remove the mappings.bin file (which is in App_Data/Sites/Default.

Aug 2, 2012 at 6:04 PM

That sounds like a big deal!  Will it be rebuilt or would there be other side effects?

Coordinator
Aug 2, 2012 at 6:09 PM

Site time zone sounds like something that would take about 2 seconds to restore from the admin. Why do you think it's a big deal?

Aug 3, 2012 at 6:35 PM

There are two things in sfmskwalker's message.  I'm referring to removing the mappings.bin file.  I'm not sure of it's function, but it's a fairly large file.

The other thing is the "Invalid column name" error.  I don't care if I need to set the time zone again, but why is that error showing?  The site is completely down with no way to do anything at the moment.

Coordinator
Aug 3, 2012 at 6:41 PM

The hell if I know. Sorry.

Developer
Aug 3, 2012 at 8:36 PM
Edited Aug 3, 2012 at 8:36 PM

You can safely remove the mappings.bin file; it will be regenerated. I think it stores NHibernate mappings. If someone (or something) changes the db schema, but the mappings.bin does not get updated, you will see this sort of errors. For example, consider having a database table containing 'ColumnX', and Orchard generated a mapping.bin file. Now, if you were to remove/rename that column manually, without deleting mappings.bin, the NHibernate mapping is still referencing that column. Hence my suggestion to remove mappings.bin.

Coordinator
Aug 3, 2012 at 10:10 PM

If you change anything in a record, the checksum will change and the mapping.bin will get invalidated and recreated. It's a cache of all the nhibernate maping, to improve cold start performance.

Aug 3, 2012 at 11:13 PM

So the only way I can get the site to run at all is to rename the settings.txt file.  In that case it shows me the first time run screen.  There must be something about the DB (SQL Server) itself.  Since starting from a fresh DB isn't an option, is there some simple migration I need to perform on the DB that might make this work?

Developer
Aug 4, 2012 at 12:25 PM
sebastienros wrote:

If you change anything in a record, the checksum will change and the mapping.bin will get invalidated and recreated. It's a cache of all the nhibernate maping, to improve cold start performance.


You're right. So only when you go and change the domain model, e.g. rename a property that is mapped, you do need to delete the mappings.bin file. At least, I had to do so several times.

Coordinator
Aug 4, 2012 at 9:15 PM

@atkulp: as has been said by the others, it is safe to delete mappings.bin.

Aug 5, 2012 at 8:58 PM

Got that (about mappings.bin).  I've deleted everything in sites\default except for settings.txt.  The site still crashes.  That's why (in Fri @ 3:13p PT) I surmised that there must be something about the DB file itself.  Only if I delete settings.txt and it has no database to examine will it startup at all.  Since I took down the old working site and started updating the files, what about the DB could cause the problem?  I don't think it's corrupt since I ran the SQL Server DB backup process after taking it down and didn't encounter any errors.  Any thoughts on any queries I could run to get to the root of this?

Coordinator
Aug 6, 2012 at 6:37 PM

That you'd have to delete settings.txt files means that one of your modules is corrupted, doesn't compile or crashes on startup. You need to determine what module.

Aug 6, 2012 at 11:04 PM

Could it be that is a module is simply missing?

Aug 13, 2012 at 4:14 PM
Edited Aug 13, 2012 at 9:12 PM

@bertrand - I'm having the same issue upgrading my 1.3 site to 1.5.1.  From what I'm seeing, it's not a module issue.

Exception thrown points to:

 

[Orchard.Core.Settings.Models.SiteSettingsPartRecord#1]
[SQL: SELECT 
	sitesettin0_.Id as Id7_0_, 
	sitesettin0_.SiteSalt as SiteSalt7_0_, 
	sitesettin0_.SiteName as SiteName7_0_, 
	sitesettin0_.SuperUser as SuperUser7_0_, 
	sitesettin0_.PageTitleSeparator as PageTitl5_7_0_, 
	sitesettin0_.HomePage as HomePage7_0_, 
	sitesettin0_.SiteCulture as SiteCult7_7_0_, 
	sitesettin0_.ResourceDebugMode as Resource8_7_0_, 
	sitesettin0_.PageSize as PageSize7_0_, 
---->	sitesettin0_.SiteTimeZone as SiteTim10_7_0_ <--------
FROM 
	Settings_SiteSettingsPartRecord sitesettin0_ 
WHERE 
	sitesettin0_.Id=?]

 

Let me know if I can send you any files from my base install or migrated install to help troubleshoot this.

Cheers,

Steve

 

Full trace:

 

[SqlException (0x80131904): Invalid column name 'SiteTimeZone'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2062238
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5050268
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
   System.Data.SqlClient.SqlDataReader.get_MetaData() +86
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +311
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12
   NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) +290
   NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session) +264
   NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +186
   NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +70
   NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) +253

[GenericADOException: could not load an entity: [Orchard.Core.Settings.Models.SiteSettingsPartRecord#1][SQL: SELECT sitesettin0_.Id as Id7_0_, sitesettin0_.SiteSalt as SiteSalt7_0_, sitesettin0_.SiteName as SiteName7_0_, sitesettin0_.SuperUser as SuperUser7_0_, sitesettin0_.PageTitleSeparator as PageTitl5_7_0_, sitesettin0_.HomePage as HomePage7_0_, sitesettin0_.SiteCulture as SiteCult7_7_0_, sitesettin0_.ResourceDebugMode as Resource8_7_0_, sitesettin0_.PageSize as PageSize7_0_, sitesettin0_.SiteTimeZone as SiteTim10_7_0_ FROM Settings_SiteSettingsPartRecord sitesettin0_ WHERE sitesettin0_.Id=?]]
   NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) +398
   NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId) +33
   NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session) +18
   NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session) +103
   NHibernate.Event.Default.DefaultLoadEventListener.LoadFromDatasource(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +131
   NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +472
   NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +98
   NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +253
   NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) +367
   NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) +263
   NHibernate.Impl.SessionImpl.Get(String entityName, Object id) +272
   NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id) +241
   NHibernate.Impl.SessionImpl.Get(Object id) +279
   Orchard.Data.Repository`1.Get(Int32 id) in c:\Build\Orchard\src\Orchard\Data\Repository.cs:87
   Orchard.Data.Repository`1.Orchard.Data.IRepository.Get(Int32 id) in c:\Build\Orchard\src\Orchard\Data\Repository.cs:56
   Orchard.ContentManagement.Handlers.StorageFilter`1.GetRecordCore(ContentItemVersionRecord versionRecord) in c:\Build\Orchard\src\Orchard\ContentManagement\Handlers\StorageFilter.cs:30
   Orchard.ContentManagement.Handlers.<>c__DisplayClass1.b__0(TRecord prior) in c:\Build\Orchard\src\Orchard\ContentManagement\Handlers\StorageFilter.cs:54
   Orchard.ContentManagement.Utilities.LazyField`1.GetValue() in c:\Build\Orchard\src\Orchard\ContentManagement\Utilities\LazyField.cs:24
   Orchard.Core.Settings.Models.SiteSettingsPart.get_SiteCulture() in c:\Build\Orchard\src\Orchard.Web\Core\Settings\Models\SiteSettingsPart.cs:35
   Orchard.Localization.Services.SiteCultureSelector.GetCulture(HttpContextBase context) in c:\Build\Orchard\src\Orchard\Localization\Services\SiteCultureSelector.cs:13
   Orchard.Localization.Services.<>c__DisplayClass8.b__3(ICultureSelector x) in c:\Build\Orchard\src\Orchard\Localization\Services\DefaultCultureManager.cs:54
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.WhereEnumerableIterator`1.MoveNext() +87
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.d__0.MoveNext() +96
   System.Linq.Enumerable.Count(IEnumerable`1 source) +201
   Orchard.Localization.Services.DefaultCultureManager.GetCurrentCulture(HttpContextBase requestContext) in c:\Build\Orchard\src\Orchard\Localization\Services\DefaultCultureManager.cs:58
   Orchard.Localization.Services.CurrentCultureWorkContext.b__0(WorkContext ctx) in c:\Build\Orchard\src\Orchard\Localization\Services\CurrentCultureWorkContext.cs:13
   Orchard.Environment.<>c__DisplayClass7`1.b__5() in c:\Build\Orchard\src\Orchard\Environment\WorkContextImplementation.cs:37
   Orchard.Environment.WorkContextImplementation.GetState(String name) in c:\Build\Orchard\src\Orchard\Environment\WorkContextImplementation.cs:28
   Orchard.WorkContext.get_CurrentCulture() in c:\Build\Orchard\src\Orchard\WorkContext.cs:76
   Orchard.Localization.Text.Get(String textHint, Object[] args) in c:\Build\Orchard\src\Orchard\Localization\Text.cs:27
   Orchard.UI.Admin.AdminFilter.OnAuthorization(AuthorizationContext filterContext) in c:\Build\Orchard\src\Orchard\UI\Admin\AdminFilter.cs:23
   System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +102
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.b__d() +50
   System.Web.Mvc.SecurityUtil.b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in c:\Build\Orchard\src\Orchard\Mvc\Routes\ShellRoute.cs:147
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8967885
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Coordinator
Aug 14, 2012 at 8:50 PM

Try to upgrade to 1.4, then to 1.5.

Aug 15, 2012 at 4:08 AM

So it turns out I was actually on 1.2, not 1.3.  Upgrade from 1.2 to 1.3.10 works fine (other than a Lucene error, removed the module and will reinstall it when I get to a stable site).  Tried upgrading to 1.4.2, same error.  Reset everything from 1.2 to 1.3.10 and then tried to go to 1.4.0 and getting the SiteTimeZone invalid column error.

I'm following the directions here:  http://docs.orchardproject.net/Documentation/Upgrading-a-site-to-a-new-version-of-Orchard#UpgradingAnOrchardSiteInPlace

I'm doing this in a copy of my original site in a new application pool and website in IIS.  Copied the database as well and renamed it to orchard15 (SQL 2008 standard instance) and updated the Settings.txt file to point to the "1.5" version of the DB.  I've tried this method both on my Server 2008 R2 VM as well as my Win7 dev box with same results.

I can send you a copy of my original site and DB if you want Bertrand, just let me know -- unless you have any other suggestions.

Thanks!

Coordinator
Aug 17, 2012 at 2:25 AM

Did you try to create that missing column?

Aug 22, 2012 at 10:46 PM

I've hit the same issue with an upgrade from 1.3.10 to 1.5.1

I have manually added in the SiteTimeZone column to the Settings_SiteSettingsPartRecord table only to find that other columns are missing. 

Invalid column name 'RenderTitle'.
Invalid column name 'Name'.

The migrations are failing, will keep digging in to this but for reference the current error log is:

2012-08-22 22:40:28,025 [37] Orchard.Exceptions.DefaultExceptionPolicy - An unexpected exception was caught
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> NHibernate.QueryException: could not resolve property: TitlePartRecord of: Orchard.ContentManagement.Records.ContentItemVersionRecord
   at NHibernate.Persister.Entity.AbstractPropertyMapping.ToType(String propertyName)
   at NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetPathInfo(String path)
   at NHibernate.Loader.Criteria.CriteriaQueryTranslator.CreateCriteriaEntityNameMap()
   at NHibernate.Loader.Criteria.CriteriaQueryTranslator..ctor(ISessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias)
   at NHibernate.Loader.Criteria.CriteriaLoader..ctor(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl rootCriteria, String rootEntityName, IDictionary`2 enabledFilters)
   at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results)
   at NHibernate.Impl.CriteriaImpl.List(IList results)
   at NHibernate.Impl.CriteriaImpl.List[T]()
   at Orchard.ContentManagement.DefaultContentQuery.Slice(Int32 skip, Int32 count) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 146
   at Orchard.ContentManagement.DefaultContentQuery.ContentQuery`1.Orchard.ContentManagement.IContentQuery.List() in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 191
   at Orchard.Blogs.Services.BlogService.Get(VersionOptions versionOptions)
   at Orchard.Blogs.Services.BlogService.Get()
   at Orchard.Blogs.Routing.BlogPathConstraintUpdator.Refresh()
   at Orchard.Blogs.Routing.BlogPathConstraintUpdator.Orchard.Environment.IOrchardShellEvents.Activated()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Events\DefaultOrchardEventBus.cs:line 83
   at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Events\DefaultOrchardEventBus.cs:line 68
   at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, IEnumerable& returnValue) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Events\DefaultOrchardEventBus.cs:line 52
2012-08-22 22:40:28,885 [37] Orchard.ContentManagement.DefaultContentManager - NullReferenceException thrown from IContentHandler by Orchard.Warmup.Handlers.WarmupContentHandler
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.Warmup.Handlers.WarmupContentHandler.Generate(PublishContentContext context, ContentPart part)
   at Orchard.ContentManagement.Handlers.ContentHandler.InlineStorageFilter`1.Published(PublishContentContext context, TPart instance) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 156
   at Orchard.ContentManagement.Handlers.StorageFilterBase`1.Orchard.ContentManagement.Handlers.IContentStorageFilter.Published(PublishContentContext context) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\ContentManagement\Handlers\StorageFilterBase.cs:line 81
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.Published(PublishContentContext context) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\ContentManagement\Handlers\ContentHandler.cs:line 274
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass5c.b__59(IContentHandler handler) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\ContentManagement\DefaultContentManager.cs:line 495
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\InvokeExtensions.cs:line 17
2012-08-22 22:40:28,888 [37] Orchard.Data.Migration.DataMigrationManager - An unexpected error orccured while applying migration on Navigation from version 2
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.Core.Navigation.Services.MainMenuService.Create(String name) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard.Web\Core\Navigation\Services\MainMenuService.cs:line 56
   at Orchard.Core.Navigation.Migrations.UpdateFrom2() in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard.Web\Core\Navigation\Migrations.cs:line 185
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Orchard.Data.Migration.DataMigrationManager.Update(String feature) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Data\Migration\DataMigrationManager.cs:line 105
2012-08-22 22:40:28,892 [37] Orchard.Data.Migration.AutomaticDataMigrations - Could not run migrations automatically on Navigation
2012-08-22 22:40:28,925 [37] Orchard.Data.Migration.DataMigrationManager - An unexpected error orccured while applying migration on Navigation from version 2
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: There is already an object named 'Navigation_MenuWidgetPartRecord' in the database.
   at System.Data.SqlClient.SqlConnection.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.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.RunPendingStatements() in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 347
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(CreateTableCommand command) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 93
   at Orchard.Data.Migration.Interpreters.AbstractDataMigrationInterpreter.Visit(ISchemaBuilderCommand command) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Data\Migration\Interpreters\AbstractDataMigrationInterpreter.cs:line 14
   at Orchard.Data.Migration.Schema.SchemaBuilder.Run(ISchemaBuilderCommand command) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 46
   at Orchard.Data.Migration.Schema.SchemaBuilder.CreateTable(String name, Action`1 table) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 19
   at Orchard.Core.Navigation.Migrations.UpdateFrom2() in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard.Web\Core\Navigation\Migrations.cs:line 132
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Orchard.Data.Migration.DataMigrationManager.Update(String feature) in C:\Working\Development\OrchardUpgrade_1_5\src\Orchard\Data\Migration\DataMigrationManager.cs:line 105
2012-08-22 22:40:28,927 [37] Orchard.Data.Migration.AutomaticDataMigrations - Could not run migrations automatically on Orchard.Blogs
2012-08-22 22:40:29,079 [37] NHibernate.Event.Default.AbstractFlushingEventListener - Could not synchronize database state with session
NHibernate.StaleStateException: Unexpected row count: 0; expected: 1
   at NHibernate.AdoNet.Expectations.BasicExpectation.VerifyOutcomeNonBatched(Int32 rowCount, IDbCommand statement)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
   at NHibernate.Action.EntityUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
2012-08-22 22:40:29,081 [37] NHibernate.Impl.AbstractSessionImpl - DTC transaction prepre phase failed
NHibernate.StaleStateException: Unexpected row count: 0; expected: 1
   at NHibernate.AdoNet.Expectations.BasicExpectation.VerifyOutcomeNonBatched(Int32 rowCount, IDbCommand statement)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
   at NHibernate.Action.EntityUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()
   at NHibernate.Transaction.AdoNetWithDistrubtedTransactionFactory.DistributedTransactionContext.System.Transactions.IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment)
2012-08-22 22:40:29,803 [13] NHibernate.AdoNet.AbstractBatcher - Could not execute query: SELECT this_.Id as Id60_4_, this_.Number as Number60_4_, this_.Published as Published60_4_, this_.Latest as Latest60_4_, this_.Data as Data60_4_, this_.ContentItemRecord_id as ContentI6_60_4_, contentite1_.Id as Id61_0_, contentite1_.Data as Data61_0_, contentite1_.ContentType_id as ContentT3_61_0_, commonpart5_.Id as Id19_1_, commonpart5_.OwnerId as OwnerId19_1_, commonpart5_.CreatedUtc as CreatedUtc19_1_, commonpart5_.PublishedUtc as Publishe4_19_1_, commonpart5_.ModifiedUtc as Modified5_19_1_, commonpart5_.Container_id as Container6_19_1_, widgetpart2_.Id as Id28_2_, widgetpart2_.Title as Title28_2_, widgetpart2_.Position as Position28_2_, widgetpart2_.Zone as Zone28_2_, widgetpart2_.RenderTitle as RenderTi5_28_2_, widgetpart2_.Name as Name28_2_, contenttyp7_.Id as Id63_3_, contenttyp7_.Name as Name63_3_ FROM Orchard_Framework_ContentItemVersionRecord this_ inner join Orchard_Framework_ContentItemRecord contentite1_ on this_.ContentItemRecord_id=contentite1_.Id left outer join Common_CommonPartRecord commonpart5_ on contentite1_.Id=commonpart5_.Id inner join Orchard_Widgets_WidgetPartRecord widgetpart2_ on contentite1_.Id=widgetpart2_.Id left outer join Orchard_Framework_ContentTypeRecord contenttyp7_ on contentite1_.ContentType_id=contenttyp7_.Id WHERE this_.Published = @p0
System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'RenderTitle'.
Invalid column name 'Name'.
   at System.Data.SqlClient.SqlConnection.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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 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()
   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
ClientConnectionId:2b3071b3-8166-41a9-8415-020d15dfb11d
2012-08-22 22:40:29,807 [13] NHibernate.Util.ADOExceptionReporter - Invalid column name 'RenderTitle'.
Invalid column name 'Name'.
2012-08-22 22:40:29,812 [13] NHibernate.Util.ADOExceptionReporter - Invalid column name 'RenderTitle'.
Invalid column name 'Name'.

Aug 27, 2012 at 10:12 AM

Just a follow up I manged to resolve the issues I had above with a combination of the following steps.

Manually Add SiteTimeZone Column to Settings_SiteSettingsPartRecord

Manually Add RenderTitle and Name Columns to Orchard_Widgets_WidgetPartRecord

Remove, Fix or Disable any incompatible Modules you may have.

Enabled Title Feature using Orchard Command Line
see http://orchard.codeplex.com/discussions/285966 and
http://docs.orchardproject.net/Documentation/Using-the-command-line-interfacefeature

Continually check the contents of Orchard.Web\App_Data\Logs - the logged info was quite helpfull in resolving the above.

Keep deleting Orchard.Web\App_Data\Sites\Default\mappings.bin until you stop seeing any errors logged.

 

I'm not sure if enabling the Title module first, and also removing/disabling any incompatible modules would have allowed the migrations to work as expected in the beginning worth a try if someone reads this before the start an update.

Coordinator
Aug 28, 2012 at 5:06 AM

It's weird this wouldn't be handled by the migration. Would you mind filing a bug with your findings?

Sep 22, 2012 at 5:14 AM

I have the similar problem with migration. Modules "Blogs" and "Navigation" are red and do not want to be upgraded. Log is full of "The specified table already exists. [ Navigation_MenuWidgetPartRecord ]" records. I have tried to remove mappings.bin, to remove mentioned table from the database - nothing helps. 

If necessary I can share my database file. Current version of running Orchard is v.1.2.41.0

Coordinator
Sep 22, 2012 at 6:11 PM

Something must have messed up your database: this happens if your migration table and the actual state of your database are out of sync. This can happen, for example, if you copied tables around or if you had a bad migration and the transaction was not rolled out for some reason. I'd export contents from the old instance, build a completely new one from scratch and import the contents into it, as I 'm afraid your database is beyond easy recovery.

Sep 23, 2012 at 8:01 AM
mike114 wrote:

I have the similar problem with migration. Modules "Blogs" and "Navigation" are red and do not want to be upgraded. Log is full of "The specified table already exists. [ Navigation_MenuWidgetPartRecord ]" records. I have tried to remove mappings.bin, to remove mentioned table from the database - nothing helps. 

I have identical issue here: Same modules require updating, same error. Trying to upgrade 1.3 to 1.5.1. 

Sep 23, 2012 at 12:35 PM
mike114 wrote:

I have the similar problem with migration. Modules "Blogs" and "Navigation" are red and do not want to be upgraded.

You need to enable the Title Module - Blogs and Navigation are dependent on it - this is why they are showing as red.

Sep 23, 2012 at 1:37 PM

> "You need to enable the Title Module.."

I did. I've enabled both Title and Content Picker. But every time I click "upgrade" link Orchard displays an error and log is appended with the error mentioned above.

Coordinator
Sep 23, 2012 at 6:31 PM

Did you upgrade first to 1.4 and then to 1.5?

Sep 23, 2012 at 7:22 PM
bertrandleroy wrote:

Did you upgrade first to 1.4 and then to 1.5?

I didn't, and that seemed to be the problem. 1.3 --> 1.4.2 --> 1.5.1 worked. Lost my navigation, though, but that is another issue. 

Coordinator
Sep 23, 2012 at 11:43 PM

Yes, the navigation thing is explained in release notes. You need to add a widget.

Oct 3, 2012 at 4:58 PM

Just running into this problem now...

I'm on 1.2 right now.  There is no way I can upgrade to 1.5.1 without first going to 1.3 to enable the Title module?

Coordinator
Oct 3, 2012 at 5:23 PM

In principle yes but I know it hasn't been working for some. Make sure you read the release notes for each release.

Oct 3, 2012 at 6:39 PM

I eventually got it to work by adding code into AutomaticDataMigrations, at the start of the Activated() method, to make sure the basic set of features is enabled.

 

            // Let's make sure that the basic set of features is enabled.  If there are any that are not enabled, then let's enable them first.
            var theseFeaturesShouldAlwaysBeActive = new[] {
                "Common", "Containers", "Contents", "Dashboard", "Feeds", "Navigation", "Reports", "Scheduling", "Settings", "Shapes", "Title"
            };
            var enabledFeatures = _featureManager.GetEnabledFeatures().Select(f => f.Id).ToList();
            var featuresToEnable = theseFeaturesShouldAlwaysBeActive.Where(shouldBeActive => !enabledFeatures.Contains(shouldBeActive)).ToList();
            if(featuresToEnable.Any()) {
                _featureManager.EnableFeatures(featuresToEnable);
            } else {
                /* everything else */
            }

 

Oct 6, 2012 at 4:15 AM
teelahti wrote:
bertrandleroy wrote:

Did you upgrade first to 1.4 and then to 1.5?

I didn't, and that seemed to be the problem. 1.3 --> 1.4.2 --> 1.5.1 worked. Lost my navigation, though, but that is another issue. 

It helped, thanks!