question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SqlConnection.Open() throws System.InvalidOperationException: Internal connection fatal error on alpine

See original GitHub issue

I get the error below when connecting to a SQL Server 2008R2 using the microsoft/dotnet:2.1.0-preview2-runtime-alpine docker image, but it works fine with microsoft/dotnet:2.1.0-preview2-runtime.

System.InvalidOperationException: Internal connection fatal error.
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
[...my code..]
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
[...my code..]
Boolean TryGetConnection(System.Data.Common.DbConnection, UInt32, Boolean, Boolean, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:47 (14 by maintainers)

github_iconTop GitHub Comments

23reactions
kihamocommented, Jun 22, 2018

I have the same problem. I installed the package icu-libs and set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

Example

RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

It works for microsoft/dotnet:2.1-aspnetcore-runtime-alpine

8reactions
karelzcommented, Sep 4, 2018

@AfsanehR can you please look into how we can we make sure that:

  1. Developers do not run into the problem by default.
  2. If they run into it, the error message is descriptive enough to guide them to resolution (without further internet search, etc.).
Read more comments on GitHub >

github_iconTop Results From Across the Web

Internal connection fatal error on alpine
SqlConnection.Open() throws System.InvalidOperationException: Internal connection fatal error on alpine .NET Foundation.
Read more >
Internal Connection Fatal Error. when opening sql ...
My code keeps producing this error: System.InvalidOperationException: Internal Connection Fatal Error. at System.Data.SqlClient.
Read more >
Docker - SQL Error on ASP.NET Core Alpine
System.InvalidOperationException: Internal connection fatal error. The SQL client was having trouble in this build.
Read more >
Microsoft SQL Server 2019 Developer Edition suddenly ...
I'm finally getting back to the project, but now my program is failing with the following error: "Internal connection fatal error. Error state ......
Read more >
Internal connection fatal error connecting SQL Database
I am trying to connect to database using the PowerBI SQL Connector. The error message is: 'Internal connection fatal error. Error state: 15 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found