Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16816

slave-agent.jnlp produces wrong url for remoting.jar

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • slave-setup-plugin
    • CentOS 6 x64 Master (running through VMWare) running Jenkins 1.501; Windows 7 x64 for Slave

      While trying to set up the Windows machine as a node, the slave-agent.jnlp yields an unable to locate resource error for remoting.jar. The issue seems to be that the url it's trying to look for also contains the root directory it is saved in.

      For example, if I'm trying to run the slave-agent.jnlp in C:\jenkins, the FileNotFoundException seems to indicate that it is looking for the file at C:\jenkins\<jenkinsURL:8080>\computer\<slave>\jnlpJars\remoting.jar, instead of simply <jenkinsURL:8080>\computer\<slave>\jnlpJars\remoting.jar.

      Even if I try to run it directly at the url using javaws (javaws http://<jenkinsURL:8080>/computer/<slave>/slave-agent.jnlp), it appends the url of the to the slave-agent.jnlp before the url of the rest of the files and you get a convoluted mess of an url like http://<jenkinsURL:8080>/computer/<slave>/<jenkinsURL:8080>/computer/<slave>/jnlpJars/remoting.jar

          [JENKINS-16816] slave-agent.jnlp produces wrong url for remoting.jar

          CharlesB added a comment -

          I had this issue as well, it is due to a missing "http://" prefix in the server URL of global jenkins configuraton

          CharlesB added a comment - I had this issue as well, it is due to a missing "http://" prefix in the server URL of global jenkins configuraton

          Ilguiz Latypov added a comment - - edited

          Accessing the /jnlpJars/ directory throws this:

          java.lang.StringIndexOutOfBoundsException: String index out of range: -1
          	at java.lang.String.substring(String.java:1931)
          	at jenkins.model.Jenkins.doJnlpJars(Jenkins.java:3214)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:497)
          	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
          	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
          	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
          	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
          	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
          	... 54 more
          

          but /jnlpJars/remoting.jar will prompt to download the jar.

          Ilguiz Latypov added a comment - - edited Accessing the /jnlpJars/ directory throws this: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1931) at jenkins.model.Jenkins.doJnlpJars(Jenkins.java:3214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) ... 54 more but /jnlpJars/remoting.jar will prompt to download the jar.

          My issue with starting the agent disappeared but I did not track the history of changes leading to this. I do remember rebooting the server machine (which means this restarted Tomcat 8).

          Ilguiz Latypov added a comment - My issue with starting the agent disappeared but I did not track the history of changes leading to this. I do remember rebooting the server machine (which means this restarted Tomcat 8).

            kohsuke Kohsuke Kawaguchi
            zedzeta Z Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: