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

func returns "Couldn't find a valid ICU package" error on each command inside Ubuntu-20.04 docker container #2554

Closed
v1r7u opened this issue Apr 15, 2021 · 3 comments

Comments

@v1r7u
Copy link

v1r7u commented Apr 15, 2021

The context

I try to run the Azure Functions Core Tools inside VSCode Remote Container. As a base image I use ubuntu:20.04, the full dockerfile specification you can find in my repository cloud_templates.

The problem

The container build process passes without any issue, but when I try to run any func command inside I'm getting the following error:

root@fda466bd6be3:/workspaces/cloud_templates/src/az_func# func --help
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.Globalization.CultureInfo.get_InvariantCulture()
   at Newtonsoft.Json.JsonSerializerSettings..cctor()
   at Newtonsoft.Json.JsonSerializer..ctor()
   at Newtonsoft.Json.JsonSerializer.Create()
   at Newtonsoft.Json.JsonSerializer.Create(Newtonsoft.Json.JsonSerializerSettings)
   at Newtonsoft.Json.JsonSerializer.CreateDefault()
   at Newtonsoft.Json.JsonSerializer.CreateDefault(Newtonsoft.Json.JsonSerializerSettings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(System.String, System.Type, Newtonsoft.Json.JsonSerializerSettings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.String, Newtonsoft.Json.JsonSerializerSettings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.String)
   at Azure.Functions.Cli.Common.AppSettingsFile..ctor(System.String)
   at Azure.Functions.Cli.Common.SecretsManager.GetSecrets()
   at Azure.Functions.Cli.Helpers.WorkerRuntimeLanguageHelper.GetCurrentWorkerRuntimeLanguage(Azure.Functions.Cli.Interfaces.ISecretsManager)
   at Azure.Functions.Cli.Helpers.GlobalCoreToolsSettings.Init(Azure.Functions.Cli.Interfaces.ISecretsManager, System.String[])
   at Azure.Functions.Cli.ConsoleApp..ctor(System.String[], System.Reflection.Assembly, Autofac.IContainer)
   at Azure.Functions.Cli.ConsoleApp+<RunAsync>d__7`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Azure.Functions.Cli.ConsoleApp+<RunAsync>d__7`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], func, Version=3.0.3442.0, Culture=neutral, PublicKeyToken=null]](<RunAsync>d__7`1<System.__Canon> ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Azure.Functions.Cli.ConsoleApp+<RunAsync>d__7`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], func, Version=3.0.3442.0, Culture=neutral, PublicKeyToken=null]](<RunAsync>d__7`1<System.__Canon> ByRef)
   at Azure.Functions.Cli.ConsoleApp.RunAsync[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.String[], Autofac.IContainer)
   at Azure.Functions.Cli.ConsoleApp+<>c__DisplayClass6_0`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<Run>b__0()
   at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke()
   at System.Threading.Tasks.Task+<>c.<.cctor>b__274_0(System.Object)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteFromThreadPool(System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Aborted

The same installation process on my WSL2 Ubuntu-20.04 works without problems.

Steps to reproduce

In VSCode Remote Container

Clone the repository https://github.com/v1r7u/cloud_templates and open it in VSCode Remote Container

In Docker Image

  1. Build docker image in the repository docker build -t cloud-templates:test -f .devcontainer/Dockerfile .
  2. Run any func command inside the container: docker run -it --rm cloud-templates:test func --help

Do you have any ideas about what could be wrong?

@v1r7u
Copy link
Author

v1r7u commented Apr 16, 2021

My colleague helped me to find this thread dotnet/core#2186, which suggest disabling globalization via the environment variable DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true. With this env-var, everything works in a container too.

I've already pushed the change-set to the repo.

Is it a known issue? Does it make sense to update the function-core-tools installation page to mention it?

@apawast
Copy link

apawast commented Apr 21, 2021

@v1r7u no this is not a known issue, however, based on the issue descriptions a blanket statement does not seem appropriate here. There is troubleshooting guidance available for now: https://github.com/dotnet/core/blob/main/Documentation/build-and-install-rhel6-prerequisites.md#troubleshooting

@v1r7u
Copy link
Author

v1r7u commented Apr 22, 2021

@apawast, the referenced page is about old version of rhel and centos, while I try to run the tool on latest ubuntu image. At least, in my case, it was not obvious that I have to fix my func-core-tools ubuntu installation based on dotnet-app troubleshooting for centos/rhel.

a blanket statement does not seem appropriate here

I'm saying that func does not work on docker image ubuntu:20.04 and I give exact dockerfile to reproduce the issue with two terminal commands. Why is it inappropriate?

It's up to you how to maintain the documentation for your project. I wanted to offer help and spent my time describing the problem.

@ghost ghost locked as resolved and limited conversation to collaborators May 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants