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

Couldn't find a valid ICU package installed on the system. #60439

Open
Tracked by #62241
qyangaa opened this issue Aug 4, 2020 · 18 comments
Open
Tracked by #62241

Couldn't find a valid ICU package installed on the system. #60439

qyangaa opened this issue Aug 4, 2020 · 18 comments
Milestone

Comments

@qyangaa
Copy link

qyangaa commented Aug 4, 2020

Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
Operating System: linux

I followed https://github.com/dotnet/core/blob/master/Documentation/build-and-install-rhel6-prerequisites.md#troubleshooting
to install the package and change library path. But still doesn't work.

dotnet run
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.String.ToLowerInvariant()
   at System.Text.EncodingHelper.GetCharset()
   at System.Text.EncodingHelper.GetEncodingFromCharset()
   at System.ConsolePal.GetConsoleEncoding()
   at System.Console+<>c.<get_OutputEncoding>b__19_0()
   at System.Threading.LazyInitializer.EnsureInitializedCore[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Threading.LazyInitializer.EnsureInitialized[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Console.get_OutputEncoding()
   at System.Console.CreateOutputWriter(System.IO.Stream)
   at System.Console+<>c.<get_Out>b__26_0()
   at System.Threading.LazyInitializer.EnsureInitializedCore[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Threading.LazyInitializer.EnsureInitialized[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Console.get_Out()
   at System.Console.WriteLine(System.String)
   at myApp.Program.Main(System.String[])
@mairaw
Copy link
Contributor

mairaw commented Sep 7, 2020

@dagood @leecow can you help with this issue?

@dagood
Copy link
Member

dagood commented Sep 8, 2020

@tarekgh may be able to help.

@tarekgh
Copy link
Member

tarekgh commented Sep 8, 2020

@qyangaa this means the ICU library is not correctly installed on your system.

could you please send the output of the execution steps https://github.com/dotnet/core/blob/master/Documentation/build-and-install-rhel6-prerequisites.md?rgh-link-date=2020-08-04T23%3A33%3A28Z#troubleshooting?

@jmp75
Copy link
Contributor

jmp75 commented Oct 5, 2020

@tarekgh If I may; I encountered the very same problem, using Debian 11 (currently the 'testing' version). This is following installation instructions as close as possible, using "snap" as per the debian dotnet install doc. I would have preferred using debian packages but this does not yet work for Debian 11 (actually, complained about not being able to find the libicu dependency to install).

~/src/myApp$ dotnet --version
3.1.402
~/src/myApp$ which dotnet
/snap/bin/dotnet
~/src/myApp$ snap list
Name               Version    Rev   Tracking       Publisher    Notes
core               16-2.46.1  9993  latest/stable  canonical✓   core
core18             20200724   1885  latest/stable  canonical✓   base
dotnet-runtime-31  3.1.8      9     latest/stable  dotnetcore✓  -
dotnet-sdk         3.1.402    98    3.1/stable     dotnetcore✓  classic

locate libicu | grep snap shows the presence of "libicu" files such as "/snap/dotnet-sdk/98/usr/lib/x86_64-linux-gnu/libicudata.so.60". Not sure this is what we are after, or if the debian package manager.

aptitude search libicu shows that libicu-dev and libicu67 are installed, and I appear to have all the right dependencies as per the dotnet install on debian - dependencies.

FWIW ss a longtime .NET/mono developer but not active with it for a few years, I am a bit confused by the experience re-acquainting myself with the latest ecosystem.

@tarekgh
Copy link
Member

tarekgh commented Oct 5, 2020

@qyangaa @jmp75 could you please follow the issue #43052 which is tracking fixing same issue (I guess)?

@dagood
Copy link
Member

dagood commented Oct 5, 2020

#43052 is specifically about this:

I would have preferred using debian packages but this does not yet work for Debian 11 (actually, complained about not being able to find the libicu dependency to install).

The rest of the comment seems to be about an issue with the .NET Snap, which I'm not very familiar with.

@tarekgh
Copy link
Member

tarekgh commented Oct 5, 2020

The rest of the comment seems to be about an issue with the .NET Snap, which I'm not very familiar with.

Do you know who can help with it?

CC @safern

@jmp75
Copy link
Contributor

jmp75 commented Oct 6, 2020

I got an installation working with the ICU working after noticing that reply and prior discussions. I thought at first read what was referred to was compilation from source but this is not and much simpler a process, so may be worth expanding here. This refers to the Manual Install option.

Steps:

Downloading the "Binaries" tarball for the SDK x64 of .NET core 3.1
tar zxf dotnet-sdk-3.1.402-linux-x64.tar.gz -C "$HOME/dotnet"

nano ~/.bashrc then adding

export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

All seem to work well this way, dotnet run or direct binary invocation. I am actually unclear as to exactly why the 'missing ICU' goes away installing this way, but will take it as is.

@dagood
Copy link
Member

dagood commented Oct 6, 2020

I am actually unclear as to exactly why the 'missing ICU' goes away installing this way

As long as you have some version of the libicu binaries installed (from version 50 to 255 currently), .NET Core will find it and use it. The Debian package is just more restrictive because it has a list of specific package dependencies rather than a numeric range.

@xiangzhai
Copy link
Contributor

:mips-interest

@xiangzhai
Copy link
Contributor

xiangzhai commented Jan 18, 2021

Hi @qyangaa

export CLR_ICU_VERSION_OVERRIDE="50.2"

If your RHEL icu version is 50.2, it is able to run yum info icu for double check the version.

We met the similar issue when porting to MIPS64. Fixed in 5.0.0.

Thanks,
Leslie Zhai

Viir referenced this issue in pine-vm/pine Jun 16, 2021
Viir referenced this issue in pine-vm/pine Jun 16, 2021
Fix the `ICU package` error discovered in c2f034b

Work around the issue described at dotnet/core#2186 and https://github.com/dotnet/core/issues/5019

Integrate the fix shared by @petrsvihlik at dotnet/core#2186 (comment)
@mairaw mairaw transferred this issue from dotnet/core Oct 14, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Globalization untriaged New issue has not been triaged by the area owner labels Oct 14, 2021
@ghost
Copy link

ghost commented Oct 14, 2021

Tagging subscribers to this area: @tarekgh, @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
Operating System: linux

I followed https://github.com/dotnet/core/blob/master/Documentation/build-and-install-rhel6-prerequisites.md#troubleshooting
to install the package and change library path. But still doesn't work.

dotnet run
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
   at System.Globalization.GlobalizationMode..cctor()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.String.ToLowerInvariant()
   at System.Text.EncodingHelper.GetCharset()
   at System.Text.EncodingHelper.GetEncodingFromCharset()
   at System.ConsolePal.GetConsoleEncoding()
   at System.Console+<>c.<get_OutputEncoding>b__19_0()
   at System.Threading.LazyInitializer.EnsureInitializedCore[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Threading.LazyInitializer.EnsureInitialized[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Console.get_OutputEncoding()
   at System.Console.CreateOutputWriter(System.IO.Stream)
   at System.Console+<>c.<get_Out>b__26_0()
   at System.Threading.LazyInitializer.EnsureInitializedCore[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Threading.LazyInitializer.EnsureInitialized[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Object ByRef, System.Func`1<System.__Canon>)
   at System.Console.get_Out()
   at System.Console.WriteLine(System.String)
   at myApp.Program.Main(System.String[])
Author: qyangaa
Assignees: -
Labels:

area-System.Globalization, untriaged

Milestone: -

@tarekgh
Copy link
Member

tarekgh commented Oct 14, 2021

@safern I recall we have another issue tracking same snap problem. right?

@safern
Copy link
Member

safern commented Oct 15, 2021

Yes we had this one: #54148 but it was closed as snap wasn't in our priorities (accordingly to the last message). cc: @NikolaMilosavljevic

@NikolaMilosavljevic NikolaMilosavljevic removed the untriaged New issue has not been triaged by the area owner label Dec 8, 2021
@daxxog
Copy link

daxxog commented Apr 17, 2022

Hi @qyangaa

export CLR_ICU_VERSION_OVERRIDE="50.2"

If your RHEL icu version is 50.2, it is able to run yum info icu for double check the version.

We met the similar issue when porting to MIPS64. Fixed in 5.0.0.

Thanks, Leslie Zhai

I had something similar happen to me on Archlinux, when the icu package was recently updated: https://github.com/archlinux/svntogit-packages/tree/36f4025b3bb8b0832b7ad452afe6bd605e894158/trunk

I did something like:
export CLR_ICU_VERSION_OVERRIDE=$(pacman -Q icu | awk '{split($0,a," ");print a[2]}' | awk '{split($0,a,"-");print a[1]}')
to fix.

Thanks for the tip!

@WildReiserUE
Copy link

Hi @qyangaa

export CLR_ICU_VERSION_OVERRIDE="50.2"

If your RHEL icu version is 50.2, it is able to run yum info icu for double check the version.
We met the similar issue when porting to MIPS64. Fixed in 5.0.0.
Thanks, Leslie Zhai

I had something similar happen to me on Archlinux, when the icu package was recently updated: https://github.com/archlinux/svntogit-packages/tree/36f4025b3bb8b0832b7ad452afe6bd605e894158/trunk

I did something like: export CLR_ICU_VERSION_OVERRIDE=$(pacman -Q icu | awk '{split($0,a," ");print a[2]}' | awk '{split($0,a,"-");print a[1]}') to fix.

Thanks for the tip!

This work for me! THX!!! But this has to be done before each call to the ICU. It feels like it's being overwritten by something.

@nfp0
Copy link

nfp0 commented Jul 18, 2023

Hi @qyangaa

export CLR_ICU_VERSION_OVERRIDE="50.2"

If your RHEL icu version is 50.2, it is able to run yum info icu for double check the version.
We met the similar issue when porting to MIPS64. Fixed in 5.0.0.
Thanks, Leslie Zhai

I had something similar happen to me on Archlinux, when the icu package was recently updated: https://github.com/archlinux/svntogit-packages/tree/36f4025b3bb8b0832b7ad452afe6bd605e894158/trunk

I did something like: export CLR_ICU_VERSION_OVERRIDE=$(pacman -Q icu | awk '{split($0,a," ");print a[2]}' | awk '{split($0,a,"-");print a[1]}') to fix.

Thanks for the tip!

@daxxog This worked for me. Thanks!
I'm still being affected by this issue today on Arch. So, in our case, the root cause is on the Arch package?
Is there an issue open for it?

SommerEngineering added a commit to SommerEngineering/AI-Studio that referenced this issue Jun 8, 2024
@bernardbr
Copy link

Hi @qyangaa

export CLR_ICU_VERSION_OVERRIDE="50.2"

If your RHEL icu version is 50.2, it is able to run yum info icu for double check the version.
We met the similar issue when porting to MIPS64. Fixed in 5.0.0.
Thanks, Leslie Zhai

I had something similar happen to me on Archlinux, when the icu package was recently updated: https://github.com/archlinux/svntogit-packages/tree/36f4025b3bb8b0832b7ad452afe6bd605e894158/trunk

I did something like: export CLR_ICU_VERSION_OVERRIDE=$(pacman -Q icu | awk '{split($0,a," ");print a[2]}' | awk '{split($0,a,"-");print a[1]}') to fix.

Thanks for the tip!

Thank you!

For the Ubuntu, you can do the same:

export CLR_ICU_VERSION_OVERRIDE=$(dpkg -s libicu-dev | grep '^Version:' | awk '{split($2,a,"-"); print a[1]}')

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