NullPointer exception on the connection between CJOC and controller

1 minute read

Issue

When trying to connect the CJOC with a controller we are getting this log:

`WARNING org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer onRecv

java.lang.NullPointerException at com.cloudbees.opscenter.client.plugin.OperationsCenterRootAction$DescriptorImpl$ServerListenerImpl.onIdentityEstablished(OperationsCenterRootAction.java:1402) at com.cloudbees.opscenter.agent.OperationsCenter2AgentProtocol$ServerState.onHandshakeCompleted(OperationsCenter2AgentProtocol.java:744) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processHandshakeCompleted(SSLEngineFilterLayer.java:273) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processResult(SSLEngineFilterLayer.java:452) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.processRead(SSLEngineFilterLayer.java:348) at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecv(SSLEngineFilterLayer.java:117) at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecv(ProtocolStack.java:668) at org.jenkinsci.remoting.protocol.NetworkLayer.onRead(NetworkLayer.java:136) at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:160) at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) 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) `

Environment

CloudBees Jenkins Operations Center

Resolution

This issue is related to the socket that is closed before the connection was finished.

If there is a custom plugin, if the implementation on the Jenkins hooks is not correct it could break the CJOC connection with the controller.

We have seen this behavior on:

  • the Slack Notification plugin on version 2.3.

  • the Permissive Script Security plugin. Issue is present even if the plugin is not activated. We recommend uninstalling this plugin on a production system as it deactivates security mechanisms.

You will need to review if you are using this plugin in this version and update it.

In case you are not using it and you have some custom plugins, our recommendation is to disable these custom plugins temporally and check if that fixes the issue. If so you will need to review the implementation of these custom plugins to avoid breaking the hooks on the Jenkins side.