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." when trying to run a deployment with bicep #165

Closed
rubenmamo opened this issue Sep 3, 2024 · 7 comments
Assignees
Labels
P1 Some scenario broken but workaround exists

Comments

@rubenmamo
Copy link

rubenmamo commented Sep 3, 2024

I have the following github workflow

      - name: Login to Azure
        uses: azure/login@v2
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS_PRENV }}

      - name: Create Resource Group
        uses: azure/CLI@v2
        with:
          azcliversion: latest
          inlineScript: |
            az group create --name rg-company-${{ env.target_env }} --location "West Europe"

      - name: Deploy Stage 1
        uses: azure/CLI@v2
        with:
          azcliversion: latest
          inlineScript: |
            az deployment group create --resource-group rg-company-${{ env.target_env }} --template-file ./infra/Stage1/stage-1.bicep --parameters deploymentTag='${{ env.target_env }}'

this was working without issues, however, today I started getting the following error in the Deploy Stage 1 step:

Run azure/CLI@v2
Warning: Unable to fetch all az cli versions, please report it as an issue on https://github.com/Azure/CLI/issues. Output: ***
Starting script execution via docker image mcr.microsoft.com/azure-cli:latest
WARNING: The configuration value of bicep.use_binary_from_path has been set to 'false'.
ERROR: 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.
   at System.Environment.FailFast(System.String)
   at System.Globalization.GlobalizationMode+Settings..cctor()
   at System.Globalization.GlobalizationMode+Settings.get_Invariant()
   at System.Globalization.GlobalizationMode.get_Invariant()
   at System.Globalization.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.CultureInfo..cctor()
   at System.Globalization.CultureInfo.get_InvariantCulture()
   at System.Globalization.NumberFormatInfo.get_InvariantInfo()
   at System.Reflection.AssemblyNameParser.ParseVersion(System.String)
   at System.Reflection.AssemblyNameParser.Parse()
   at System.Reflection.AssemblyNameParser.Parse(System.String)
   at System.Reflection.AssemblyName..ctor(System.String)
   at System.Reflection.TypeNameParser.ResolveAssembly(System.String)
   at System.Reflection.TypeNameParser.GetType(System.String, System.ReadOnlySpan`1<System.String>, System.String)
   at System.Reflection.TypeNameParser+NamespaceTypeName.ResolveType(System.Reflection.TypeNameParser ByRef, System.String)
   at System.Reflection.TypeNameParser.Parse()
   at System.Reflection.TypeNameParser.GetTypeReferencedByCustomAttribute(System.String, System.Reflection.RuntimeModule)
   at System.Reflection.CustomAttributeTypedArgument.ResolveType(System.Reflection.RuntimeModule, System.String)
   at System.Reflection.CustomAttributeTypedArgument..ctor(System.Reflection.RuntimeModule, System.Reflection.CustomAttributeEncodedArgument)
   at System.Reflection.RuntimeCustomAttributeData.get_ConstructorArguments()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetDynamicallyAccessedMemberTypes(System.Type)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.ValidateTrimmingAnnotations(System.Type, System.Type[], System.Type, System.Type[])
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.Populate()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory..ctor(System.Collections.Generic.ICollection`1<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(System.Collections.Generic.ICollection`1<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, Microsoft.Extensions.DependencyInjection.ServiceProviderOptions)
   at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection, Microsoft.Extensions.DependencyInjection.ServiceProviderOptions)
   at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)
   at Microsoft.Extensions.Logging.LoggerFactory.Create(System.Action`1<Microsoft.Extensions.Logging.ILoggingBuilder>)
   at Bicep.Cli.Program.CreateLoggerFactory(Bicep.Cli.IOContext)
   at Bicep.Cli.Program.ConfigureServices(Bicep.Cli.IOContext)
   at Bicep.Cli.Program..ctor(Bicep.Cli.IOContext, System.Action`1<Microsoft.Extensions.DependencyInjection.IServiceCollection>)
   at Bicep.Cli.Program+<>c__DisplayClass3_0+<<Main>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Bicep.Cli.Program+<>c__DisplayClass3_0+<<Main>b__0>d, bicep, Version=0.29.0.0, Culture=neutral, PublicKeyToken=null]](<<Main>b__0>d ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Bicep.Cli.Program+<>c__DisplayClass3_0+<<Main>b__0>d, bicep, Version=0.29.0.0, Culture=neutral, PublicKeyToken=null]](<<Main>b__0>d ByRef)
   at Bicep.Cli.Program+<>c__DisplayClass3_0.<Main>b__0(System.Threading.CancellationToken)
   at Bicep.Cli.Program+<RunWithCancellationAsync>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Bicep.Cli.Program+<RunWithCancellationAsync>d__6, bicep, Version=0.29.0.0, Culture=neutral, PublicKeyToken=null]](<RunWithCancellationAsync>d__6 ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Bicep.Cli.Program+<RunWithCancellationAsync>d__6, bicep, Version=0.29.0.0, Culture=neutral, PublicKeyToken=null]](<RunWithCancellationAsync>d__6 ByRef)
   at Bicep.Cli.Program.RunWithCancellationAsync(System.Func`2<System.Threading.CancellationToken,System.Threading.Tasks.Task`1<Int32>>)
   at Bicep.Cli.Program+<Main>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Bicep.Cli.Program+<Main>d__3, bicep, Version=0.29.0.0, Culture=neutral, PublicKeyToken=null]](<Main>d__3 ByRef)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Bicep.Cli.Program+<Main>d__3, bicep, Version=0.29.0.0, Culture=neutral, PublicKeyToken=null]](<Main>d__3 ByRef)
   at Bicep.Cli.Program.Main(System.String[])
   at Bicep.Cli.Program.<Main>(System.String[])
Error: Error: az cli script failed.
cleaning up container...
MICROSOFT_AZURE_CLI_17[253](https://github.com/Witty-Creations/WittyCreations.Web/actions/runs/10681659890/job/29606293790#step:7:254)62060372_CONTAINER
Error: az cli script failed.
@rubenmamo rubenmamo added the need-to-triage Requires investigation label Sep 3, 2024
@rubenmamo
Copy link
Author

When I ran it yesterday I got this output:

Run azure/CLI@v2
Starting script execution via docker image mcr.microsoft.com/azure-cli:latest
WARNING: The configuration value of bicep.use_binary_from_path has been set to 'false'.
WARNING: Azure CLI 2.63.0 is the last version available on Alpine and will not receive updates. Consider migrating to the Azure Linux based image for Azure CLI. For more information: https://go.microsoft.com/fwlink/?linkid=2282203

@rubenmamo
Copy link
Author

This seems to be related to Azure/azure-cli#29828

@MoChilia
Copy link
Member

MoChilia commented Sep 3, 2024

Hi @rubenmamo, please temporarily pin azcliversion to 2.63.0. The image base of Azure CLI 2.64.0 has changed from Alpine to CBL Mariner 2.0. This change may introduce some breaking changes that could cause failures in bicep. We will investigate this issue during our work hours. Let's keep track of the issue in Azure/azure-cli#29828.

@MoChilia MoChilia added P1 Some scenario broken but workaround exists and removed need-to-triage Requires investigation labels Sep 3, 2024
@rubenmamo
Copy link
Author

@MoChilia thanks for your reply. I had in fact already applied that on my workflows once I figured out that the issue is due to the azure cli image

@MoChilia
Copy link
Member

MoChilia commented Sep 6, 2024

@rubenmamo, please try the solution mentioned in this blog. Temporarily, you have to install the icu package manually with tdnf install -y icu. We're now collaborating with the Bicep team to resolve the issue in Azure CLI version 2.65.0.

@verschaevesiebe
Copy link

verschaevesiebe commented Sep 20, 2024

Having this as well in 2.64.0 pinning 2.63.0 resolved the issue 👍🏽

Thanks for this thread. For anyone wondering this is the fix.

     - name: Azure CLI Action
        uses: Azure/cli@v2
        with:
          azcliversion: 2.63.0
          inlineScript: az stack sub create
            --name baseline-
            .......

@MoChilia
Copy link
Member

MoChilia commented Dec 2, 2024

Hi everyone, this has been resolved in Azure CLI version 2.66.0 (Azure/azure-cli#29897). You can now update your scripts to azcliversion: latest to include this fix.

@MoChilia MoChilia closed this as completed Dec 2, 2024
mjlshen added a commit to mjlshen/ARO-HCP that referenced this issue Dec 12, 2024
Azure/cli#165 has been resolved

Signed-off-by: Michael Shen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Some scenario broken but workaround exists
Projects
None yet
Development

No branches or pull requests

3 participants