the jar must be provided either as part of the image or by downloading it at agent start (the latter is better as it ensures that you always use a jar that is working with the Jenkins version you want to connect to).
Don’t know why your java thinks the agent jar is not accessible. Some hints what could be wrong: https://stackoverflow.com/questions/11943948/what-causes-unable-to-access-jarfile-error
Mostly success!
Two “typos” that chain through the system making finding the root an issue.
My Jenkins URL (in Jenkins) was mistyped. Which created a problem with the “address” in the curl and java. I found it by manually doing the curl with a -v as I wanted to see where the agent was stored. Well… it wasn’t. it is now.
I also had a mismatch in my remote/remoting directory on the agent. It appears that somewhere along the line the name was changed or – mistyped somewhere.
In any case, the system starts. I am now at a point where I get (from hudson):
Warning: Did not receive X-Remoting-Capability header (hudson remoting launcher)
and
INFO: Failed to connect: Handshake error. (hudson remoting engine)
The agent remoting log contents:
May 12, 2025 2:36:06 PM hudson.remoting.Launcher createEngine
INFO: Setting up agent: Test
May 12, 2025 2:36:06 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3301.v4363ddcca_4e7
May 12, 2025 2:36:06 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using c:\jenkins\remoting as a remoting work directory
May 12, 2025 2:36:07 PM hudson.remoting.Engine$1HeaderHandler afterResponse
WARNING: Did not receive X-Remoting-Capability header
May 12, 2025 2:36:07 PM hudson.remoting.Launcher$CuiListener status
INFO: Failed to connect: Handshake error.
May 12, 2025 2:36:07 PM hudson.remoting.Launcher$CuiListener status
INFO: Waiting 1 second before retry
May 12, 2025 2:36:08 PM hudson.remoting.Engine$1HeaderHandler afterResponse
WARNING: Did not receive X-Remoting-Capability header
May 12, 2025 2:36:08 PM hudson.remoting.Launcher$CuiListener status
INFO: Failed to connect: Handshake error.
May 12, 2025 2:36:08 PM hudson.remoting.Launcher$CuiListener status
INFO: Waiting 3 seconds before retry
May 12, 2025 2:36:11 PM hudson.remoting.Engine$1HeaderHandler afterResponse
WARNING: Did not receive X-Remoting-Capability header
May 12, 2025 2:36:11 PM hudson.remoting.Launcher$CuiListener status
INFO: Failed to connect: Handshake error.
May 12, 2025 2:36:11 PM hudson.remoting.Launcher$CuiListener status
INFO: Waiting 7 seconds before retry
May 12, 2025 2:36:18 PM hudson.remoting.Engine$1HeaderHandler afterResponse
WARNING: Did not receive X-Remoting-Capability header
May 12, 2025 2:36:18 PM hudson.remoting.Launcher$CuiListener status
INFO: Failed to connect: Handshake error.
May 12, 2025 2:36:18 PM hudson.remoting.Launcher$CuiListener status
INFO: Waiting 10 seconds before retry
Do you have a reverse proxy? Maybe it prevents that you can use websocket.
Try to remove the -webSocket
Well, it changed the message:
Could not locate server [ http://jenkins1:9191/]
http://jenkins1:9191/tcpslaveagent listener/ is invalid: 404 Not Found
Don’t think it liked that one.
The hudson stuff is well down into areas I haven’t a clue about.
Well, that’s progress, I think.
Used the SERVER logs and it said something like name TEST not found. Looked at my java on the agent and it was indeed incorrect. Fixed it.
Now I get a message “wrong secret for vm-test-10x64c”. Remember - I am using vSphere CLOUD, NOT the permanent agent. Do I NEED “secret” in this case?
My current fixed .bat on the agent:
curl.exe -sO http://vsrv-qxs-jenkins1:9191/jnlpJars/agent.jar
java -jar agent.jar -url http://vsrv-qxs-jenkins1:9191/ -secret 0fbb8304c23b14ce54d432fb0123425e4da3fcebdfefb95dc86a575b5f5821b5 -name “vm-qxs-win10x64c” -webSocket -workDir “c:\jenkins”
The secret is required. I guess you get an environment variable set that contains the secret.
How do I recreate that info for this agent? If I have a non-vsphere agent and it is offline, I get a screen full of the curl/java cut and paste. For vsphere cloud agents I do not get a page of script to copy (including the secret)
I suspect this may be the last issue here.
Found a script to list the secrets. Replaced and it is now running.
Thanks.
As it is a cloud agent the same image can be used to start multiple agents. So it doesn’t make sense hard code the Jenkins url, the agent name and the agent secret in your start script.
I would assume that the vsphere plugin is calling your start script and that it sets certain environment variables that contain all that information.
Hi, John
If you still need Help, here is what I think you should do.
The javaws
command is deprecated since Java 11, and OpenWebStart struggles with the JNLP file post-upgrade to 2.504. To resolve:
- Use the modern method: Download
agent.jar
fromhttp://jenkins1:9191/jnlpJars/agent.jar
, then run:java -jar agent.jar -jnlpUrl http://jenkins1:9191/computer/vm-test-10x64c/slave-agent.jnlp
- Confirm Java 21 is used (
java -version
). - Ensure the JNLP URL is accessible (test with a browser).
This should fix the issue. If not, share the agent logs for more help!
Best,
David Mano