0

I have a command that I use to connect to master from one of my Jenkins agents, I did not want to type the connection command each time I boot the agent, so I created a .bat file:

java -jar agent.jar -jnlpUrl http://master_host:8080/computer/Windows%207/slave-agent.jnlp -secret MY_SECRET -workDir "C:\Jenkins"

but there is weird issue, if I type the command manually, it works fine, but if I run the bat file, I am getting error message:

    java.io.IOException: Failed to load http://master_host:8080/computer/Windows07/sla
ve-agent.jnlp?encrypt=true: 404 Not Found

does anyone know how to resolve it? My agent is Windows 7 machine.

Nodir Nasirov
  • 1,488
  • 3
  • 26
  • 44

2 Answers2

0

You can add below to your bat file :-

cd/d D:\tools\Jenkins (Location where agent.jar)
java -jar agent.jar -jnlpUrl http://master_host:8080/computer/Windows%207/slave-agent.jnlp -secret MY_SECRET -workDir "C:\Jenkins"

And please check the URL of jenkins, if you deployed jenkins on tomcat then url will look like:-

http://master_host:8080/jenkins/computer/Windows%207/slave-agent.jnlp -secret MY_SECRET -workDir "C:\Jenkins"
user_9090
  • 1,884
  • 11
  • 28
0

The issue is with the Slave name "Windows 7" try not to have space. Rename your slave as Windows-7, it will work.

http://master_host:8080/computer/Windows%207/slave-agent.jnlp

egg
  • 1