Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local JNLP file not read for jenkins slave

I am trying to connect jenkins slave to the master.

We are allowed to have only one port (say 8888) open from the corporate firewall to talk to the master hosted on AWS. The port is being used for connecting to the jnlp process running on the master 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?

like image 441
Gaurav Verma Avatar asked Mar 20 '23 23:03

Gaurav Verma


1 Answers

Answer by @gareth_bowles is wrong at least today, the url will work as a file url as well. Don't know if this was changed at some point.

For our windows slave it is "file:/D:/jenkins-slave/slave-agent.jnlp", which works.

like image 96
eis Avatar answered Mar 22 '23 14:03

eis