Efcore: abnormal when aspnet core 3.0 pack docker image read SQL Server 11.0.6020.0

Created on 16 Oct 2019  Â·  13Comments  Â·  Source: dotnet/efcore

hi, when i run it on console to query database, every thing is ok.
but when build it as a image and run it, it can't work.
the message like this:

[10-16 09:11:44] info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
Route matched with {action = "UpdateBYApp", controller = "App", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] UpdateBYApp(ESLV3.Model.App.InApp, ESLV3.Service.Abstractions.IMPSService) on controller ESLV3.Controllers.AppController (ESLV3).
[10-16 09:11:44] info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[1]
Executing action method ESLV3.Controllers.AppController.UpdateBYApp (ESLV3) - Validation state: Valid
[10-16 09:11:45] info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 3.0.0 initialized 'EslContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None

and then that is no more message.
CPU usage is 100%, it seen infinite loop.
cpu

But When I Use SQL Server 13.0.4001.0.EveryThing is Ok.

Additional context

Microsoft.Data.Sqlite version:
.NET Core 3.0
Microsoft.EntityFrameworkCore 3.0
Microsoft.Data.SqlClient (>= 1.0.19249.1)

closed-external customer-reported

Most helpful comment

We looked through this in triage and we don't believe that there is anything EF-specific here. If that isn't the case, then please post a repro that fails when EF attempts to connect, but works when the connection is from SqlClient (ADO.NET) directly.

All 13 comments

I get the exact same thing.. works in 2.2 :(

@moxixuan A few questions:

  • Why did you file this as a SQLite issue?
  • If the docker image the same in both cases? I.e. with the same image connecting to an external SQL Server 13.x works, but connecting to an external 11.x fails?
  • Where is the docker image obtained from or how is it built?
  • What OS/version is being run in the container?

@moxixuan A few questions:

* Why did you file this as a SQLite issue?

* If the docker image the same in both cases? I.e. with the same image connecting to an external SQL Server 13.x works, but connecting to an external 11.x fails?

* Where is the docker image obtained from or how is it built?

* What OS/version is being run in the container?

thank you for your response.

  • In fact, I'm not sure this as a SQLite issus.

  • yeah the docker image the save in both cases, with the same image connecting to an external SQL Server 13.x works, but connecting to an external 11.x fails.

  • the docker image obtained from docker file

`FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["WebApplication4.csproj", ""]
RUN dotnet restore "./WebApplication4.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "WebApplication4.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WebApplication4.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebApplication4.dll"]`

  • the container OS/version

cpu

Maybe you need to update the server for TLS support? https://support.microsoft.com/da-dk/help/3135244/tls-1-2-support-for-microsoft-sql-server

thank you for your response.
It's a production database. So, I need to apply to update my server for TLS support. But build a other server is feasible

Running into the same problem using the _mcr.microsoft.com/dotnet/core/aspnet:3.0_ with the EF Core 3.0.0 nuget package.
The container is at 100% CPU usage and seem to hang.
The database is a clustered MS SQL Server.

Further observations:

  • Using a compareable not clustered MS SQL Server works fine as well. (on another server with most certainly different firewall rules -> might be a connection issue as well)
  • The same database server is is no problem for the running EF Core with a dotnet 2.2 image.
  • Running the aspnet application (dotnet 3.0 and the 3.0.0 nuget package) in development using the same database is not an issue and works as expected.

Took a trace in --format Speedscope with the dotnet-trace tool.
Stacktrace for the hang in the following Image:

UNMANAGED_CODE_TIME
System.Net.Sockets!System.Net.Sockets.SocketPal.Receive(class System.Net.Sockets.SafeSocketHandle,value class System.Net.Sockets.SocketFlags,value class System.Span1<unsigned int8>,unsigned int8[],int32&,value class System.Net.Sockets.SocketFlags&,value class Error&) System.Net.Sockets!System.Net.Sockets.SocketPal.TryCompleteReceiveFrom(class System.Net.Sockets.SafeSocketHandle,value class System.Span1,class System.Collections.Generic.IList1<value class System.ArraySegment1>,value class System.Net.Sockets.SocketFlags,unsigned int8[],int32&,int32&,value class System.Net.Sockets.SocketFlags&,value class System.Net.Sockets.SocketError&)
System.Net.Sockets!System.Net.Sockets.SocketAsyncContext.ReceiveFrom(value class System.Memory1<unsigned int8>,value class System.Net.Sockets.SocketFlags&,unsigned int8[],int32&,int32,int32&) System.Net.Sockets!System.Net.Sockets.SocketPal.Receive(class System.Net.Sockets.SafeSocketHandle,unsigned int8[],int32,int32,value class System.Net.Sockets.SocketFlags,int32&) System.Net.Sockets!System.Net.Sockets.Socket.Receive(unsigned int8[],int32,int32,value class System.Net.Sockets.SocketFlags,value class System.Net.Sockets.SocketError&) System.Net.Sockets!System.Net.Sockets.NetworkStream.Read(unsigned int8[],int32,int32) Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SslOverTdsStream+<ReadInternal>d__11.MoveNext() System.Private.CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(!!0&) System.Private.CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[System.Int32].Start(!!0&)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SslOverTdsStream.ReadInternal(unsigned int8[],int32,int32,value class System.Threading.CancellationToken,bool)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SslOverTdsStream.Read(unsigned int8[],int32,int32)
System.Net.Security!System.Net.FixedSizeReader.ReadPacket(class System.IO.Stream,unsigned int8[],int32,int32)
System.Net.Security!System.Net.Security.SslStream.StartReceiveBlob(unsigned int8[],class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.CheckCompletionBeforeNextReceive(class System.Net.Security.ProtocolToken,class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.StartSendBlob(unsigned int8[],int32,class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.ForceAuthentication(bool,unsigned int8[],class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.ProcessAuthentication(class System.Net.LazyAsyncResult,value class System.Threading.CancellationToken)
System.Net.Security!System.Net.Security.SslStream.AuthenticateAsClient(class System.Net.Security.SslClientAuthenticationOptions)
System.Net.Security!System.Net.Security.SslStream.AuthenticateAsClient(class System.String,class System.Security.Cryptography.X509Certificates.X509CertificateCollection,value class System.Security.Authentication.SslProtocols,bool)
System.Net.Security!System.Net.Security.SslStream.AuthenticateAsClient(class System.String)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SNITCPHandle.EnableSsl(unsigned int32)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SNIProxy.EnableSsl(class Microsoft.Data.SqlClient.SNI.SNIHandle,unsigned int32)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.TdsParserStateObjectManaged.EnableSsl(unsigned int32&)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(bool,bool,bool,bool&,bool&)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.TdsParser.Connect(class Microsoft.Data.SqlClient.ServerInfo,class Microsoft.Data.SqlClient.SqlInternalConnectionTds,bool,int64,bool,bool,bool,bool,value class Microsoft.Data.SqlClient.SqlAuthenticationMethod,class Microsoft.Data.SqlClient.SqlAuthenticationProviderManager)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(class Microsoft.Data.SqlClient.ServerInfo,class System.String,class System.Security.SecureString,bool,class Microsoft.Data.ProviderBase.TimeoutTimer,bool)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(class Microsoft.Data.SqlClient.ServerInfo,class System.String,class System.Security.SecureString,bool,class Microsoft.Data.SqlClient.SqlConnectionString,class Microsoft.Data.SqlClient.SqlCredential,class Microsoft.Data.ProviderBase.TimeoutTimer)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(class Microsoft.Data.ProviderBase.TimeoutTimer,class Microsoft.Data.SqlClient.SqlConnectionString,class Microsoft.Data.SqlClient.SqlCredential,class System.String,class System.Security.SecureString,bool)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(class Microsoft.Data.ProviderBase.DbConnectionPoolIdentity,class Microsoft.Data.SqlClient.SqlConnectionString,class Microsoft.Data.SqlClient.SqlCredential,class System.Object,class System.String,class System.Security.SecureString,bool,class Microsoft.Data.SqlClient.SqlConnectionString,class Microsoft.Data.SqlClient.SessionData,bool,class System.String,class Microsoft.Data.ProviderBase.DbConnectionPool,class Microsoft.Data.SqlClient.SqlAuthenticationProviderManager)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(class Microsoft.Data.Common.DbConnectionOptions,class Microsoft.Data.Common.DbConnectionPoolKey,class System.Object,class Microsoft.Data.ProviderBase.DbConnectionPool,class System.Data.Common.DbConnection,class Microsoft.Data.Common.DbConnectionOptions)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(class Microsoft.Data.ProviderBase.DbConnectionPool,class System.Data.Common.DbConnection,class Microsoft.Data.Common.DbConnectionOptions,class Microsoft.Data.Common.DbConnectionPoolKey,class Microsoft.Data.Common.DbConnectionOptions)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(class System.Data.Common.DbConnection,class Microsoft.Data.Common.DbConnectionOptions,class Microsoft.Data.ProviderBase.DbConnectionInternal)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(class System.Data.Common.DbConnection,class Microsoft.Data.Common.DbConnectionOptions,class Microsoft.Data.ProviderBase.DbConnectionInternal)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(class System.Data.Common.DbConnection,unsigned int32,bool,bool,class Microsoft.Data.Common.DbConnectionOptions,class Microsoft.Data.ProviderBase.DbConnectionInternal&)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(class System.Data.Common.DbConnection,class System.Threading.Tasks.TaskCompletionSource1<class Microsoft.Data.ProviderBase.DbConnectionInternal>,class Microsoft.Data.Common.DbConnectionOptions,class Microsoft.Data.ProviderBase.DbConnectionInternal&) Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(class System.Data.Common.DbConnection,class System.Threading.Tasks.TaskCompletionSource1,class Microsoft.Data.Common.DbConnectionOptions,class Microsoft.Data.ProviderBase.DbConnectionInternal,class Microsoft.Data.ProviderBase.DbConnectionInternal&)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(class System.Data.Common.DbConnection,class Microsoft.Data.ProviderBase.DbConnectionFactory,class System.Threading.Tasks.TaskCompletionSource1<class Microsoft.Data.ProviderBase.DbConnectionInternal>,class Microsoft.Data.Common.DbConnectionOptions) Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(class System.Data.Common.DbConnection,class Microsoft.Data.ProviderBase.DbConnectionFactory,class System.Threading.Tasks.TaskCompletionSource1,class Microsoft.Data.Common.DbConnectionOptions)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlConnection.TryOpen(class System.Threading.Tasks.TaskCompletionSource1<class Microsoft.Data.ProviderBase.DbConnectionInternal>) Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlConnection.Open() Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(bool) Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(bool) Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator+<>c__DisplayClass18_0.<Exists>b__0(value class System.DateTime) Microsoft.EntityFrameworkCore!Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions+<>c__DisplayClass12_02[System.DateTime,System.Boolean].b__0(class Microsoft.EntityFrameworkCore.DbContext,!0)
Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute(!!0,class System.Func3<class Microsoft.EntityFrameworkCore.DbContext,!!0,!!1>,class System.Func31<!!1>>) Microsoft.EntityFrameworkCore!Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute(class Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy,class System.Func2,class System.Func2<!!0,class Microsoft.EntityFrameworkCore.Storage.ExecutionResult1>,!!0)
Microsoft.EntityFrameworkCore!Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute(class Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy,!!0,class System.Func`2)
Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(bool)
Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists()
Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(class System.String)
Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(class Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade)
Program.Main(class System.String[])
Thread (1)
Threads
(Non-Activities)
Process64 Process(1) (1) Args:

The Trace looks like this in https://www.speedscope.app/. If needed a can take a smaller trace and upload it as well.

speedscope_trace

Hope it helps. Keep up the good work!

I just made an observation that the Alpine image with icu-libs seems to be
able to connect, while Buster does not. Can anyone else test that?

tor. 17. okt. 2019 23.02 skrev edubsi notifications@github.com:

Running into the same problem using the mcr.microsoft.com/dotnet/core/aspnet:3.0
http://mcr.microsoft.com/dotnet/core/aspnet:3.0
with the EF Core 3.0.0
nuget package.
The container is at 100% CPU usage and seem to hang.
The database is a clustered MS SQL Server.

Further observations:
The same database server is is no problem for the running EF Core with a
dotnet 2.2 image.

Running the aspnet application (dotnet 3.0 and the 3.0.0 nuget package) in
development using the same database is not an issue and works as expected.

Took a trace in --format Speedscope with the dotnet-trace tool.
Stacktrace for the hang in the following Image:

UNMANAGED_CODE_TIME
System.Net.Sockets!System.Net.Sockets.SocketPal.Receive(class
System.Net.Sockets.SafeSocketHandle,value class
System.Net.Sockets.SocketFlags,value class System.Span1 int8>,unsigned int8[],int32&,value class
System.Net.Sockets.SocketFlags&,value class Error&)
System.Net.Sockets!System.Net.Sockets.SocketPal.TryCompleteReceiveFrom(class
System.Net.Sockets.SafeSocketHandle,value class System.Span1,class
System.Collections.Generic.IList1,value
class System.Net.Sockets.SocketFlags,unsigned int8[],int32&,int32&,value
class System.Net.Sockets.SocketFlags&,value class
System.Net.Sockets.SocketError&)
System.Net.Sockets!System.Net.Sockets.SocketAsyncContext.ReceiveFrom(value
class System.Memory1,value class
System.Net.Sockets.SocketFlags&,unsigned int8[],int32&,int32,int32&)
System.Net.Sockets!System.Net.Sockets.SocketPal.Receive(class
System.Net.Sockets.SafeSocketHandle,unsigned int8[],int32,int32,value class
System.Net.Sockets.SocketFlags,int32&)
System.Net.Sockets!System.Net.Sockets.Socket.Receive(unsigned
int8[],int32,int32,value class System.Net.Sockets.SocketFlags,value class
System.Net.Sockets.SocketError&)
System.Net.Sockets!System.Net.Sockets.NetworkStream.Read(unsigned
int8[],int32,int32)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SslOverTdsStream+d__11.MoveNext()
System.Private.CoreLib!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(!!0&)
System.Private.CoreLib!System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1[System.Int32].Start(!!0&)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SslOverTdsStream.ReadInternal(unsigned
int8[],int32,int32,value class System.Threading.CancellationToken,bool)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SslOverTdsStream.Read(unsigned
int8[],int32,int32)
System.Net.Security!System.Net.FixedSizeReader.ReadPacket(class
System.IO.Stream,unsigned int8[],int32,int32)
System.Net.Security!System.Net.Security.SslStream.StartReceiveBlob(unsigned
int8[],class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.CheckCompletionBeforeNextReceive(class
System.Net.Security.ProtocolToken,class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.StartSendBlob(unsigned
int8[],int32,class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.ForceAuthentication(bool,unsigned
int8[],class System.Net.AsyncProtocolRequest)
System.Net.Security!System.Net.Security.SslStream.ProcessAuthentication(class
System.Net.LazyAsyncResult,value class System.Threading.CancellationToken)
System.Net.Security!System.Net.Security.SslStream.AuthenticateAsClient(class
System.Net.Security.SslClientAuthenticationOptions)
System.Net.Security!System.Net.Security.SslStream.AuthenticateAsClient(class
System.String,class
System.Security.Cryptography.X509Certificates.X509CertificateCollection,value
class System.Security.Authentication.SslProtocols,bool)
System.Net.Security!System.Net.Security.SslStream.AuthenticateAsClient(class
System.String)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SNITCPHandle.EnableSsl(unsigned
int32)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.SNIProxy.EnableSsl(class
Microsoft.Data.SqlClient.SNI.SNIHandle,unsigned int32)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SNI.TdsParserStateObjectManaged.EnableSsl(unsigned
int32&)

Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(bool,bool,bool,bool&,bool&)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.TdsParser.Connect(class
Microsoft.Data.SqlClient.ServerInfo,class
Microsoft.Data.SqlClient.SqlInternalConnectionTds,bool,int64,bool,bool,bool,bool,value
class Microsoft.Data.SqlClient.SqlAuthenticationMethod,class
Microsoft.Data.SqlClient.SqlAuthenticationProviderManager)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(class
Microsoft.Data.SqlClient.ServerInfo,class System.String,class
System.Security.SecureString,bool,class
Microsoft.Data.ProviderBase.TimeoutTimer,bool)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(class
Microsoft.Data.SqlClient.ServerInfo,class System.String,class
System.Security.SecureString,bool,class
Microsoft.Data.SqlClient.SqlConnectionString,class
Microsoft.Data.SqlClient.SqlCredential,class
Microsoft.Data.ProviderBase.TimeoutTimer)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(class
Microsoft.Data.ProviderBase.TimeoutTimer,class
Microsoft.Data.SqlClient.SqlConnectionString,class
Microsoft.Data.SqlClient.SqlCredential,class System.String,class
System.Security.SecureString,bool)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(class
Microsoft.Data.ProviderBase.DbConnectionPoolIdentity,class
Microsoft.Data.SqlClient.SqlConnectionString,class
Microsoft.Data.SqlClient.SqlCredential,class System.Object,class
System.String,class System.Security.SecureString,bool,class
Microsoft.Data.SqlClient.SqlConnectionString,class
Microsoft.Data.SqlClient.SessionData,bool,class System.String,class
Microsoft.Data.ProviderBase.DbConnectionPool,class
Microsoft.Data.SqlClient.SqlAuthenticationProviderManager)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(class
Microsoft.Data.Common.DbConnectionOptions,class
Microsoft.Data.Common.DbConnectionPoolKey,class System.Object,class
Microsoft.Data.ProviderBase.DbConnectionPool,class
System.Data.Common.DbConnection,class
Microsoft.Data.Common.DbConnectionOptions)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(class
Microsoft.Data.ProviderBase.DbConnectionPool,class
System.Data.Common.DbConnection,class
Microsoft.Data.Common.DbConnectionOptions,class
Microsoft.Data.Common.DbConnectionPoolKey,class
Microsoft.Data.Common.DbConnectionOptions)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(class
System.Data.Common.DbConnection,class
Microsoft.Data.Common.DbConnectionOptions,class
Microsoft.Data.ProviderBase.DbConnectionInternal)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(class
System.Data.Common.DbConnection,class
Microsoft.Data.Common.DbConnectionOptions,class
Microsoft.Data.ProviderBase.DbConnectionInternal)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(class
System.Data.Common.DbConnection,unsigned int32,bool,bool,class
Microsoft.Data.Common.DbConnectionOptions,class
Microsoft.Data.ProviderBase.DbConnectionInternal&)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(class
System.Data.Common.DbConnection,class
System.Threading.Tasks.TaskCompletionSource1 Microsoft.Data.ProviderBase.DbConnectionInternal>,class
Microsoft.Data.Common.DbConnectionOptions,class
Microsoft.Data.ProviderBase.DbConnectionInternal&)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(class
System.Data.Common.DbConnection,class
System.Threading.Tasks.TaskCompletionSource1,class
Microsoft.Data.Common.DbConnectionOptions,class
Microsoft.Data.ProviderBase.DbConnectionInternal,class
Microsoft.Data.ProviderBase.DbConnectionInternal&)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(class
System.Data.Common.DbConnection,class
Microsoft.Data.ProviderBase.DbConnectionFactory,class
System.Threading.Tasks.TaskCompletionSource1 Microsoft.Data.ProviderBase.DbConnectionInternal>,class
Microsoft.Data.Common.DbConnectionOptions)
Microsoft.Data.SqlClient!Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(class
System.Data.Common.DbConnection,class
Microsoft.Data.ProviderBase.DbConnectionFactory,class
System.Threading.Tasks.TaskCompletionSource1,class
Microsoft.Data.Common.DbConnectionOptions)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlConnection.TryOpen(class
System.Threading.Tasks.TaskCompletionSource1 Microsoft.Data.ProviderBase.DbConnectionInternal>)
Microsoft.Data.SqlClient!Microsoft.Data.SqlClient.SqlConnection.Open()
Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(bool)
Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(bool)
Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator+<>c__DisplayClass18_0.b__0(value
class System.DateTime)
Microsoft.EntityFrameworkCore!Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions+<>c__DisplayClass12_02[System.DateTime,System.Boolean].b__0(class
Microsoft.EntityFrameworkCore.DbContext,!0)
Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute(!!0,class
System.Func3,class
System.Func3 Microsoft.EntityFrameworkCore.Storage.ExecutionResult1>)
Microsoft.EntityFrameworkCore!Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute(class
Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy,class System.Func2,class
System.Func2 Microsoft.EntityFrameworkCore.Storage.ExecutionResult1>,!!0)
Microsoft.EntityFrameworkCore!Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute(class
Microsoft.EntityFrameworkCore.Storage.IExecutionStrategy,!!0,class
System.Func`2)

Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(bool)

Microsoft.EntityFrameworkCore.SqlServer!Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists()

Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(class
System.String)
Microsoft.EntityFrameworkCore.Relational!Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(class
Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade)
Program.Main(class System.String[])
Thread (1)
Threads
(Non-Activities)
Process64 Process(1) (1) Args:

The Trace looks like this in https://www.speedscope.app/. If needed a can
take a smaller trace and upload it as well.

[image: speedscope_trace]
https://user-images.githubusercontent.com/2777318/67046161-ffdde580-f12f-11e9-9293-b2250dcc2b1b.png

Hope it helps. Keep up the good work!

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/EntityFrameworkCore/issues/18395?email_source=notifications&email_token=AAA7FVI6TXDKLYTESKE3YQDQPDHB7A5CNFSM4JBIUTBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRQHKQ#issuecomment-543359914,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAA7FVOZJCOO2L6FYZQFX2LQPDHB7ANCNFSM4JBIUTBA
.

I can confirm that the alpine image (mcr.microsoft.com/dotnet/core/aspnet:3.0-alpine) does not have the issue with the infinite loop/100% cpu usage.
I get an error while connecting but that should be fixable on my side.

An error occurred while migrating or initializing the database.
System.NotSupportedException: Globalization Invariant Mode is not supported.

Edit: Yep that's why you need the icu-libs i guess. Works fine after adding them

We looked through this in triage and we don't believe that there is anything EF-specific here. If that isn't the case, then please post a repro that fails when EF attempts to connect, but works when the connection is from SqlClient (ADO.NET) directly.

I think you are right, this is not EF specific.
I think there are actually already several issues in the dotnet/sqlclient repository, where i'm not sure if they are the exact same issue. Will look into it monday, and post a new issue there if the existing issues are not enough.

thank you so much, I will close it if this is not EF specific.

Was this page helpful?
0 / 5 - 0 ratings