Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to latest OC preview to test System.Text.Json (OSOE-795) #692

Closed
6 tasks done
Piedone opened this issue Feb 4, 2024 · 11 comments · Fixed by #712
Closed
6 tasks done

Upgrade to latest OC preview to test System.Text.Json (OSOE-795) #692

Piedone opened this issue Feb 4, 2024 · 11 comments · Fixed by #712
Assignees

Comments

@Piedone
Copy link
Member

Piedone commented Feb 4, 2024

After OrchardCMS/OrchardCore#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.

Jira issue

@github-actions github-actions bot changed the title Upgrade to latest OC preview to test System.Text.Json Upgrade to latest OC preview to test System.Text.Json (OSOE-795) Feb 4, 2024
@Piedone
Copy link
Member Author

Piedone commented Feb 4, 2024

Something you might be interested in @sarahelsaig?

@sarahelsaig
Copy link
Member

Yes!

@Piedone
Copy link
Member Author

Piedone commented Feb 4, 2024

It's yours, then :).

@sarahelsaig
Copy link
Member

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)

@Piedone
Copy link
Member Author

Piedone commented Mar 18, 2024

Yes, see Lombiq/UI-Testing-Toolbox#343 and OrchardCMS/OrchardCore#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.

@Piedone
Copy link
Member Author

Piedone commented Apr 27, 2024

@Piedone
Copy link
Member Author

Piedone commented May 2, 2024

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.

@sarahelsaig
Copy link
Member

Oh, what a relief! I will update the packages and validate the results during the weekend.

@Piedone
Copy link
Member Author

Piedone commented May 3, 2024

Thanks! FYI @MikeAlhayek.

@Piedone
Copy link
Member Author

Piedone commented May 4, 2024

Issues like OrchardCMS/OrchardCore#15628 can now be made apparent, even with SQLite, with the new EnableThreadSafetyChecks YesSql config. Please enable those for UI tests, see OrchardCMS/OrchardCore#15961.

@Piedone
Copy link
Member Author

Piedone commented May 16, 2024

Is this intentionally not closed @dministro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment