Couldn’t find a valid ICU package when using Container Image in step

Part of my release process is attempting to run a Bash script against a custom Container Image (set as the Container Image property within the step). The container image is being retrieved from a private Google Cloud Registry.

Unfortunately when this step runs, it fails and gives the following error:

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. 
February 24th 2022 11:44:30Error
   at System.Environment.FailFast(System.String) 
February 24th 2022 11:44:30Error
   at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode() 
February 24th 2022 11:44:30Error
   at System.Globalization.GlobalizationMode..cctor() 
February 24th 2022 11:44:30Error
   at System.Globalization.CultureData.CreateCultureWithInvariantData() 
February 24th 2022 11:44:30Error
   at System.Globalization.CultureData.get_Invariant() 
February 24th 2022 11:44:30Error
   at System.Globalization.TextInfo..cctor() 
February 24th 2022 11:44:30Error
   at System.String.ToLowerInvariant() 
February 24th 2022 11:44:30Error
   at System.Text.EncodingHelper.GetCharset() 
February 24th 2022 11:44:30Error
   at System.Text.EncodingHelper.GetEncodingFromCharset() 
February 24th 2022 11:44:30Error
   at System.ConsolePal.GetConsoleEncoding() 
February 24th 2022 11:44:30Error
   at System.Console.get_OutputEncoding() 
February 24th 2022 11:44:30Error
   at System.Console.CreateOutputWriter(System.IO.Stream) 
February 24th 2022 11:44:30Error
   at System.Console.<get_Out>g__EnsureInitialized|25_0() 
February 24th 2022 11:44:30Error
   at System.Console.get_Out() 
February 24th 2022 11:44:30Error
   at Calamari.Common.Plumbing.Logging.ConsoleLog..ctor() 
February 24th 2022 11:44:30Error
   at Calamari.Common.Plumbing.Logging.ConsoleLog..cctor() 
February 24th 2022 11:44:30Error
   at Calamari.GoogleCloudScripting.Program.Main(System.String[]) 
February 24th 2022 11:44:31Error
   at Calamari.GoogleCloudScripting.Program.<Main>(System.String[]) 
February 24th 2022 11:44:31Fatal
The remote script failed with exit code 139 
February 24th 2022 11:44:31Fatal
The action Migrate Database on a Worker failed

I’ve checked this forum post: Couldn’t find a valid ICU package and have validated that my container (which derives from python:3.8.10-slim) has the requirements for Linux targets:

  • The $HOME environment variable is available.
  • bash 3+ is available at /bin/bash.
  • tar is available.
  • base64 is available.
  • grep is available

The JSON for the failing step is as follows:

{
      "Id": "1b32ee3f-d655-48b1-abc3-257415be8b03",
      "Name": "Migrate Database",
      "PackageRequirement": "LetOctopusDecide",
      "Properties": {},
      "Condition": "Success",
      "StartTrigger": "StartAfterPrevious",
      "Actions": [
        {
          "Id": "66d2abdb-d724-49d0-8b37-30ab77e90018",
          "Name": "Migrate Database",
          "ActionType": "Octopus.GoogleCloudScripting",
          "Notes": null,
          "IsDisabled": false,
          "CanBeUsedForProjectVersioning": true,
          "IsRequired": false,
          "WorkerPoolId": "WorkerPools-3",
          "Container": {
            "Image": "REDACTED",
            "FeedId": "Feeds-1001"
          },
          "WorkerPoolVariable": null,
          "Environments": [],
          "ExcludedEnvironments": [],
          "Channels": [],
          "TenantTags": [],
          "Packages": [],
          "Condition": "Success",
          "Properties": {
            "Octopus.Action.GoogleCloud.UseVMServiceAccount": "False",
            "Octopus.Action.GoogleCloud.ImpersonateServiceAccount": "False",
            "Octopus.Action.Script.ScriptSource": "Inline",
            "Octopus.Action.Script.Syntax": "Bash",
            "Octopus.Action.GoogleCloudAccount.Variable": "GCP.DatabaseAccount",
            "Octopus.Action.GoogleCloud.Project": "#{GCP.Project.Id}",
            "Octopus.Action.GoogleCloud.Region": "#{GCP.Region}",
            "Octopus.Action.GoogleCloud.Zone": "#{GCP.Zone}",
            "Octopus.Action.Script.ScriptBody": "\nVERSION=v1.21.0 # see Releases for other versions\nwget \"https://storage.googleapis.com/cloudsql-proxy/$VERSION/cloud_sql_proxy.linux.amd64\" -O cloud_sql_proxy\nchmod +x cloud_sql_proxy\n\nDB_CONNECTION_STRING=\"$(get_octopusvariable \"GCP.Database.Connection\")\" \nACCOUNT_TOKEN=\"$(get_octopusvariable \"GCP.DatabaseToken\")\" \necho \"*** Start migration\" \ncloud_sql_proxy -token=$ACCOUNT_TOKEN -instances=$DB_CONNECTION_STRING=tcp:5433\npython manage.py migrate \npython manage.py createcachetable \necho \"*** End migration\"",
            "Octopus.Action.RunOnServer": "true",
            "OctopusUseBundledTooling": "False"
          },
          "Links": {}
        }
      ]
    },

Additionally when setting the worker pool to Default Worker Pool the worker doesn’t pull the docker image correctly but does when the worker pool is set to Host Ubuntu

Any support you can give would be greatly appreciated

Hi @jamie.springett

Welcome to the Octopus help forum! Thanks for contacting us.

I believe that the container image may be missing the libicu package that is necessary for .NET to run on a Linux machine. While it is not explicitly stated in our documentation, we do reference that there may be some .NET Core components necessary for our Calamari library to run.

Here is the Microsoft documentation for manual .NET installation just in case you wish to double-check the dependencies.

Installing this package on your Linux target should solve the issue, but if not, please let me know, and we shall look into this further!

Kind Regards
Sean

Hi @sean.stanway
Thanks for your quick reply.
I am installing the recommended things into my Image with my Dockerfile prior to its use in Octopus with the commands

RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
   chmod +x dotnet-install.sh && \
   ./dotnet-install.sh -c Current

RUN apt-get install -y libicu-dev

However I am still seeing the same error of Couldn't find a valid ICU package installed on the system
Could you please look into this further? Thanks
Kind regards
Jamie

Hi @jamie.springett!

Just jumping in for Sean here, as he’s wrapped up for the day.

Sorry to hear you’re still having issues - can you shed some light on the base layer (it looks like a debian/ubuntu flavour from your snippet) you’re using for your container? Is it possible (depending on your distro), that the -dev package doesn’t contain the actual library, but things like header files / source etc? I believe on Debian, the packages you want are libicu60 or libicu65 for the library itself.

I hope this helps, and please let me know if you have any further questions!

Hi @Justin_Walsh ,
I am using “Debian GNU/Linux 10 (buster)” using amd64
I have tried using this code to no avail

RUN apt-get install -y dpkg && \
    apt-get install -y libicu63=63.1-6+deb10u1 && \
    apt-get install -y libc6-dev && \
    apt-get install -y icu-devtools=63.1-6+deb10u1
 
RUN wget http://ftp.de.debian.org/debian/pool/main/i/icu/libicu-dev_63.1-6+deb10u1_amd64.deb -O libicu-dev.deb && \
    dpkg -i ./libicu-dev.deb && \
    apt-get install -f

RUN wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu60_60.2-3ubuntu3_amd64.deb -O libicu60.deb && \
    dpkg -i ./libicu60.deb && \
    apt-get install -f
  
RUN wget https://security.debian.org/debian-security/pool/updates/main/i/icu/libicu63_63.1-6+deb10u2_amd64.deb -O libicu63.deb && \
    dpkg -i ./libicu63.deb && \
    apt-get install -f -y

but I still get the Couldn't find a valid ICU package installed on the system error
I was unable to find libicu65 for Debian and so tried libicu63 instead

Hi Jamie,

Thanks for getting back to us, and sorry to see that hasn’t worked.

I found the following GitHub issue that might be relevant here for dotnet:

Within that there are a few suggested workarounds I was wondering if you’d be willing to try on your end:

If you’re willing to try those, let us know how it goes!

Best,
Patrick

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.