OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.23k stars 2.34k forks source link

Frontend, admin access is very slow (5-20s when accessing homepage, tags...), 502 nginx when I clone blogpost posts automatically to test by running culr #14785

Open davidchan9x opened 7 months ago

davidchan9x commented 7 months ago

https://github.com/OrchardCMS/OrchardCore/assets/152346391/b7a90018-101f-4814-90b1-4609590610e8

Frontend, admin access is very slow (5-20s when accessing homepage, tags, category ...) when I clone blogpost posts automatically to test by running culr, I have cloned 9.9 thousand blogpost records.

When I'm cloning with the culr command, accessing the home page, taxonomy (tag, category...) is very slow and sometimes takes 5-10 seconds to access. My cpu is 2cpu with 4GB ram and I check the cpu before it works. I still have 50% CPU left. When I stop running the culr command, I don't get the frontend slow access error anymore. But when the cookies expire, I can't clone but I still intentionally run the above clone command and I get the error 502 nginx (vps 2 core 4 ram no one has access, only I tested it) - vps : ubuntu 20.04, sqlserver 2022

I accessed sqlserver and tried the following query, it took > 10 seconds to complete the query, orchard core when I cloned records continuously with the culr command, it slowed down sqlserver a lot, which caused the problem. The website is so slow (because sqlserver queries take a lot of time)

*SELECT COUNT() FROM [cms].[dbo].[cms_ContentItemIdex]**

When cookies and tokens expire but still run the above clone command with the culr website command, you will get error 502, this is a dangerous error that can be exploited to attack security holes and crash websites using orchard core.

370217098_6773700189392229_7616904509733424759_n

(https://github.com/OrchardCMS/OrchardCore/assets/152346391/80420b94-2f52-476b-8552-f4f927314581)

398373482_1347458519498160_6707327978439074419_n

I found the error, probably due to opening multiple sqlserver pool connections when automatically adding many blogpost records. Can orchard core fix this error?

for ((i=1;i<=10000;i++)); do
curl 'http://172.104.51.27/Admin/Contents/ContentItems/4yg2v80q7byph01aahvspg3vwk/Clone' \
  -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
  -H 'Accept-Language: en-US,en;q=0.9,vi;q=0.8,ja;q=0.7,jv;q=0.6' \
  -H 'Cache-Control: max-age=0' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Cookie: __orchantiforgery_46qjf2f3jc99v7evy9yt06st4n=CfDJ8P6G5HaclTdKqpd37h0WY-dcO3eTTb5YwPym2tKF48lmdUY0aVu2GRxXoFev59-IocmHd1GSKtt7flwEHWfgcArkIw2_JFABlpkMKO_L6eFYXLPiQ2egFcHmodN1ft9bM1s2qDiX6e9cMXsUNq_WUGE; orchauth_Default=CfDJ8P6G5HaclTdKqpd37h0WY-cKcwz6k-GEF-7qs_uLi2z-9NGAIqmwinkFjf3RKh4a75uU7DVX32qRaXWV4UfoUN3mXLEHPRoiYAXJP68HWcZ8ldD2jdDElcY9fwmKChhMbUk0Wo4feTTvWG7rdVfLyBeEXiYpe-Mjyc2VSyWxZAijHKqERfQVKRqAzAvdoi_IhU_xHSinV0_q2Rx5RUZ_iZSZwZ_FAkr5k8dumyfLg3LJdo2Pl5NEf9qsWbRgyvV_-wXFFWr_BWHoFml4-u6E5HxR9GKpEsZ-mbVWPw6TCcF-kMA6K3Hjox0jvIsz6ci96Ou2v9DfIPNXYms_9ojpqfhCZKjXz8AysIJvH5Pb5iiOEKsUCBQoQHd3QK34f5zTyBTXZJwlhflqwR4rWI056b5wn3dztu-dD2hUeA6wsVJMOqxWFKWCSaG4BjKKCSORkMZY49fHAH-sPvUWfLK8jsxzLgauVtUiZlUHoyCUgoRjDkRYBLEgC2zf46QJ_iKzUUCyqkgeNAjMm4OAlnczYiNWxsATt44gYj33qef2fE8tZhNvg5h8_WVCPX-KPnhNLFAeYCy3WXhpkDmkAhphFksqVTYaKSQXZIbmfbCvrXlMX855Pd-gqOcUAuzefQT54RrYrfz_oVrRnaTMJKWgwyNpesVUy_qV6N5IBEJKFjHtx6sje-MWERNHljrtIOj4AhflA24Vj-Qj7JSkoVcAX11FCffveFvROJaZ2RpVjK8o-dWKW5gPHIMby4ZVWMPXagt33QNV63mGtI5buPiH3aFR60MziqjRokcwGShMBreq4sQd4MhRz0bHrtHCBSwbJnH_gsY9f34scOh7bL9erDeKJb1yeKZzF4be5K3zi8GS5-9eZo-oErCZl1rI-50imqgcBrYg2pgv0tA9Nebo6eDkE2nBDzzkZWn3DhP8KGPM7LxjdPiq-2aLPLoMbLRLUbfp5aNsloJjdAMlb41V8MLJCCiljbndLmI5RGjxJv3wRxDns_bU_1tL31fQcuuhPkRBJ41AWCYKrTEb6PygfZlMRLSXi4RsKjlG-WSP2pI8vNbTPXdpgLgnISP__Lj9dJG9I49B5ktn2xa6__tN71LA9tELBFyKDdlk6U0BhMN5u3HRmeGWvZljSL5rHldcRSw1s-xKOPrhusI0lJfE3IZAnXhJqbv5rI_SkfFo-OvzntKY5ZVLBC8JZILXZbQqG34pqIxlT1Cs7vz_T5idhwg1goJFGOLdnAZt4BvYA29BNAbjxSRM7Xk-_ElWHzloFx-38gpVaSlGjNhvCfWtLXQOkMu2-OeVUtLbvxO4pYPdwW-mrjFWv79b0xoMDuoAMfI3aR0VBSkHzfS5yy6x9yhfMm1r4EzR9EJhFrntPcnVx8_JZX9jpKlvUs3TCPZl0qZCl_E3qpUFZONYcLELWv78vmB083D5KhfE7WqpUYGILg9Js8Wy2vLiSr_hRFOaUeDpduM3K_wRnKKKphuStM5TpR354m8U15uTJFOX5jYJ0t6iW76QUcFkQVZ7eXMDPisahSpmCdNBd3RboZmZrfMuFwAv8MRffOXMWE24UhFyO19plXQUDVIes-I2nSoiLrnctYrTTM2l462wTJCeVuwAwuKxFl-2t4szOdczqLvAk7sZl8Rv9IGrCYdWd1o6FZH_7WcQ5py_36fpArUcrqLNunJAOgQqU-AFva0zpkVYOV6Exz3158uEmfdKHIlenBCqCBHB30rq0gHMX7qg1ernQ_L0j3Qfcjv7g_TVk33PWKRo_ch_w3DTJJSkcjMFdogZWngyXoVFp-oek6iSNAQFvGJTiH1Sn7ZjEFx7GBySVuWGxKaedrddA5-6-xNmPw_Y3hJ4MrMaU14d9N_nJTtQdBGGOYgmR7L4E-KYv75IihY3suwyW_ry2qoNKie7u1ghVv1gqmxxmHqVqYqfx2TXP43AlZm9Qe_GV8ylo-_XOPtA0UFHQXgJytIh0vNoG2zXy9ozT86Qtq0E2wccMoy1tVRK7PnHRfHezgwMpc83xltsq1A-oXNPYSmsHvY7FlNjwGa42iBWKfN5XdWK_EXeQQSUNCJySQdbvy3PlNv3udJLboe5bbXJnSPPEk6cpXSdq7HWyL_f7IAatZWvxOwwNF6tK8fUYGr_Fk85nfRJ8Uz1o8qd0hK0att-389t65ok8jqoZr4frDaissDx1b4xmNnI2LTpb1Meqb1TBWKj1pO6Qx3D0T_HJzX0YJx5b7FAIANrrgEXMIDIsJ0fnrp_sxDy8z9gZkSAvRpQZ_xDXWxgCRemrM5ea5q9jrA4ZTSbTsENo2MnPlEktju9TyB17yabGikEJxJ1PJgWwFkvXx9qIZMLuUwuj5HV1fKNO2PsA4-ZbTzDTYJMnzzhftcLeBpXh8cIl0AcL4rZ6iIRnxa4F_xNuSgZO5PBLkgkCcbTOpWdT8S5KvnAgeB-no5NcdkF-2UodwoxhkRvmjlWHywgq2ZurUHAgXAc-digF6-D4W1M39qQkjNs4gxlMYGLgilpuXnIQjWR3iQr9dc04SM29aMJRbrbysL_zS2wmlT9Jkk9YQlR_EjaerD1DTXtQo4HkfbsjXssdtXQH5b4X5UW0a21a79tnEsJUN6kYL_CjKxlBxuWw02v58P8h_V1sKrqelXqz7bG-eJfgMdNzCJ6RvSvM0tWXUae_qsEUw8_Ly3AkAZ0VxSGmm9NfZCXdfZIL9mIQzaSEy8OmO0lY6bG5LBj8SqfaiqJR3hl0BkHQ9-SWO3FjRgIivQ_HCKdOZYuM2S9YzNDODSPiIUoNhYyZWXroA0ZdBgbvINNaTL7dHcBSqm7H2or8au7Xwo3uIWDxhA8HOvUH5uKWL12jA60quG3PbLIcLXpqrzjCG-9ikiRSzkAYzLaxqG0RcGWSgNVMuTcIIroyppZBwCHo59INB0nYPWQaVbcarDzoyc0iFvpQLK9LxUQghJxmJ9kar4uCo3myBICeeSzYyqv_yiT3wSpR-TPPQXDuXM5QOy2r0L5N979qhW_QVN_mliP1B7YdxR9SAe_yeqeNazp-42c2SFdVhPFnqGLj6iGfgs1pFse5T50JNytjHeh-hVx9ByIo_DA71LplRC2N_C71tYT3K3znvAD4fzBmWV7P5Y2TKFd_-CD6QtgY1YHarC-oe6YmzDG_OykUvp5PYhi1fONXO0tGT4kwcoiRWixYPza3GqRK6Ch-ACGxdngr-VR9kk20iU0jVkKuz7RmFG3dELgBvXjjyGFGIDxbwWVsScTDkFndG5b4S6qmaPRw7Tv-Tuw2fEGn2_KZjRCs8csLa4OYgL113H_WcAZ9za4L-7aOhZFKulvDHiRF3Y7WTF5okDU0mU_uX2YSptz_OHP; Default-adminPreferences={%22leftSidebarCompact%22:false%2C%22isCompactExplicit%22:false%2C%22darkMode%22:false}; admin_Default=-1087955268' \
  -H 'Origin: null' \
  -H 'Upgrade-Insecure-Requests: 1' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \
  --data-raw '__RequestVerificationToken=CfDJ8P6G5HaclTdKqpd37h0WY-cQEdes8fCSD5OfUeqsdARtNVJOoyGcJkSebQYIHZywjO6uBQF7lPGFabwIoArPidfrlyHz-8iKSsBeWsGNG1WB-LBdLo-pz71NP0ZMS4Vg4rGpMDKsAsxIwDe6vEbLwDkbj9Nl3KJSvqtOlNIgrfyA-0l2p3Fk-KtZXAxxpKxaQA&returnUrl=%2FAdmin%2FContents%2FContentItems%2FBlogPost%3Fadmin%3D-1087955268' \
  --compressed \
  --insecure

done

MikeAlhayek commented 7 months ago

I am guessing you have connection issue to from the web server to the sql server. What you should do is enable the Mini Profiler feature and see each query being executed along with duration so you can identify the bottleneck.

davidchan9x commented 7 months ago

I am guessing you have connection issue to from the web server to the sql server. What you should do is enable the Mini Profiler feature and see each query being executed along with duration so you can identify the bottleneck.

sql server crashes only when doing automatic cloning of blogpost records using culr command, i think too many connections were opened to sqlserver, orchard core doesn't automatically close connections after inserting into records sqlserver. When I stop the above clone command, sqlserver is no longer slow. This is a bug that I think orchard core needs to investigate and fix. vps 2 core 4 ram no one has access, only I tested it. I run the *"SELECT COUNT() FROM [cms].[dbo].[cms_ContentItemIdex]"** statement directly on sqlserver management which is also slow

When cookies and tokens expire but still run the above clone command with the culr website command, you will get error 502, this is a dangerous error that can be exploited to attack security holes and crash websites using orchard core.

370217098_6773700189392229_7616904509733424759_n

davidchan9x commented 7 months ago

398373482_1347458519498160_6707327978439074419_n

I found the error, probably due to opening multiple sqlserver pool connections when automatically adding many blogpost records. Can orchard core fix this error?

Piedone commented 7 months ago

Also worth noting is that if you're investigating such an issue, don't try to performance test it with 100k requests being issued to your site on DotNest ;).

Skrypt commented 7 months ago

Please report these "security issues" directly to @sebastienros Look at the readme.md file. I think we should close the topic.

davidchan9x commented 7 months ago

@Piedone I didn't rent a tester on DotNest.net, I rented a 2 core 4gb vps to test, and I was the only one testing with no visitors. The culr command to clone records is a normal command, not 100k requests like you said. . The problem here is that pooling was overloaded, sql pooling was not closed after cloning, so the clone continued to open the pool again, so sqlserver overloaded the pool (even though the cpu was only used at 49%) leading to the error. 502 nginx.

@Skrypt I test clone or add blogpost automatically so that I can later transfer all my data from the old website to the new orchard core technology. But after cloning or automatically adding products for a while, pooling overload results in slow sqlserver and 502 nginx. This is an error that needs to be fixed.

I just added 1 blogpost, then I turned on f12 copy culr, then ran the command for do culr in ubuntu. After cloning for 4-5 minutes, orchard core continues to get error 502 nginx.

Piedone commented 7 months ago

You did hammer your site site on DotNest with requests, but I digress.

davidchan9x commented 7 months ago

You did hammer your site site on DotNest with requests, but I digress.

Oh, I tried installing a website on DotNest to test clone records to see if it was slow and had 502 nginx errors like me (I rented a 2 core 4 gb vps to test the clone and also had slow web access and 502 nginx errors), I have no intention of DDOSing anything. Because I want to transfer my data to Orchard core, but when cloning or adding blogpost records automatically, I get slow access and 502 nginx errors. I guess the sqlserver polling is overflowing and overloaded (Due to not closing the sql connection when completing the culr clone command or adding 1 blogpost record)

Skrypt commented 7 months ago

Do your tests locally, not on a public server. The responsible way is to inform @piedone to get approval first. Thanks.

davidchan9x commented 7 months ago

@Skrypt Sorry, I will learn from experience, ( I tested locally and on a 2 core 4gb vps and also had slow web access and a 502 nginx error so I tested further on DotNest.) I just want to see if I installed something wrong or if DotNest also has the same error as me when cloning or adding a blogpost record continuously (Because later I transfer data from On sang's website, I am also ready to automatically add records to orchard core)..I have just joined and learned about orchard core for 1 month, I have already received an email from @Piedone notifying me.

davidchan9x commented 7 months ago

orchard-log-2023-11-29.log

This is my error log file on orchard core.

davidchan9x commented 7 months ago

After continuing testing, orchard localhost + sqlserver vps, orchard vps + sqlserver vps. When executing the culr command to automatically add blogpost records on the vps, the orchard core vps gets error 502, but when I run the code localhost + sqlserver 2022, the code runs normally without any problems => proving that the sqlserver vps is not erroring, the error is due to orchard core vps, but I checked the vps 2 core 4gb ram and only used up 40% of the cpu, the ram has 2.2GB left, the vps is still full load.

davidchan9x commented 7 months ago

Log Error 502 nginx :

2023-11-30 15:32:59.8389||||Microsoft.Hosting.Lifetime|INFO|Application is shutting down... 
2023-11-30 15:33:00.4364|Default|00-b1b88e78423a2ea58b16d948a663408c-9205e418d8543f0d-00||OrchardCore.ContentManagement.Handlers.ContentPartHandlerCoordinator|ERROR|IContentPartHandler thrown from OrchardCore.Autoroute.Handlers.AutoroutePartHandler by SqlException Microsoft.Data.SqlClient.SqlException (0x80131904): A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 2 - Connection was terminated: Connection was terminated)
   at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__208_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 459
   at YesSql.Store.ProduceAsync[T,TState](WorkerQueryKey key, Func`2 work, TState state)
   at YesSql.Services.DefaultQuery.Query`1.ListImpl()
   at YesSql.Services.DefaultQuery.Query`1.ListImpl()
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.IsAbsolutePathUniqueAsync(String path, String contentItemId) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 479
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.GenerateUniqueAbsolutePathAsync(String path, String contentItemId) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 460
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.GenerateContainerPathFromPatternAsync(AutoroutePart part) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 420
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.UpdatedAsync(UpdateContentContext context, AutoroutePart part) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 141
   at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1,T2](IEnumerable`1 events, Func`4 dispatch, T1 arg1, T2 arg2, ILogger logger) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore\OrchardCore.Abstractions\Modules\Extensions\InvokeExtensions.cs:line 158
ClientConnectionId:87ad51d1-6992-4bb9-b9e9-828e7436ed49    at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__208_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 459
   at YesSql.Store.ProduceAsync[T,TState](WorkerQueryKey key, Func`2 work, TState state)
   at YesSql.Services.DefaultQuery.Query`1.ListImpl()
   at YesSql.Services.DefaultQuery.Query`1.ListImpl()
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.IsAbsolutePathUniqueAsync(String path, String contentItemId) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 479
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.GenerateUniqueAbsolutePathAsync(String path, String contentItemId) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 460
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.GenerateContainerPathFromPatternAsync(AutoroutePart part) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 420
   at OrchardCore.Autoroute.Handlers.AutoroutePartHandler.UpdatedAsync(UpdateContentContext context, AutoroutePart part) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Autoroute\Handlers\AutoroutePartHandler.cs:line 141
   at OrchardCore.Modules.InvokeExtensions.InvokeAsync[TEvents,T1,T2](IEnumerable`1 events, Func`4 dispatch, T1 arg1, T2 arg2, ILogger logger) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore\OrchardCore.Abstractions\Modules\Extensions\InvokeExtensions.cs:line 158
2023-11-30 15:33:00.4497|Default|00-b1b88e78423a2ea58b16d948a663408c-9205e418d8543f0d-00|1|Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
 ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
 ---> System.Net.Sockets.SocketException (104): Connection reset by peer
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.Data.SqlClient.SNI.SNITCPHandle.Receive(SNIPacket& packet, Int32 timeoutInMilliseconds)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning(Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
   at Microsoft.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
   at Microsoft.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(SqlConnectionEncryptOption encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean& marsCapable, Boolean& fedAuthRequired, Boolean tlsFirst)
   at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnectionString connectionOptions, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
   at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
   at Microsoft.Data.SqlClient.SqlConnection.InternalOpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at YesSql.Session.CreateConnectionAsync()
   at YesSql.Session.SaveEntityAsync(Object entity, String collection)
   at YesSql.Session.FlushAsync()
   at YesSql.Session.FlushAsync()
   at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
   at OrchardCore.ContentManagement.DefaultContentManager.PublishAsync(ContentItem contentItem) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore\OrchardCore.ContentManagement\DefaultContentManager.cs:line 446
   at OrchardCore.Contents.Controllers.AdminController.<CreateAndPublishPOST>b__21_0(ContentItem contentItem) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Contents\Controllers\AdminController.cs:line 379
   at OrchardCore.Contents.Controllers.AdminController.CreatePOST(String id, String returnUrl, Boolean stayOnSamePage, Func`2 conditionallyPublish) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Contents\Controllers\AdminController.cs:line 647
   at OrchardCore.Contents.Controllers.AdminController.CreateAndPublishPOST(String id, String submitPublish, String returnUrl) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Contents\Controllers\AdminController.cs:line 380
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at OrchardCore.Seo.Services.RobotsMiddleware.Invoke(HttpContext httpContext) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Seo\Services\RobotsMiddleware.cs:line 65
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at OrchardCore.Apis.GraphQL.GraphQLMiddleware.Invoke(HttpContext context, IAuthorizationService authorizationService, IAuthenticationService authenticationService, ISchemaFactory schemaService, IDocumentWriter documentWriter) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Apis.GraphQL\GraphQLMiddleware.cs:line 71
   at OrchardCore.Liquid.ScriptsMiddleware.Invoke(HttpContext httpContext) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Liquid\ScriptsMiddleware.cs:line 71
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at OrchardCore.Diagnostics.DiagnosticsStartupFilter.<>c__DisplayClass3_0.<<Configure>b__1>d.MoveNext() in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Diagnostics\DiagnosticsStartupFilter.cs:line 47
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
ClientConnectionId:2e8c7b41-4478-4bfa-ae41-2962af53f17a    at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning(Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
   at Microsoft.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
   at Microsoft.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(SqlConnectionEncryptOption encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean& marsCapable, Boolean& fedAuthRequired, Boolean tlsFirst)
   at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnectionString connectionOptions, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
   at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
   at Microsoft.Data.SqlClient.SqlConnection.InternalOpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at YesSql.Session.CreateConnectionAsync()
   at YesSql.Session.SaveEntityAsync(Object entity, String collection)
   at YesSql.Session.FlushAsync()
   at YesSql.Session.FlushAsync()
   at YesSql.Services.DefaultQuery.Query`1.FirstOrDefaultImpl()
   at OrchardCore.ContentManagement.DefaultContentManager.PublishAsync(ContentItem contentItem) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore\OrchardCore.ContentManagement\DefaultContentManager.cs:line 446
   at OrchardCore.Contents.Controllers.AdminController.<CreateAndPublishPOST>b__21_0(ContentItem contentItem) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Contents\Controllers\AdminController.cs:line 379
   at OrchardCore.Contents.Controllers.AdminController.CreatePOST(String id, String returnUrl, Boolean stayOnSamePage, Func`2 conditionallyPublish) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Contents\Controllers\AdminController.cs:line 647
   at OrchardCore.Contents.Controllers.AdminController.CreateAndPublishPOST(String id, String submitPublish, String returnUrl) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Contents\Controllers\AdminController.cs:line 380
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at OrchardCore.Seo.Services.RobotsMiddleware.Invoke(HttpContext httpContext) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Seo\Services\RobotsMiddleware.cs:line 65
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at OrchardCore.Apis.GraphQL.GraphQLMiddleware.Invoke(HttpContext context, IAuthorizationService authorizationService, IAuthenticationService authenticationService, ISchemaFactory schemaService, IDocumentWriter documentWriter) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Apis.GraphQL\GraphQLMiddleware.cs:line 71
   at OrchardCore.Liquid.ScriptsMiddleware.Invoke(HttpContext httpContext) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Liquid\ScriptsMiddleware.cs:line 71
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at OrchardCore.Diagnostics.DiagnosticsStartupFilter.<>c__DisplayClass3_0.<<Configure>b__1>d.MoveNext() in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Diagnostics\DiagnosticsStartupFilter.cs:line 47
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
2023-11-30 15:33:00.4775|Default|00-b1b88e78423a2ea58b16d948a663408c-9205e418d8543f0d-00||OrchardCore.Environment.Shell.Scope.ShellScope|ERROR|Error while processing deferred task 'System.Func`2[[OrchardCore.Environment.Shell.Scope.ShellScope, OrchardCore.Abstractions, Version=1.7.0.0, Culture=neutral, PublicKeyToken=null],[System.Threading.Tasks.Task, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' on tenant 'Default'. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
 ---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
 ---> System.Net.Sockets.SocketException (104): Connection reset by peer
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.Data.SqlClient.SNI.SNITCPHandle.Receive(SNIPacket& packet, Int32 timeoutInMilliseconds)
   at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
   at Microsoft.Data.SqlClient.SqlConnection.InternalOpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at OrchardCore.Indexing.Services.IndexingTaskManager.FlushAsync(ShellScope scope, IEnumerable`1 tasks) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Indexing\IndexingTaskManager.cs:line 161
   at OrchardCore.Environment.Shell.Scope.ShellScope.<>c__DisplayClass53_0.<<BeforeDisposeAsync>b__0>d.MoveNext() in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore\OrchardCore.Abstractions\Shell\Scope\ShellScope.cs:line 443
ClientConnectionId:2e8c7b41-4478-4bfa-ae41-2962af53f17a    at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
   at Microsoft.Data.SqlClient.SqlConnection.InternalOpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at OrchardCore.Indexing.Services.IndexingTaskManager.FlushAsync(ShellScope scope, IEnumerable`1 tasks) in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore.Modules\OrchardCore.Indexing\IndexingTaskManager.cs:line 161
   at OrchardCore.Environment.Shell.Scope.ShellScope.<>c__DisplayClass53_0.<<BeforeDisposeAsync>b__0>d.MoveNext() in C:\Users\Admin\Downloads\OrchardCore-1.7.2\OrchardCore-1.7.2\src\OrchardCore\OrchardCore.Abstractions\Shell\Scope\ShellScope.cs:line 443
2023-11-30 15:33:59.9165|||50|Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository|WARN|Using an in-memory repository. Keys will not be persisted to storage. 
2023-11-30 15:34:00.0356|||59|Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager|WARN|Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits. 
2023-11-30 15:34:00.0976|||35|Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager|WARN|No XML encryptor configured. Key {5c7b205a-afd5-4f50-a099-2e790e3ed009} may be persisted to storage in unencrypted form. 
2023-11-30 15:34:00.1793|||14|Microsoft.Hosting.Lifetime|INFO|Now listening on: http://localhost:5000 
2023-11-30 15:34:00.1827||||Microsoft.Hosting.Lifetime|INFO|Application started. Press Ctrl+C to shut down. 
2023-11-30 15:34:00.1827||||Microsoft.Hosting.Lifetime|INFO|Hosting environment: Production 
2023-11-30 15:34:00.1827||||Microsoft.Hosting.Lifetime|INFO|Content root path: /var/www/aspnetcore/linu
sebastienros commented 6 months ago

We should try it locally and monitor the number of open connections. I don't think the script that was provided as repro steps is concurrent, so I would assume that the resource should be disposed on the go.

If we see something growing indefinitely then it could show there is something wrong.