I am trying to connect Jenkins agent to the controller.
We are allowed to have only one port (say 8888) open from the corporate firewall to talk to the controller hosted on AWS. The port is being used for connecting to the jnlp process running on the controller Jenkins machine. Due to this reason we cannot download the slave-agent.jnlp file using http. I have manually downloaded the slave-agent.jnlp file and I am trying to give the following command to start the agent up.
java -jar slave.jar -jnlpUrl file:///oracle/app/jenkins/slave-agent.jnlp -secret 7f079707d5632d2db2501be73f1a6f5f6422b9c9fde806afd8fdd2000d5db123
I get the the following error
Failing to obtain file:/oracle/app/jenkins/slave-agent.jnlp?encrypt=true
java.io.IOException: file:/oracle/app/jenkins/slave-agent.jnlp?encrypt=true doesn't look like a JNLP file; content type was null
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:301)
at hudson.remoting.Launcher.run(Launcher.java:218)
at hudson.remoting.Launcher.main(Launcher.java:192)
Waiting 10 seconds before retry
I have tried this as well without any luck.
java -jar slave.jar -jnlpUrl file://localhost/oracle/app/jenkins/slave-agent.jnlp -secret 7f079707d5632d2db2501be73f1a6f5f6422b9c9fde806afd8fdd2000d5db123
The file is present at the location has read write permissions.
Any clue on why the java process is not able to read that file?
The jnlpUrl parameter needs to be an http or https link to your Jenkins master, e.g. http://jenkins.yourco.com/computer/slavename/slave-agent.jnlp -it won't work as a file URL.