You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When configuring a Windows agent using JCasC, the SSH connection is broken between Jenkins and the agent if 'username/password' authentication is selected.
The configuration looks suitable when examined in the Jenkins UI, but I can see the following error in the agent logs:
Feb 25, 2021 10:23:16 AM null
WARNING: Failed to authenticate with exception: Exception: java.lang.NullPointerException
On a closer inspection in the system logs:
Feb 25, 2021 10:44:19 AM WARNING com.google.jenkins.plugins.computeengine.ComputeEngineCloud log
Failed to authenticate with exception:
java.lang.NullPointerException
at com.google.jenkins.plugins.computeengine.ComputeEngineWindowsLauncher.authenticateSSH(ComputeEngineWindowsLauncher.java:72)
at com.google.jenkins.plugins.computeengine.ComputeEngineWindowsLauncher.bootstrap(ComputeEngineWindowsLauncher.java:104)
at com.google.jenkins.plugins.computeengine.ComputeEngineWindowsLauncher.setupConnection(ComputeEngineWindowsLauncher.java:56)
at com.google.jenkins.plugins.computeengine.ComputeEngineComputerLauncher.launch(ComputeEngineComputerLauncher.java:301)
at com.google.jenkins.plugins.computeengine.ComputeEngineComputerLauncher.launch(ComputeEngineComputerLauncher.java:224)
at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:296)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Looking at that line in the code, it seems that windowsConfig.getPrivateKeyCredentialsId() can return a null value, so call isEmpty() on that will cause the NPE.
Workaround is to specify an empty string as the privateKeyCredentialsId, e.g.
When configuring a Windows agent using JCasC, the SSH connection is broken between Jenkins and the agent if 'username/password' authentication is selected.
Windows agent configuration:
The configuration looks suitable when examined in the Jenkins UI, but I can see the following error in the agent logs:
On a closer inspection in the system logs:
Looking at that line in the code, it seems that
windowsConfig.getPrivateKeyCredentialsId()
can return a null value, so callisEmpty()
on that will cause the NPE.Workaround is to specify an empty string as the
privateKeyCredentialsId
, e.g.The text was updated successfully, but these errors were encountered: