pixel-identity icon indicating copy to clipboard operation
pixel-identity copied to clipboard

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

Open MarkLFT opened this issue 1 year ago • 3 comments
trafficstars

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?

MarkLFT avatar Oct 25 '24 08:10 MarkLFT

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: @.***>

Nfactor26 avatar Oct 26 '24 05:10 Nfactor26

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

MarkLFT avatar Oct 26 '24 08:10 MarkLFT

I don't have a solution yet. I tried setting <InvariantGlobalization>false</InvariantGlobalization> 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.

Nfactor26 avatar Oct 28 '24 18:10 Nfactor26