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

Getting ICU error when trying to build with globalization - Updated from #10989 #11419

Open
2 of 16 tasks
DevOpsAzurance opened this issue Jan 17, 2025 · 2 comments
Open
2 of 16 tasks

Comments

@DevOpsAzurance
Copy link

Description

Ubuntu image is not built with required ICU packages needed for dotnet build:

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.

Setting environment variable to:

$export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

is not viable as dev requires globalization.

Per the recommendation of:

https://github.com/actions/runner-images/issues/10989

But still having an issue. My Pipeline YAML is running this:

    - task: bash@3
      displayName: 'Install ICU Globalization on Linux'
      condition: eq(variables['Agent.OS'], 'Linux')
      inputs:
        targetType: 'inline'
        script: >
          echo "##vso[task.setvariable variable=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT;]0"

          sudo apt-get update

          sudo apt-get -U install -y libicu-dev

Dev teams can set whether invariant is set to 0 or 1. If '0' and running on linux machine, it needs to install libicu-dev. The output of said steps is:

Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/usr/bin/bash /agent/_work/_temp/0d5f30fd-8992-4d16-9031-22d0699ca3ef.sh
Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [142 B]
Hit:2 http://azure.archive.ubuntu.com/ubuntu noble InRelease
Get:3 http://azure.archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:4 http://azure.archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Hit:6 https://packages.microsoft.com/repos/azure-cli noble InRelease
Hit:7 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
Get:5 http://azure.archive.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:8 http://azure.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [775 kB]
Get:9 http://azure.archive.ubuntu.com/ubuntu noble-updates/main amd64 Components [151 kB]
Get:10 http://azure.archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [974 kB]
Get:11 http://azure.archive.ubuntu.com/ubuntu noble-updates/universe amd64 Components [309 kB]
Get:12 http://azure.archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Components [212 B]
Get:13 http://azure.archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Components [940 B]
Get:14 http://azure.archive.ubuntu.com/ubuntu noble-backports/main amd64 Components [208 B]
Get:15 http://azure.archive.ubuntu.com/ubuntu noble-backports/universe amd64 Components [11.7 kB]
Get:16 http://azure.archive.ubuntu.com/ubuntu noble-backports/restricted amd64 Components [216 B]
Get:17 http://azure.archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Components [212 B]
Get:18 http://azure.archive.ubuntu.com/ubuntu noble-security/main amd64 Components [7240 B]
Get:19 http://azure.archive.ubuntu.com/ubuntu noble-security/universe amd64 Components [52.0 kB]
Get:20 http://azure.archive.ubuntu.com/ubuntu noble-security/restricted amd64 Components [212 B]
Get:21 http://azure.archive.ubuntu.com/ubuntu noble-security/multiverse amd64 Components [212 B]
Fetched 2661 kB in 2s (1439 kB/s)
Reading package lists...
Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [142 B]
Hit:2 http://azure.archive.ubuntu.com/ubuntu noble InRelease
Hit:3 http://azure.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:6 https://packages.microsoft.com/repos/azure-cli noble InRelease
Hit:4 http://azure.archive.ubuntu.com/ubuntu noble-backports InRelease
Hit:7 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
Hit:5 http://azure.archive.ubuntu.com/ubuntu noble-security InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
libicu-dev is already the newest version (74.2-1ubuntu3.1).
libicu-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 68 not upgraded.

Finishing: Install ICU Globalization on Linux

but then still fails with:

/agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/Exceptions/MyClasses.cs(35,13): warning SYSLIB0051: 'Exception.Exception(SerializationInfo, StreamingContext)' is obsolete: 'This API supports obsolete formatter-based serialization. It should not be called or extended by application code.' (https://aka.ms/dotnet-warnings/SYSLIB0051) [/agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/MyProject.csproj]
  MyProject -> /agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/bin/release/net8.0/MyProject.dll
  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.Resources.ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(System.Reflection.Assembly, System.Resources.UltimateResourceFallbackLocation ByRef)
     at System.Resources.ResourceManager.CommonAssemblyInit()
     at System.Resources.ResourceManager..ctor(System.Type)
     at System.SR.get_ResourceManager()
     at System.SR.GetResourceString(System.String, System.String)
     at System.SR.get_XmlConvert_BadUri()
     at System.Xml.XmlReaderSettings.CreateReader(System.String, System.Xml.XmlParserContext)
     at System.Xml.XmlReader.Create(System.String, System.Xml.XmlReaderSettings, System.Xml.XmlParserContext)
     at System.Xml.XmlReader.Create(System.String, System.Xml.XmlReaderSettings)
     at System.Xml.Linq.XDocument.Load(System.String, System.Xml.Linq.LoadOptions)
     at System.Xml.Linq.XDocument.Load(System.String)
     at Vsxmd.Program.Main(System.String[])
  Aborted (core dumped)
##[error]/home/AzDevOps/.nuget/packages/vsxmd/1.4.5/build/Vsxmd.targets(17,5): Error MSB3073: The command ""/home/AzDevOps/.nuget/packages/vsxmd/1.4.5/build//../tools/linux-x64/Vsxmd" "" "" "True"" exited with code 134.
/home/AzDevOps/.nuget/packages/vsxmd/1.4.5/build/Vsxmd.targets(17,5): error MSB3073: The command ""/home/AzDevOps/.nuget/packages/vsxmd/1.4.5/build//../tools/linux-x64/Vsxmd" "" "" "True"" exited with code 134. [/agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/MyProject.csproj]

Build FAILED.

/agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/Entities/ReinsuranceResult.cs(46,53): warning CS8618: Non-nullable property 'Claim' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/MyProject.csproj]
/agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/Exceptions/MyClasses.cs(35,13): warning SYSLIB0051: 'Exception.Exception(SerializationInfo, StreamingContext)' is obsolete: 'This API supports obsolete formatter-based serialization. It should not be called or extended by application code.' (https://aka.ms/dotnet-warnings/SYSLIB0051) [/agent/_work/4/s/SourceCodeRepo/src/Services/MyProject/MyProject.csproj]

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022
  • Windows Server 2025

Image version and build link

Current agent version: '3.236.0'
Current image version: '1.0.3'

This image is using the March Build of the Ubuntu OS.

Is it regression?

N/A

Expected behavior

It should be able to build with Globalization using ICU on Ubuntu

Actual behavior

Fails due to missing packages

Repro steps

Run build with ICU install when DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0

@Robbbo-T
Copy link

Next Steps for Issue #11419

  1. Verify the Issue: Confirm if the issue can be reproduced with the provided steps.
  2. Check ICU Installation: Ensure that the libicu-dev package is correctly installed and recognized by the system.
  3. Review Dotnet Globalization Settings: Verify that the environment variable DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0 is correctly set.
  4. Consult Related Issues: Refer to similar issues like #10989 for potential solutions.
  5. Update Documentation: If a solution is found, update the documentation to help others facing similar issues.
  6. Comment and Collaborate: Add comments to the issue to provide updates and ask for additional details if needed.
  7. Assign and Prioritize: Assign the issue to a team member and prioritize based on the impact and urgency.

Would you like to take any specific action or need further details on any of these steps?

@yueerchen
Copy link

I have the same issue with my latest build. Here's solution I tried:

  • Add a step to install the libicu-dev package. Build still failed
- name: Install ICU library # Ensure ICU is available
        run: sudo apt-get update && sudo apt-get install -y libicu-dev
  • Fixed ubuntu version back to 20.04. Build succeed.

I do suspect the recent update altered the default installed packages or runtime configurations, the ICU library might no longer be pre-installed or expected by default. If anyone has an idea, feel free to share, it'll be helpful

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

3 participants