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

Globalization Invariant Mode is not supported. #18025

Closed
WeihanLi opened this issue Sep 24, 2019 · 3 comments
Closed

Globalization Invariant Mode is not supported. #18025

WeihanLi opened this issue Sep 24, 2019 · 3 comments

Comments

@WeihanLi
Copy link
Contributor

Application startup exception: System.NotSupportedException: Globalization Invariant Mode is not supported.
   at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at Microsoft.Data.SqlClient.SqlConnection.Open()
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.<Exists>b__0(DateTime giveUp)
   at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0`2.<Execute>b__0(DbContext c, TState s)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, Func`2 operation, Func`2 verifySucceeded, TState state)
   at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists()
   at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.EnsureCreated()
   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated()

Additional context

Microsoft.EntityFrameworkCore.SqlServer 3.0.0
Microsoft.Data.Sqlite version: 1.0.19249.1
Target framework: (.NET Core 3.0)
Operating system: Docker Alpine

@WeihanLi
Copy link
Contributor Author

fixed with

RUN apk add icu-libs
# https://www.abhith.net/blog/docker-sql-error-on-aspnet-core-alpine/
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

more details: https://www.abhith.net/blog/docker-sql-error-on-aspnet-core-alpine/
reference sample project: https://github.com/WeihanLi/ActivityReservation

@80dB
Copy link

80dB commented Sep 25, 2019

We just ran into the same issue with a container that was converted from .NET Core v2.2 with EntityFrameworkCore v2.2.6. Now running .NET Core 3 + EFCore v3 and we get this error after deploying a container.

As such it seems something changed. For now I'll add the above fix.

@bricelam
Copy link
Contributor

Ouch, can you submit an issue on dotnet/SqlClient to see if there's anything they can do to relax this limitation? Being broken on the docker image by default sounds like a pretty bad experience.

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

No branches or pull requests

4 participants