Jenkins agent connect and immediately terminated

Hi
im running Jenkins locally . and after huge upgrade to latest , some of the agent would not connecting
i set the java version (latest) and the newer wrapper and i configure the xml to run the agent as service that it will not disconnect , the problem is some of my station are connected and remain idle . and the others i got “connection was broken”
now when i install the agent i got this error (the agent is be connected and after is terminate immediately)

Oct 11, 2023 9:51:04 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using c:\jenkins\remoting as a remoting work directory
Oct 11, 2023 9:51:04 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging
INFO: Both error and output logs will be printed to c:\jenkins\remoting
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: labpc13(216)
Oct 11, 2023 9:51:05 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3148.v532a_7e715ee3
Oct 11, 2023 9:51:05 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using c:\jenkins\remoting as a remoting work directory
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http:/jenkins.local.com:8081/]
Oct 11, 2023 9:51:05 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
Agent address: jenkins.local.com
Agent port: 50000
Identity: 02:12:12:6c:7d:6a:2f:b9:c1:b9:f2:91:a7:0a:d3:46
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to jenkins.local.com:50000
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
Oct 11, 2023 9:51:05 PM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run
INFO: Waiting for ProtocolStack to start.
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Remote identity confirmed: 02:12:12:6c:7d:6a:2f:b9:c1:b9:f2:91:a7:0a:d3:46
Oct 11, 2023 9:51:05 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Oct 11, 2023 9:51:06 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated

please advice what to do.

running: jenkins ver 2.426
/usr/lib/jvm/java-17-openjdk-amd64
java class version 61.0

Do you have any other messages in the controller log files?
Are you using the same JDK version on the controller and on the agent?
Could there be a firewall between your agent and controller?