zunath / SWLOR_NWN

Star Wars: Legends of the Old Republic server code, a persistent world for Neverwinter Nights
40 stars 98 forks source link

GAME: Database reader issue #260

Closed zunath closed 6 years ago

zunath commented 6 years ago

At some point a database reader issue sprouted up on the test server. Could be related to the database migration code I recently added.


EVENT ERROR (C#) SWLOR.Game.Server.Event.Creature.OnDeath


EXCEPTION:

Exception type: System.Data.Entity.Core.EntityCommandExecutionException Message : An error occurred while executing the command definition. See the inner exception for details. Stacktrace: at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands (System.Data.Entity.Core.EntityClient.EntityCommand entityCommand, System.Data.CommandBehavior behavior) [0x00028] in :0 at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType] (System.Data.Entity.Core.Objects.ObjectContext context, System.Data.Entity.Core.Objects.ObjectParameterCollection parameterValues) [0x00135] in :0 at System.Data.Entity.Core.Objects.ObjectQuery1+<>c__DisplayClass7[T].<GetResults>b__6 () [0x00036] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0 at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T] (System.Func1[TResult] func, System.Data.Entity.Infrastructure.IDbExecutionStrategy executionStrategy, System.Boolean startLocalTransaction, System.Boolean releaseConnectionOnSuccess) [0x0008a] in :0 at System.Data.Entity.Core.Objects.ObjectQuery1+<>c__DisplayClass7[T].<GetResults>b__5 () [0x00033] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0 at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult] (System.Func1[TResult] operation) [0x00036] in <5c51bb66ce2c412d8224b39ad2626fbe>:0 at System.Data.Entity.Core.Objects.ObjectQuery1[T].GetResults (System.Nullable1[T] forMergeOption) [0x000a5] in :0 at System.Data.Entity.Core.Objects.ObjectQuery1[T].Execute (System.Data.Entity.Core.Objects.MergeOption mergeOption) [0x0000d] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0 at System.Data.Entity.Core.Objects.DataClasses.EntityReference1[TEntity].Load (System.Data.Entity.Core.Objects.MergeOption mergeOption) [0x00028] in :0 at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.Load () [0x00007] in :0 at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad () [0x000d2] in :0 at System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty[TItem] (TItem propertyValue, System.String relationshipName, System.String targetRoleName, System.Boolean mustBeNull, System.Object wrapperObject) [0x00031] in :0 at System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior+<>cDisplayClass7`2[TProxy,TItem].b2 (TProxy proxy, TItem item) [0x00038] in :0 at System.Data.Entity.DynamicProxies.PCQuestKillTargetPro_286F79227F5AF5A5A89640D1FE8A6DF3E1A3D1AB5F7641FC10F0D1A1BB0D4F2D.get_PCQuestStatus () [0x00007] in <9db74874374842689703cd2c4dc61ec1>:0 at SWLOR.Game.Server.Service.QuestService.OnCreatureDeath (SWLOR.Game.Server.GameObject.NWCreature creature) [0x00252] in :0 at SWLOR.Game.Server.Event.Creature.OnDeath.Run (System.Object[] args) [0x00026] in :0 at SWLOR.Game.Server.App.RunEvent[T] (System.Object[] args) [0x00024] in :0

Exception type: System.InvalidOperationException Message : There is already an open DataReader associated with this Command which must be closed first. Stacktrace: at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute (System.Data.SqlClient.SqlCommand command) [0x00057] in :0 at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute (System.String method, System.Data.SqlClient.SqlCommand command) [0x00048] in :0 at (wrapper remoting-invoke-with-check) System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(string,System.Data.SqlClient.SqlCommand) at System.Data.SqlClient.SqlCommand.ValidateCommand (System.Boolean async, System.String method) [0x00082] in :0 at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data.CommandBehavior cmdBehavior, System.Data.SqlClient.RunBehavior runBehavior, System.Boolean returnStream, System.Threading.Tasks.TaskCompletionSource1[TResult] completion, System.Int32 timeout, System.Threading.Tasks.Task& task, System.Boolean asyncWrite, System.String method) [0x0001b] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data.CommandBehavior cmdBehavior, System.Data.SqlClient.RunBehavior runBehavior, System.Boolean returnStream, System.String method) [0x0000b] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.SqlClient.SqlCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x0003c] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00000] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.Common.DbCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00000] in <d3bd623f3b7341e5a51a2d4030374687>:0 at (wrapper remoting-invoke-with-check) System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior) at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c (System.Data.Common.DbCommand t, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext1[TResult] c) [0x00007] in :0 at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1[TInterceptor].Dispatch[TTarget,TInterceptionContext,TResult] (TTarget target, System.Func3[T1,T2,TResult] operation, TInterceptionContext interceptionContext, System.Action3[T1,T2,T3] executing, System.Action3[T1,T2,T3] executed) [0x0000f] in :0 at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader (System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext interceptionContext) [0x00042] in :0 at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00046] in :0 at System.Data.Common.DbCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior) at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands (System.Data.Entity.Core.EntityClient.EntityCommand entityCommand, System.Data.CommandBehavior behavior) [0x0000a] in :0

W [20:43:08] [NWNX_Mono] [Mono.cpp:275] Caught unhandled exception when invoking NWN.Scripts.crea_on_death::Main: System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first. at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute (System.Data.SqlClient.SqlCommand command) [0x00057] in :0 at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute (System.String method, System.Data.SqlClient.SqlCommand command) [0x00048] in :0 at (wrapper remoting-invoke-with-check) System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(string,System.Data.SqlClient.SqlCommand) at System.Data.SqlClient.SqlCommand.ValidateCommand (System.Boolean async, System.String method) [0x00082] in :0 at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data.CommandBehavior cmdBehavior, System.Data.SqlClient.RunBehavior runBehavior, System.Boolean returnStream, System.Threading.Tasks.TaskCompletionSource1[TResult] completion, System.Int32 timeout, System.Threading.Tasks.Task& task, System.Boolean asyncWrite, System.String method) [0x0001b] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data.CommandBehavior cmdBehavior, System.Data.SqlClient.RunBehavior runBehavior, System.Boolean returnStream, System.String method) [0x0000b] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.SqlClient.SqlCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x0003c] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00000] in <d3bd623f3b7341e5a51a2d4030374687>:0 at System.Data.Common.DbCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00000] in <d3bd623f3b7341e5a51a2d4030374687>:0 at (wrapper remoting-invoke-with-check) System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior) at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c (System.Data.Common.DbCommand t, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext1[TResult] c) [0x00007] in :0 at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1[TInterceptor].Dispatch[TTarget,TInterceptionContext,TResult] (TTarget target, System.Func3[T1,T2,TResult] operation, TInterceptionContext interceptionContext, System.Action3[T1,T2,T3] executing, System.Action3[T1,T2,T3] executed) [0x0000f] in :0 at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader (System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext interceptionContext) [0x00042] in :0 at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00046] in :0 at System.Data.Common.DbCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior) at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands (System.Data.Entity.Core.EntityClient.EntityCommand entityCommand, System.Data.CommandBehavior behavior) [0x0000a] in :0 --- End of inner exception stack trace --- at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands (System.Data.Entity.Core.EntityClient.EntityCommand entityCommand, System.Data.CommandBehavior behavior) [0x00028] in :0 at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType] (System.Data.Entity.Core.Objects.ObjectContext context, System.Data.Entity.Core.Objects.ObjectParameterCollection parameterValues) [0x00135] in :0 at System.Data.Entity.Core.Objects.ObjectQuery1+<>c__DisplayClass7[T].<GetResults>b__6 () [0x00036] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0 at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T] (System.Func1[TResult] func, System.Data.Entity.Infrastructure.IDbExecutionStrategy executionStrategy, System.Boolean startLocalTransaction, System.Boolean releaseConnectionOnSuccess) [0x0008a] in :0 at System.Data.Entity.Core.Objects.ObjectQuery1+<>c__DisplayClass7[T].<GetResults>b__5 () [0x00033] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0 at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult] (System.Func1[TResult] operation) [0x00036] in <5c51bb66ce2c412d8224b39ad2626fbe>:0 at System.Data.Entity.Core.Objects.ObjectQuery1[T].GetResults (System.Nullable1[T] forMergeOption) [0x000a5] in :0 at System.Data.Entity.Core.Objects.ObjectQuery1[T].Execute (System.Data.Entity.Core.Objects.MergeOption mergeOption) [0x0000d] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0 at System.Data.Entity.Core.Objects.DataClasses.EntityReference1[TEntity].Load (System.Data.Entity.Core.Objects.MergeOption mergeOption) [0x00028] in :0 at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.Load () [0x00007] in :0 at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad () [0x000d2] in :0 at System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty[TItem] (TItem propertyValue, System.String relationshipName, System.String targetRoleName, System.Boolean mustBeNull, System.Object wrapperObject) [0x00031] in :0 at System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior+<>cDisplayClass7`2[TProxy,TItem].b2 (TProxy proxy, TItem item) [0x00038] in :0 at System.Data.Entity.DynamicProxies.PCQuestKillTargetPro_286F79227F5AF5A5A89640D1FE8A6DF3E1A3D1AB5F7641FC10F0D1A1BB0D4F2D.get_PCQuestStatus () [0x00007] in <9db74874374842689703cd2c4dc61ec1>:0 at SWLOR.Game.Server.Service.QuestService.OnCreatureDeath (SWLOR.Game.Server.GameObject.NWCreature creature) [0x00252] in :0 at SWLOR.Game.Server.Event.Creature.OnDeath.Run (System.Object[] args) [0x00026] in :0 at SWLOR.Game.Server.App.RunEvent[T] (System.Object[] args) [0x00079] in :0 at NWN.Scripts.crea_on_death.Main () [0x00006] in :0

zunath commented 6 years ago

Was an issue on the quest data pullback. Should be fixed now.