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

Ubuntu 18.04 agents have unexpected default locale #3120

Closed
2 of 7 tasks
dougbu opened this issue Apr 6, 2021 · 11 comments
Closed
2 of 7 tasks

Ubuntu 18.04 agents have unexpected default locale #3120

dougbu opened this issue Apr 6, 2021 · 11 comments
Assignees
Labels
OS: Ubuntu question Further information is requested

Comments

@dougbu
Copy link

dougbu commented Apr 6, 2021

Description
We (ASP.NET Core team) are attempting to move from Ubuntu 16.04 to 18.04 Microsoft-hosted agents. Our builds are failing because libicu60 is not installed on the newer agents. See also https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1604-README.md (where libicu55 is installed) versus https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md (where the string icu isn't matched at all).

Area for Triage:

Packages

Question, Bug, or Feature?:

Bug

But if there's a task to install libicu60 (the version aligned with Ubuntu 18.04) in our pipelines, I'm all ears.

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11.0
  • Windows Server 2016 R2
  • Windows Server 2019

Image version

Image version where you are experiencing the issue.
20210330.1

Expected behavior
A description of what you expected to happen.
Expect our tests to continue working correctly. Note https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#dependencies lists libicu60 as a prerequisite for .NET Core on Ubuntu.

Actual behavior
A description of what is actually happening.
libicu60 is missing from the image and some of our tests are failing due to string ordering issues. See for example failures in https://dev.azure.com/dnceng/public/_build/results?buildId=1073540

Repro steps
A description with steps to reproduce the issue. If your have a public example or repo to share,
please provide the link.

Rerun one of the following PR validation builds

@al-cheb
Copy link
Contributor

al-cheb commented Apr 6, 2021

Hello, @dougbu
The libicu60 is already pre-installed on Ubuntu Server 18.04.

jobs:
  build:
    runs-on: ubuntu-18.04
    steps:

      - name: libicu60
        run: dpkg -l | grep libicu60

image

@dougbu
Copy link
Author

dougbu commented Apr 6, 2021

@al-cheb was that changed in the last day or so❔ And, are you saying https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md is not up-to-date❔

Separately, are the agents used for Azure Pipelines and GitHub Actions different despite the fact https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software links to the above README.md file❔

The missing package would completely explain the test failures we're seeing for the listed PRs.

@dougbu
Copy link
Author

dougbu commented Apr 6, 2021

Shoot. The agents aren't appropriate for our builds but the problem isn't as simple as adding libicu60. For example, I tried a manual installation of the package in aspnet/BuildTools#998 and saw similar output to you @al-cheb: libicu60 is already the newest version (60.2-3ubuntu3.1). at https://dev.azure.com/dnceng/public/_build/results?buildId=1074813&view=logs&j=5818c23b-5f5e-5596-064a-6c64d403371a&t=28aca32c-5ccf-5757-b167-7b688276e977&l=17. This is now basically a documentation issue because https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md doesn't list the included libicu60 package.

Not sure where to look next to enable us to use the newer Ubuntu agents…

@al-cheb
Copy link
Contributor

al-cheb commented Apr 7, 2021

@al-cheb was that changed in the last day or so❔ And, are you saying https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md is not up-to-date❔

We don't include every version of default pre-installed packages in the documentation file.

Separately, are the agents used for Azure Pipelines and GitHub Actions different despite the fact https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software links to the above README.md file❔

It's the same image Azure Pipelines and GitHub Action .

PS. I can reproduce the issue on my test fresh vm with Azure Ubuntu Server 18.04:

  Starting test execution, please wait...
  [xUnit.net 00:00:00.9741394]     Compare_DetectsAllFieldRemovals(typeToCheck: "public struct ComparisonScenarios.StructToRemoveFi"...) [FAIL]
  [xUnit.net 00:00:00.9811200]     Compare_DetectsAllFieldRemovals(typeToCheck: "public class ComparisonScenarios.ClassToRemoveFiel"...) [FAIL]
  Failed   Compare_DetectsAllFieldRemovals(typeToCheck: "public struct ComparisonScenarios.StructToRemoveFi"...)
  Error Message:
   Assert.Equal() Failure
  Expected: List<BreakingChange> [BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToChangeValue = 1", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToMakeField = 2", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public readonly System.Int32 FieldToMakeWritable", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public static readonly System.Int32 StaticFieldToM"..., TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public static readonly System.Int32 StaticFieldToM"..., TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, ...]
  Actual:   List<BreakingChange> [BreakingChange { Kind = Removal, MemberId = "public System.Int32 FieldToMakeReadonly", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public System.Int32 FieldToRemove", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToChangeValue = 1", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToMakeField = 2", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, BreakingChange { Kind = Removal, MemberId = "public readonly System.Int32 FieldToMakeWritable", TypeId = "public struct ComparisonScenarios.StructToRemoveFi"... }, ...]

  Failed   Compare_DetectsAllFieldRemovals(typeToCheck: "public class ComparisonScenarios.ClassToRemoveFiel"...)
  Error Message:
   Assert.Equal() Failure
  Expected: List<BreakingChange> [BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToChangeValue = 1", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToMakeField = 2", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public readonly System.Int32 FieldToMakeWritable", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public static readonly System.Int32 StaticFieldToM"..., TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public static readonly System.Int32 StaticFieldToM"..., TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, ...]
  Actual:   List<BreakingChange> [BreakingChange { Kind = Removal, MemberId = "public System.Int32 FieldToMakeReadonly", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public System.Int32 FieldToRemove", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToChangeValue = 1", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public const System.Int32 ConstToMakeField = 2", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, BreakingChange { Kind = Removal, MemberId = "public readonly System.Int32 FieldToMakeWritable", TypeId = "public class ComparisonScenarios.ClassToRemoveFiel"... }, ...]

image

@al-cheb
Copy link
Contributor

al-cheb commented Apr 7, 2021

Looks like the tests are fixed - aspnet/BuildTools#1000

@al-cheb al-cheb self-assigned this Apr 7, 2021
@dougbu
Copy link
Author

dougbu commented Apr 7, 2021

@al-cheb that PR validated using Ubuntu 16.04. The root cause of the test failures is an unexpected locale (C.UTF-8) on the 18.04 agents. Will let you know when I've tested the solution. Still catching up on the morning's email…

@dougbu
Copy link
Author

dougbu commented Apr 7, 2021

Did a quick test with aspnet/BuildTools#999. On Ubuntu 16.04 agents, the default locale is en_US.UTF-8 while on 18.04 agents, it's C.UTF-8. This isn't a great idea for .NET Core 2.1 and the difference between the two platforms is unexpected. Does this repo set the locale for the agents❔ Or is this a change Canonical made between the two versions❔

I only see LC_ALL mentioned in https://github.com/actions/virtual-environments/blob/b7f276c003aea42575b52247bdb2183e355fca2f/images/macos/provision/configuration/environment/bashrc but there are other ways to control the locale…

Ubuntu 16.04

Script contents:
locale
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /home/vsts/work/_temp/46cde479-ce11-437b-a209-2ffec3c7eea6.sh
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Ubuntu 18.04

Script contents:
locale
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /home/vsts/work/_temp/b531dbb7-bdb2-4246-95f9-6c8990e6bda0.sh
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

Workaround

Fortunately, the workaround is pretty simple and no locale-gen is needed. I just set LC_ALL, LANG and LANGUAGE to en_US.UTF-8.

But, if it's an unintended change between the two images, I suggest that be corrected.

@dougbu dougbu changed the title Ubuntu 18.04 agents lack libicu60 package Ubuntu 18.04 agents have unexpected default locale Apr 8, 2021
@dougbu
Copy link
Author

dougbu commented Apr 8, 2021

Renamed to reflect current understanding of the problem.

/btw

@al-cheb was that changed in the last day or so❔ And, are you saying https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md is not up-to-date❔

We don't include every version of default pre-installed packages in the documentation file.

Ah, makes sense 😺

@al-cheb
Copy link
Contributor

al-cheb commented Apr 8, 2021

We don't have any plans to change the default locale on Azure Ubuntu images provided by Canonical publisher - https://stackoverflow.com/questions/55673886/what-is-the-difference-between-c-utf-8-and-en-us-utf-8-locales (e.g. - https://lintut.com/how-to-set-up-system-locale-on-ubuntu-18-04/)

image

OS locale locale -a /etc/default/locale
Ubuntu Server 16.04 LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
C
C.UTF-8
en_US.utf8
POSIX
LANG=en_US.UTF-8
Ubuntu Server 18.04 LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
C
C.UTF-8
POSIX
en_US.utf8
LANG=C.UTF-8
Ubuntu Server 20.04 LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
C
C.UTF-8
POSIX
en_US.utf8
LANG=C.UTF-8
Ubuntu Server 20.10 LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=
C
C.UTF-8
POSIX
en_US.utf8
LANG=C.UTF-8

@dougbu
Copy link
Author

dougbu commented Apr 8, 2021

🆗 I'll stick w/ our workaround.

/cc @JunTaoLuo @wtgodbe, please do the same in the branches and repos you're updating.

@dougbu dougbu closed this as completed Apr 8, 2021
@dougbu
Copy link
Author

dougbu commented Apr 8, 2021

See the bottom of #3120 (comment) for the workaround I meant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: Ubuntu question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants