• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: Linux

      Hudson 1.83

      When you create a machine name with blanks in it (like "Sjoerd XP box") the JNLP
      file gets an invalid URL, which contains spaces instead of %20.

          [JENKINS-321] JNLP slave names cannot contain blanks

          sjoerdbakker added a comment -

          This issue might be related with a sun bug (on the URL implementation?) in Java
          SE 6: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506304

          sjoerdbakker added a comment - This issue might be related with a sun bug (on the URL implementation?) in Java SE 6: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506304

          Jesse Glick added a comment -

          IMO the mentioned "bug" is simply a misunderstanding of the difference between
          file paths and 'file'-protocol URIs. This is a file path:

          C:\Program Files\Something\

          This is a URI:

          file:/c:/Program%20Files/Something/

          They can be interconverted using java.io.File methods.

          Jesse Glick added a comment - IMO the mentioned "bug" is simply a misunderstanding of the difference between file paths and 'file'-protocol URIs. This is a file path: C:\Program Files\Something\ This is a URI: file:/c:/Program%20Files/Something/ They can be interconverted using java.io.File methods.

          Do you get any stack trace, error message, that sort of things? If so, can you
          paste it here?

          Kohsuke Kawaguchi added a comment - Do you get any stack trace, error message, that sort of things? If so, can you paste it here?

          sjoerdbakker added a comment -

          At the JNLP side I get the following stacktrace (name of slave is "fampc jnlp":

          com.sun.deploy.net.FailedDownloadException: Unable to load resource:
          http://localhost:8080/hudson/computer/fampc jnlp/jnlpJars/jnlp-agent.jar
          at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
          at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
          at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
          at com.sun.javaws.Launcher.downloadResources(Unknown Source)
          at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
          at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
          at com.sun.javaws.Launcher.launch(Unknown Source)
          at com.sun.javaws.Main.launchApp(Unknown Source)
          at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
          at com.sun.javaws.Main$1.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)

          sjoerdbakker added a comment - At the JNLP side I get the following stacktrace (name of slave is "fampc jnlp": com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://localhost:8080/hudson/computer/fampc jnlp/jnlpJars/jnlp-agent.jar at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source) at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source) at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source) at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source) at com.sun.javaws.Launcher.downloadResources(Unknown Source) at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source) at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) at com.sun.javaws.Launcher.launch(Unknown Source) at com.sun.javaws.Main.launchApp(Unknown Source) at com.sun.javaws.Main.continueInSecureThread(Unknown Source) at com.sun.javaws.Main$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

          sjoerdbakker added a comment -

          In the "Wrapped Exception" tab:
          java.io.IOException: Server returned HTTP response code: 505 for URL:
          http://localhost:8080/hudson/computer/fampc jnlp/jnlpJars/jnlp-agent.jar
          at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          at java.lang.reflect.Constructor.newInstance(Unknown Source)
          at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
          at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
          at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
          at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
          at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
          at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
          at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
          at com.sun.javaws.Launcher.downloadResources(Unknown Source)
          at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
          at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
          at com.sun.javaws.Launcher.launch(Unknown Source)
          at com.sun.javaws.Main.launchApp(Unknown Source)
          at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
          at com.sun.javaws.Main$1.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
          Caused by: java.io.IOException: Server returned HTTP response code: 505 for URL:
          http://localhost:8080/hudson/computer/fampc jnlp/jnlpJars/jnlp-agent.jar
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
          at java.net.HttpURLConnection.getResponseCode(Unknown Source)
          ... 18 more

          sjoerdbakker added a comment - In the "Wrapped Exception" tab: java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/hudson/computer/fampc jnlp/jnlpJars/jnlp-agent.jar at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source) at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source) at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown Source) at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source) at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source) at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source) at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source) at com.sun.javaws.Launcher.downloadResources(Unknown Source) at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source) at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) at com.sun.javaws.Launcher.launch(Unknown Source) at com.sun.javaws.Main.launchApp(Unknown Source) at com.sun.javaws.Main.continueInSecureThread(Unknown Source) at com.sun.javaws.Main$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/hudson/computer/fampc jnlp/jnlpJars/jnlp-agent.jar at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source) ... 18 more

          sjoerdbakker added a comment -

          To be complete, the JNLP file contains:
          <jnlp codebase="http://localhost:8080/hudson/computer/fampc jnlp/" spec="1.0+">
          <information>
          <title>Slave Agent for fampc jnlp</title>
          <vendor>Hudson project</vendor>
          <homepage href="https://hudson.dev.java.net/"></homepage>
          </information>
          <security><all-permissions></all-permissions></security>
          <resources>
          <j2se version="1.5"></j2se>
          <jar href="jnlpJars/jnlp-agent.jar"></jar>
          <jar href="jnlpJars/remoting.jar"></jar>
          </resources>
          <application-desc main-class="hudson.jnlp.Main">
          <argument>localhost</argument>
          <argument>http://localhost:8080/hudson/tcpSlaveAgentListener/</argument>

          <argument>8ed670d33358d911f8fe550bd3f0538007fdb0467da445475716a9f6e69f663c</argument>
          <argument>fampc jnlp</argument>
          </application-desc>
          </jnlp>

          sjoerdbakker added a comment - To be complete, the JNLP file contains: <jnlp codebase="http://localhost:8080/hudson/computer/fampc jnlp/" spec="1.0+"> <information> <title>Slave Agent for fampc jnlp</title> <vendor>Hudson project</vendor> <homepage href="https://hudson.dev.java.net/"></homepage> </information> <security><all-permissions></all-permissions></security> <resources> <j2se version="1.5"></j2se> <jar href="jnlpJars/jnlp-agent.jar"></jar> <jar href="jnlpJars/remoting.jar"></jar> </resources> <application-desc main-class="hudson.jnlp.Main"> <argument>localhost</argument> <argument> http://localhost:8080/hudson/tcpSlaveAgentListener/ </argument> <argument>8ed670d33358d911f8fe550bd3f0538007fdb0467da445475716a9f6e69f663c</argument> <argument>fampc jnlp</argument> </application-desc> </jnlp>

          sjoerdbakker added a comment -

          Additional: My default JDK is 1.6.0 (so the new webstart is running)

          sjoerdbakker added a comment - Additional: My default JDK is 1.6.0 (so the new webstart is running)

          I think this is a bug in JNLP. The .jnlp file is an XML file, so URLs in there
          should be considered as a sequence of Unicode code points, thus any character
          should be legal (as in xs:anyURI.) Java Web Start launcher is responsible for
          escaping them when it sends URL to an Unicode-unsafe channel (that is HTTP request.)

          Anyway, I fixed this in 1.85 by having Hudson escape any non-ASCII character.

          Kohsuke Kawaguchi added a comment - I think this is a bug in JNLP. The .jnlp file is an XML file, so URLs in there should be considered as a sequence of Unicode code points, thus any character should be legal (as in xs:anyURI.) Java Web Start launcher is responsible for escaping them when it sends URL to an Unicode-unsafe channel (that is HTTP request.) Anyway, I fixed this in 1.85 by having Hudson escape any non-ASCII character.

            Unassigned Unassigned
            sjoerdbakker sjoerdbakker
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: