• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • envinject-plugin
    • None

      for 2.901.v0038b_6471582 and 2.908.v66a_774b_31d93 Versions of https://plugins.jenkins.io/envinject on jenkins version 2.414.3 and 2.426.3 and 2.426.1 all LTS with jdk11 will cause this error on Agent:
      Inbound agent connected from xxx.xxx.xxx.xxx:port Remoting version: 3160.vd76b_9ddd10cc Launcher: JNLPLauncher Communication Protocol: JNLP4-connect This is a Windows agent ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from xxx.xxx.xxx.xxx:port at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1000) at hudson.FilePath.act(FilePath.java:1283) at org.jenkinsci.plugins.envinject.EnvInjectComputerListener.onOnline(EnvInjectComputerListener.java:144) at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:747) at jenkins.slaves.DefaultJnlpSlaveReceiver.afterChannel(DefaultJnlpSlaveReceiver.java:176) at org.jenkinsci.remoting.engine.JnlpConnectionState.fire(JnlpConnectionState.java:337) at org.jenkinsci.remoting.engine.JnlpConnectionState.fireAfterChannel(JnlpConnectionState.java:428) at org.jenkinsci.remoting.engine.JnlpProtocol4Handler$Handler.lambda$onChannel$0(JnlpProtocol4Handler.java:335) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) java.lang.reflect.InaccessibleObjectException: Unable to make private native java.lang.reflect.Field[] java.lang.Class.getDeclaredFields0(boolean) accessible: module java.base does not "opens java.lang" to unnamed module @52249028 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.getModifiers(EnvInjectMasterEnvVarsSetter.java:29) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:55) at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:19) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:377) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:125) at java.base/java.lang.Thread.run(Thread.java:840) Agent successfully connected and online

          [JENKINS-72657] JNLP4-connect connection Failure

          Markus Winter added a comment -

          If this is an inbound agent you should add  add-opens to the java call
          `java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED -jar agent.jar ...`

          for outbound agents (ssh) there is an JVM options field where you should add this
          `--add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED`

           

           

          Markus Winter added a comment - If this is an inbound agent you should add  add-opens to the java call `java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED -jar agent.jar ...` for outbound agents (ssh) there is an JVM options field where you should add this `--add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED`    

          siamak added a comment - - edited

          mawinter69  Thanks for the reply.

          it works on some of the agents (all agents are inbound and running on Windows 10) but I see this error on some of them when i d the java args

          siamak added a comment - - edited mawinter69   Thanks for the reply. it works on some of the agents (all agents are inbound and running on Windows 10) but I see this error on some of them when i d the java args

          Grant added a comment - - edited

          I am experiencing this exact same issue, both on an existing Jenkins instance and node instance on ubuntu 22, as well as on a complete fresh install on a new box of both the Jenkins master and the node instance. I have attempted to add the config options that Markus suggested, adding them to JENKINS_ARGS in /etc/default/jenkins. I started with the config options for outbound agents, then tried the inbound (just in case), restarting Jenkins after each config change.

          Am I missing something here? I'm pretty new to Jenkins and had to take over our production instance after the sudden departure of an engineer who previously managed this. As far as I know, the error started after we disabled his git and AWS accounts, which necessitated updating keys in Jenkins because he was using ones tied to his personal accounts. I doubt this makes much of a difference, but its the only change that was made that we're aware of (access to this instance was revoked before he was aware of his termination). The fact that a fresh install and from-scratch config is throwing the same exception is rather baffling too.

          Edit: java version is the same on both the master and the slave

          openjdk 17.0.11 2024-04-16
          OpenJDK Runtime Environment (build 17.0.11+9-Ubuntu-122.04.1)
          OpenJDK 64-Bit Server VM (build 17.0.11+9-Ubuntu-122.04.1, mixed mode, sharing)

          Grant added a comment - - edited I am experiencing this exact same issue, both on an existing Jenkins instance and node instance on ubuntu 22, as well as on a complete fresh install on a new box of both the Jenkins master and the node instance. I have attempted to add the config options that Markus suggested, adding them to JENKINS_ARGS in /etc/default/jenkins . I started with the config options for outbound agents, then tried the inbound (just in case), restarting Jenkins after each config change. Am I missing something here? I'm pretty new to Jenkins and had to take over our production instance after the sudden departure of an engineer who previously managed this. As far as I know, the error started after we disabled his git and AWS accounts, which necessitated updating keys in Jenkins because he was using ones tied to his personal accounts. I doubt this makes much of a difference, but its the only change that was made that we're aware of (access to this instance was revoked before he was aware of his termination). The fact that a fresh install and from-scratch config is throwing the same exception is rather baffling too. Edit: java version is the same on both the master and the slave openjdk 17.0.11 2024-04-16 OpenJDK Runtime Environment (build 17.0.11+9-Ubuntu-122.04.1) OpenJDK 64-Bit Server VM (build 17.0.11+9-Ubuntu-122.04.1, mixed mode, sharing)

          Markus Winter added a comment -

          grantmefood 

          when you have outbound agents that connect via ssh you need to specify the JVM options on the agent config page

           

          for inbound agents you have to add the arg to the jvm there, it should look like this

           

          java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED -jar agent.jar -url http://localhost:9090/ -secret <secret> -name inbound -workDir <workdir>

           

          Markus Winter added a comment - grantmefood   when you have outbound agents that connect via ssh you need to specify the JVM options on the agent config page   for inbound agents you have to add the arg to the jvm there, it should look like this   java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED -jar agent.jar -url http: //localhost:9090/ -secret <secret> -name inbound -workDir <workdir>  

          Grant added a comment -

          Thanks for your help Markus! Adding that to the JVM options field cleared up the exception. Now I just need to figure out why jobs aren't running on the EC2 agent nodes that launch.

          Grant added a comment - Thanks for your help Markus! Adding that to the JVM options field cleared up the exception. Now I just need to figure out why jobs aren't running on the EC2 agent nodes that launch.

          Basil Crow added a comment -

          Duplicates JENKINS-60891.

          Basil Crow added a comment - Duplicates JENKINS-60891 .

            Unassigned Unassigned
            siamak_zanjani siamak
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: