Nfactor26 / pixel-identity

Bootstrapper for https://github.com/openiddict/openiddict-core and Asp.net Identity with a blazor based UI .
https://nfactor26.github.io/pixel-identity/
MIT License
157 stars 31 forks source link

Running in Docker using SQL Server fails to start with .Net 8 #115

Open MarkLFT opened 1 month ago

MarkLFT commented 1 month ago

Starting the Docker image throws an error when starting. The error is a result of a known problem with .Net 8 and the change of behaviour where the SQL Client runs by default with globalization-invariant defaulting to true.

This causes a

System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode.

error to be thrown.

If you use the environment variable to change the setting to false.

DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

The error changes to:

Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information.

Either way, I am unable to start the Docker container if using SQL Server.

Has anyone else come across this situation, and if so, how did you resolve it?

Nfactor26 commented 1 month ago

Please share more details on the SQL Server container that you are using. Does the pixel-identity container stop when working with SQL Server ? If you have a compose file that can mimic your exact setup, that would be great for a repro.

On Fri, 25 Oct, 2024, 1:39 pm Mark Townsend, @.***> wrote:

Starting the Docker image throws an error when starting. The error is a result of a known problem with .Net 8 and the change of behaviour where the SQL Client runs by default with globalization-invariant defaulting to true.

This causes a

System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode.

error to be thrown.

If you use the environment variable to change the setting to false.

DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

The error changes to:

Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information.

Either way, I am unable to start the Docker container if using SQL Server.

Has anyone else come across this situation, and if so, how did you resolve it?

— Reply to this email directly, view it on GitHub https://github.com/Nfactor26/pixel-identity/issues/115, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTYE62Q24AZMHD23RG2H63Z5H4EHAVCNFSM6AAAAABQSXCFCSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYTGNBQGI3TIMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MarkLFT commented 1 month ago

We are using a separate sql server, not a containerised copy.

It is sql server 2019 standard edition, running on a Windows server.

If you check on the Web you will see this is a well documented, breaking change, in .net 8 problem. Here is a fix.

https://medium.com/@dotnetsanjay/net-core-8-system-globalization-culturenotfoundexception-15d005b7f665

Nfactor26 commented 4 weeks ago

I don't have a solution yet. I tried setting false as suggested in the shared link and built a new docker image locally. However, still getting the same issue. I will have to investigate this further. Most probably this will require a base image with dependencies or I will have to install them during the build process.