FATAL: Node Jenkins doesn't seem to be running on RedHat-like distro
Asked Answered
N

3

8

I installed a new Jenkins node on ubuntu server following the documentation on jenkins.io On my first deploy the console shows me this error:

Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/SIAL/SIAL_SVC
Checking OpenJDK installation...
FATAL: Node Jenkins doesn't seem to be running on RedHat-like distro
java.lang.IllegalArgumentException: Node Jenkins doesn't seem to be running on RedHat-like distro
    at org.jenkinsci.plugins.openjdk_native.OpenJDKInstaller.isInstalled(OpenJDKInstaller.java:96)
    at org.jenkinsci.plugins.openjdk_native.OpenJDKInstaller.performInstallation(OpenJDKInstaller.java:56)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:70)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:220)
    at hudson.model.JDK.forNode(JDK.java:147)
    at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:339)
    at hudson.model.Run.getEnvironment(Run.java:2419)
    at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:943)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1290)
    at hudson.scm.SCM.checkout(SCM.java:505)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1213)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
    at hudson.model.Run.execute(Run.java:1888)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:99)
    at hudson.model.Executor.run(Executor.java:432)
Finished: FAILURE

I don't find any similar error on internet, and I don't make any change on the server, somebody knows why I have this error?

Naamann answered 5/1, 2022 at 14:41 Comment(1)
did you find out any solutions for this?Samuelsamuela
F
2

It has to do with the org.jenkinsci.plugins.openjdk_native plugin. You need to configure it inside of Jenkins to find a suitable JDK.

Go to Manage Jenkins -> Global Tool Configuration Down to the JDK section Add JDK -> Give it a name -> Add Installer and select OpenJDK Installer I don't have the newer ones available so I selected the java-1.8.0-openjdk

Save, and go try your job again.

Fusilier answered 12/8, 2022 at 18:6 Comment(0)
T
0

I had the same issue, i change default jdk in Jenkins (upgrade). For me this problème appeared when i updated Jenkins.

Tie answered 8/4, 2022 at 8:51 Comment(0)
L
0

I was facing this issue on my local where I added an WSL instance of Ubuntu as a jenkins-agent machine.

Install Java on this agent machine if not already installed. Then provide the java path to Jenkins instead of "Install Automatically." ssh into the agent machine, then use the below command to get JAVA_HOME:

echo $(dirname $(dirname $(readlink -f $(which java))))

On Jenkins UI goto - Dashboard > Manage Jenkins > Tools > JDK installations section. And paste the output of the above, which may look something like this if you installed openjdk on your agent machine:

/usr/lib/jvm/java-17-openjdk-amd64

It will then start using the local agent's existing java installation instead of installing and setting up its own.

Lightface answered 13/6, 2024 at 13:56 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.