Closed Piedone closed 5 months ago
Something you might be interested in @sarahelsaig?
Yes!
It's yours, then :).
Almost done, except the SQL Server UI tests fail now, of all things. I've pasted the message below. Do you have any hint, @Piedone ? I recall recently you did an issue related to MultipleActiveResultSets
.
2024-03-18 02:20:09.5435|Default|00-d897ab0f006a4b692dcc0d6793ea5912-e6ed5a8c98c88afb-00||OrchardCore.Environment.Shell.ShellFeaturesManager|ERROR|IFeatureEventHandler thrown from OrchardCore.Roles.Services.RoleUpdater by InvalidOperationException System.InvalidOperationException: The connection does not support MultipleActiveResultSets.
at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__211_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 434
at YesSql.Store.ProduceAsync[T,TState](WorkerQueryKey key, Func`2 work, TState state)
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at OrchardCore.Data.Documents.DocumentStore.GetOrCreateMutableAsync[T](Func`1 factoryAsync)
at OrchardCore.Documents.DocumentManager`1.GetOrCreateMutableAsync(Func`1 factoryAsync)
at OrchardCore.Roles.Services.RoleUpdater.UpdateRolesForInstalledFeatureAsync(IFeatureInfo feature)
at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1](IEnumerable`1 events, Func`3 dispatch, T1 arg1, ILogger logger) at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__211_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 434
at YesSql.Store.ProduceAsync[T,TState](WorkerQueryKey key, Func`2 work, TState state)
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at OrchardCore.Data.Documents.DocumentStore.GetOrCreateMutableAsync[T](Func`1 factoryAsync)
at OrchardCore.Documents.DocumentManager`1.GetOrCreateMutableAsync(Func`1 factoryAsync)
at OrchardCore.Roles.Services.RoleUpdater.UpdateRolesForInstalledFeatureAsync(IFeatureInfo feature)
at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1](IEnumerable`1 events, Func`3 dispatch, T1 arg1, ILogger logger)
2024-03-18 02:20:11.0334|Default|00-d897ab0f006a4b692dcc0d6793ea5912-e6ed5a8c98c88afb-00||OrchardCore.Environment.Shell.ShellFeaturesManager|ERROR|IFeatureEventHandler thrown from OrchardCore.Roles.Services.RoleUpdater by InvalidOperationException System.InvalidOperationException: The connection does not support MultipleActiveResultSets.
at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__211_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 434
at YesSql.Store.ProduceAsync[T,TState](WorkerQueryKey key, Func`2 work, TState state)
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at OrchardCore.Data.Documents.DocumentStore.GetOrCreateMutableAsync[T](Func`1 factoryAsync)
at OrchardCore.Documents.DocumentManager`1.GetOrCreateMutableAsync(Func`1 factoryAsync)
at OrchardCore.Roles.Services.RoleUpdater.UpdateRolesForInstalledFeatureAsync(IFeatureInfo feature)
at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1](IEnumerable`1 events, Func`3 dispatch, T1 arg1, ILogger logger) at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__211_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 434
at YesSql.Store.ProduceAsync[T,TState](WorkerQueryKey key, Func`2 work, TState state)
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
at OrchardCore.Data.Documents.DocumentStore.GetOrCreateMutableAsync[T](Func`1 factoryAsync)
at OrchardCore.Documents.DocumentManager`1.GetOrCreateMutableAsync(Func`1 factoryAsync)
at OrchardCore.Roles.Services.RoleUpdater.UpdateRolesForInstalledFeatureAsync(IFeatureInfo feature)
at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1](IEnumerable`1 events, Func`3 dispatch, T1 arg1, ILogger logger)
Yes, see https://github.com/Lombiq/UI-Testing-Toolbox/issues/343 and https://github.com/OrchardCMS/OrchardCore/issues/15224. This looks like an OC bug in the Roles module (and a new one since 1.8), then, most possibly some unwanted multi-threaded SQL query. Please add details to the OC issue and fix it if you can.
The https://github.com/OrchardCMS/OrchardCore/pull/13181 PR changed the registration order of the authentication middleware. This might break BlockMediaThemeTemplateDirectAccessMiddleware
. Please make sure it's not broken.
Now the blocking bugs are fixed, so tomorrow morning the updated packages should be on Cloudsmith. Please also see the localization thing I added above.
Oh, what a relief! I will update the packages and validate the results during the weekend.
Thanks! FYI @MikeAlhayek.
Issues like https://github.com/OrchardCMS/OrchardCore/issues/15628 can now be made apparent, even with SQLite, with the new EnableThreadSafetyChecks
YesSql config. Please enable those for UI tests, see https://github.com/OrchardCMS/OrchardCore/pull/15961.
Is this intentionally not closed @dministro?
After https://github.com/OrchardCMS/OrchardCore/pull/14572, OC now uses
System.Text.Json
instead of Json.NET. So, let's upgrade to this preview version and test if anything is broken.task/system-text-json-migration
branch fromdev
and start your issue branch from there. After this issue is done, we won't yet merge this todev
, waiting for that for OC v2.0.BlockMediaThemeTemplateDirectAccessMiddleware
. Be sure it's not broken.EnableThreadSafetyChecks
YesSql config. Please enable those for UI tests, see https://github.com/OrchardCMS/OrchardCore/pull/15961.Jira issue