Windows Agents Failing to Connect After Jenkins Server Migration to RHEL 9

Jenkins setup:
Jenkins: 2.462.2
OS: Linux - 3.10.0-1160.105.1.el7.x86_64
Java: 11.0.21 - Red Hat, Inc. (OpenJDK 64-Bit Server VM)

Hi,
We recently replaced our old Jenkins server running on CentOS 7 with a new RHEL 9 machine. After copying the /var/lib/jenkins directory from the old server to the new one, we shut down the old machine and configured the new server with the same hostname and IP address.

Once we powered on the new server, the Jenkins controller and Mac agents connected successfully, but the Windows agents failed to connect and consistently showed the same error:

INFO: Could not locate server among [
https://jenkins.ouraddress.com/];
waiting 10 seconds before retry
java.io.IOException:
https://jenkins.ouraddress.com/
provided port:8081 is not reachable on host https://jenkins.ouraddress.com
        at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:311)
        at hudson.remoting.Engine.innerRun(Engine.java:829)
        at hudson.remoting.Engine.run(Engine.java:574)

After extensive troubleshooting without success, we had to temporarily turn off the new server and reactivate the old one to keep our workflow running.

We’re seeking any insights or similar experiences from the community that might help resolve this issue.

Thanks in advance

Check that the operating system on the new server is allowing connections to port 8081.

Check that the Jenkins controller is configured to listen on port 8081. The default HTTP port is 8080. If you’re using WebSocket, then that is also the default port for WebSocket connections. If you’re not using WebSocket, then maybe that is the port number that you configured for agent connections.

If you are using inbound agents from Windows, check that the version of the agent.jar file used on the Windows agents is the most recent version available from the new Jenkins controller. It could be that your Jenkins remoting version on the Windows agents is too old and the connection is being rejected by the Jenkins controller.

Check the Jenkins logs (from “Manage Jenkins”) immediately after a connection attempt in case there is something in the controller log that will help you diagnose the failure.

I have confirmed that the operating system allows connections through port 8081, as I can successfully perform a telnet from any Windows agent to the new server.

The Jenkins controller is configured to listen on port 8081. The version of agent.jar is the latest available, as the .bat file includes a command to download it every time it runs. The Jenkins Remoting version is also identical to the one used on the old server (which, apart from the OS, is identical), so if there were an issue with this setup, it wouldn’t work on the old server either.

There’s absolutely nothing in the Jenkins logs about connection attempts from the agents, making this even more puzzling.

In short, we have two nearly identical servers (same address and FQDN included), but on the new server, everything works perfectly except the connections from the Windows agents.

I’m at a loss for what else to try; this issue is genuinely baffling.