OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

TooManyRowsAffectedException trying to upgrade site to 1.10 #6753

Open IDisposable opened 8 years ago

IDisposable commented 8 years ago

On a site originally on 1.7, upgraded to 1.9.2, then getting an error (see issue #6752) since Windows Updates, I've tried doing an upgrade to 1.9.3 (no change for referenced error) then to 1.10 and I get a rather nasty issue at first run that will not allow the site to even start up. This seems to be related to the Alias table (possibly a migration), but I can't really fathom what is going on:

2016-04-12 18:14:17,317 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'SteadyRainCVB' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,320 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'SteadyRainCVB' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,323 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'SteadyRainCVB' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,326 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'FeaturedItemSlider' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,329 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Vandelay.Feedburner' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,331 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Vandelay.TagCloud' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,333 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Vandelay.TagRss' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,335 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Orchard.Messaging' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,338 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Vandelay.Feedburner' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,341 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Vandelay.TagCloud' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,343 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Vandelay.TagRss' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:17,346 [18] Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - WARN Identified 'Bing.Maps.bak' as an orphaned feature state record in Settings_ShellFeatureRecord.
2016-04-12 18:14:24,848 [18] NHibernate.Event.Default.AbstractFlushingEventListener - (null) - ERROR Could not synchronize database state with session
NHibernate.AdoNet.TooManyRowsAffectedException: Batch update returned unexpected row count from update; actual row count: 255; expected: 254
   at NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount)
   at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
2016-04-12 18:14:24,863 [18] Orchard.Alias.Implementation.Updater.AliasHolderUpdater - (null) - ERROR Exception during Alias refresh
NHibernate.AdoNet.TooManyRowsAffectedException: Batch update returned unexpected row count from update; actual row count: 255; expected: 254
   at NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount)
   at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
   at NHibernate.Event.Default.DefaultAutoFlushEventListener.OnAutoFlush(AutoFlushEvent event)
   at NHibernate.Impl.SessionImpl.AutoFlushIfRequired(ISet`1 querySpaces)
   at NHibernate.Impl.SessionImpl.List(IQueryExpression queryExpression, QueryParameters queryParameters, IList results)
   at NHibernate.Impl.AbstractSessionImpl.List(IQueryExpression queryExpression, QueryParameters parameters)
   at NHibernate.Impl.AbstractQueryImpl2.List()
   at NHibernate.Linq.DefaultQueryProvider.ExecuteQuery(NhLinqExpression nhLinqExpression, IQuery query, NhLinqExpression nhQuery)
   at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression)
   at NHibernate.Linq.DefaultQueryProvider.Execute[TResult](Expression expression)
   at Remotion.Linq.QueryableBase`1.GetEnumerator()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orchard.Alias.Implementation.Storage.AliasStorage.List(Expression`1 predicate)
   at Orchard.Alias.Implementation.Updater.AliasHolderUpdater.Refresh()
2016-04-12 18:14:25,703 [18] NHibernate.Event.Default.AbstractFlushingEventListener - (null) - ERROR Could not synchronize database state with session
NHibernate.AdoNet.TooManyRowsAffectedException: Batch update returned unexpected row count from update; actual row count: 256; expected: 255
   at NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount)
   at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
2016-04-12 18:14:25,815 [18] Orchard.Environment.DefaultOrchardHost - (null) - ERROR A tenant could not be started: Default
NHibernate.AdoNet.TooManyRowsAffectedException: Batch update returned unexpected row count from update; actual row count: 256; expected: 255
   at NHibernate.AdoNet.Expectations.VerifyOutcomeBatched(Int32 expectedRowCount, Int32 rowCount)
   at NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()
   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.AdoTransaction.Commit()
   at Orchard.Data.TransactionManager.DisposeSession() in C:\SteadyRain\F\FunLake\FunLakeMaster\CVB-Application\src\Orchard\Data\SessionLocator.cs:line 92
   at Orchard.Data.TransactionManager.Dispose() in C:\SteadyRain\F\FunLake\FunLakeMaster\CVB-Application\src\Orchard\Data\SessionLocator.cs:line 82
   at Autofac.Core.Disposer.Dispose(Boolean disposing)
   at Autofac.Util.Disposable.Dispose()
   at Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing)
   at Autofac.Util.Disposable.Dispose()
   at Autofac.Features.OwnedInstances.Owned`1.Dispose(Boolean disposing)
   at Autofac.Util.Disposable.Dispose()
   at Orchard.Environment.DefaultOrchardShell.Activate() in C:\SteadyRain\F\FunLake\FunLakeMaster\CVB-Application\src\Orchard\Environment\DefaultOrchardShell.cs:line 80
   at Orchard.Environment.DefaultOrchardHost.ActivateShell(ShellContext context) in C:\SteadyRain\F\FunLake\FunLakeMaster\CVB-Application\src\Orchard\Environment\DefaultOrchardHost.cs:line 175
   at Orchard.Environment.DefaultOrchardHost.<CreateAndActivateShells>b__32_1(ShellSettings settings) in C:\SteadyRain\F\FunLake\FunLakeMaster\CVB-Application\src\Orchard\Environment\DefaultOrchardHost.cs:line 147
sebastienros commented 8 years ago

Can you try to disable AliasHolderUpdater feature first?