skip to Main Content

I’m running Jenkins in Container Instance in Azure. However when I’m Jenkins starts building, I’m getting the error below. I have read a lot of info and people are suggesting to add this in the project file:

<InvariantGlobalization>true</InvariantGlobalization>

I have already done done that, but still not working. I’ve tried to install libicu as suggested and as I have read in other articles, but I’m still not able to do that as when I log into the container and type

apt-get install libicu-dev

I’m getting this:

E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

I have tried with sudo, but sudo is not recognized….

Here is the whole error message from Jenkins:

    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.CultureData.CreateCultureWithInvariantData()
   at System.Globalization.CultureData.get_Invariant()
   at System.Globalization.TextInfo..cctor()
   at System.String.ToLowerInvariant()
   at System.Text.EncodingHelper.GetEncodingFromCharset()
   at System.ConsolePal.GetConsoleEncoding()
   at System.Console.get_OutputEncoding()
   at Microsoft.DotNet.Cli.AutomaticEncodingRestorer..ctor()
   at Microsoft.DotNet.Cli.Program.Main(System.String[])
.NET Command Completed - Exit Code: 134

ERROR: Command execution completed with return code 134.
Finished: FAILURE

2

Answers


  1. Chosen as BEST ANSWER

    Finally I was able to solve the issue. The issue was mainly coming because the built-in agent was used. After that I have created a new Agent and when I looked into it - there were a couple of commands to run. After that the Agent is coming online and when he is running the build - I didn't experience the issue. However the problem is that whenever you end the session the agent goes offline again. I have followed this tutorial:

    [How to setup agent in Jenkins][1]

    This has fixed all of my issues with the Agent and building and testing the .net application. [1]: https://www.jenkins.io/blog/2022/12/27/run-jenkins-agent-as-a-service/


  2. As you have rightly highlighted, setting up a new VM as a Jenkins agent and giving it the necessary permissions and access to required resources.

    • Create a dedicated user to run the Jenkins agent.
    sudo adduser jenkins-agent
    

    Go to Manage Jenkins > Manage Nodes and Clouds and click on New Node to create a new agent.

    • Name the node (e.g., vm-agent) and configure the agent settings, including the remote root directory on the VM and labels if you want to restrict certain jobs to this agent.

    Choose Launch agent via SSH and provide the VM’s SSH details. Jenkins will attempt to connect via SSH and download the agent JAR file (agent.jar).

    Once connected, the VM should appear as online in the Jenkins dashboard.

    In the jenkins job configuration, add .NET build steps to verify that the VM agent can build successfully without errors.

    Please feel free to update for additional points from your end.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search