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

Quoting Issue with JDK Installer with Windows Slave

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • Hudson 1.342 on Windows XP Master w/ Windows XP Slaves

    Description

      When installing a new JDK on a windows slave, there appears to be a quoting issue with the arguments passed to the installer. From the console output:

      [jdk-1.6.0_17] $ C:\hudson-tmp\tools\jdk-1.6.0_17\jdk.exe /s '/v/qn REBOOT=Suppress INSTALLDIR=\"C:\hudson-tmp\tools\jdk-1.6.0_17\" /L \"C:\hudson-tmp\tools\jdk-1.6.0_17\jdk.exe.install.log\"'

      Notice how the /s is outside of the single quotes where the rest of the options are (/v/qn ...). Comments in the WINDOWS case of JDKInstaller.java#install seem to indicate that the options to the installer should be passed as one string. However, the code adds two strings - one for /s and another for the rest of the options.

      The result is that the jdk fails to install. However, executing C:\hudson-tmp\tools\jdk-1.6.0_17\jdk.exe /s /v/qn REBOOT=Suppress INSTALLDIR=\"C:\hudson-tmp\tools\jdk-1.6.0_17\" /L \"C:\hudson-tmp\tools\jdk-1.6.0_17\jdk.exe.install.log\" on a command prompt successfully installs the JDK.

      Attachments

        Issue Links

          Activity

            This weird quoting rules are as illustrated in http://java.sun.com/j2se/1.5.0/sdksilent.html

            In your syntax, you have the double-quote escaped — is that intended or is it a mistake?

            kohsuke Kohsuke Kawaguchi added a comment - This weird quoting rules are as illustrated in http://java.sun.com/j2se/1.5.0/sdksilent.html In your syntax, you have the double-quote escaped — is that intended or is it a mistake?
            ashlux ashlux added a comment - - edited

            I have the same issue. When I run the command shown in the hudson console log I get a "Windows Installer" dialog that pops up showing the syntax. The command Hudson is executing:

            c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe /s '/v/qn REBOOT=Suppress INSTALLDIR=\"c:\hudson-slave\tools\JDK_6_Update_21\" /L \"c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe.install.log\"'

            When I remove the single quotes it goes away however nothing happens:

            c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe /s /v/qn REBOOT=Suppress INSTALLDIR=\"c:\hudson-slave\tools\JDK_6_Update_21\" /L \"c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe.install.log\"

            I added "cmd /w" as the document kohsuke linked and it still does nothing:

            cmd /w c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe /s '/v/qn REBOOT=Suppress INSTALLDIR=\"c:\hudson-slave\tools\JDK_6_Update_21\" /L \"c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe.install.log\"'

            As a workaround, I setup a JDK just for the windows slave and installed the JDK manually. This isn't going to work for everyone but it'll work for my purposes.

            I also tried JDK 6 Update 20 and Update 10 and got the same results. Also Hudson 1.367 and 1.365. For what it matters, Windows 2003 Server .

            ashlux ashlux added a comment - - edited I have the same issue. When I run the command shown in the hudson console log I get a "Windows Installer" dialog that pops up showing the syntax. The command Hudson is executing: c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe /s '/v/qn REBOOT=Suppress INSTALLDIR=\"c:\hudson-slave\tools\JDK_6_Update_21\" /L \"c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe.install.log\"' When I remove the single quotes it goes away however nothing happens: c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe /s /v/qn REBOOT=Suppress INSTALLDIR=\"c:\hudson-slave\tools\JDK_6_Update_21\" /L \"c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe.install.log\" I added "cmd /w" as the document kohsuke linked and it still does nothing: cmd /w c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe /s '/v/qn REBOOT=Suppress INSTALLDIR=\"c:\hudson-slave\tools\JDK_6_Update_21\" /L \"c:/hudson-slave/tools/JDK_6_Update_21/jdk.exe.install.log\"' As a workaround, I setup a JDK just for the windows slave and installed the JDK manually. This isn't going to work for everyone but it'll work for my purposes. I also tried JDK 6 Update 20 and Update 10 and got the same results. Also Hudson 1.367 and 1.365. For what it matters, Windows 2003 Server .
            calculu5 calculu5 added a comment -

            The escaped double-quotes is intended. The quoting of the double-quotes is a verbatim copy of what appears in the "Console Output" for a particular build number.

            calculu5 calculu5 added a comment - The escaped double-quotes is intended. The quoting of the double-quotes is a verbatim copy of what appears in the "Console Output" for a particular build number.
            jqassar Jerry Qassar added a comment - - edited

            Mr. Kawaguchi:

            This problem is also occurring with JDK 7_06 (configuration: Latest Jenkins, Solaris master, Windows 7 32-bit slave). An example from console output for our build is as follows:

            c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /v /qn /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR=\"c:\jenkins\tools\JDK\jdk-1.7.0_06\" results in an msiexec dialog (which means a hung installation).

            Testing indicates that the INSTALLDIR property is the property which is considered invalid. By removing the escapes on the quotes and executing

            c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /v /qn /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR="c:\jenkins\tools\JDK\jdk-1.7.0_06"

            The install completes successfully and we can continue with the build process.

            (EDIT: I don't think this syntax is exactly correct, either, as I still ended up with an msiexec process hanging. /v and /qn should no longer be necessary either, and you should be able to do this entirely with:

            c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /L "c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log" REBOOT=ReallySuppress INSTALLDIR="c:\jenkins\tools\JDK\jdk-1.7.0_06"

            with a potential setting of ADDLOCAL for just the source course and other necessary features.)

            The quote escape method used in the original comment, and the spec you mention, are relics from the very old versions of msiexec that were pushed out when JDK 1.5 was new. If you look at the new installers and the pages regarding their use, you can see that a) many of the options are no longer necessary and b) quote escaping for the setting of INSTALLDIR has not been needed for a very long time. It may still be needed for the /L parameter because of the possibility of spaces in your path, but I actually think the quotes are enough now.

            In any case, it seems like the single quotes have been removed from the installer call, but not the escapes. Without one, you really shouldn't need the other.

            jqassar Jerry Qassar added a comment - - edited Mr. Kawaguchi: This problem is also occurring with JDK 7_06 (configuration: Latest Jenkins, Solaris master, Windows 7 32-bit slave). An example from console output for our build is as follows: c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /v /qn /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR=\"c:\jenkins\tools\JDK\jdk-1.7.0_06\" results in an msiexec dialog (which means a hung installation). Testing indicates that the INSTALLDIR property is the property which is considered invalid. By removing the escapes on the quotes and executing c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /v /qn /L \"c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log\" REBOOT=ReallySuppress INSTALLDIR="c:\jenkins\tools\JDK\jdk-1.7.0_06" The install completes successfully and we can continue with the build process. (EDIT: I don't think this syntax is exactly correct, either, as I still ended up with an msiexec process hanging. /v and /qn should no longer be necessary either, and you should be able to do this entirely with: c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe /s /L "c:\jenkins\tools\JDK\jdk-1.7.0_06\jdk.exe.install.log" REBOOT=ReallySuppress INSTALLDIR="c:\jenkins\tools\JDK\jdk-1.7.0_06" with a potential setting of ADDLOCAL for just the source course and other necessary features.) The quote escape method used in the original comment, and the spec you mention, are relics from the very old versions of msiexec that were pushed out when JDK 1.5 was new. If you look at the new installers and the pages regarding their use, you can see that a) many of the options are no longer necessary and b) quote escaping for the setting of INSTALLDIR has not been needed for a very long time. It may still be needed for the /L parameter because of the possibility of spaces in your path, but I actually think the quotes are enough now. In any case, it seems like the single quotes have been removed from the installer call, but not the escapes. Without one, you really shouldn't need the other.
            jqassar Jerry Qassar added a comment -

            Another possibility to look at would be to use /norestart rather than REBOOT=ReallySuppress.

            jqassar Jerry Qassar added a comment - Another possibility to look at would be to use /norestart rather than REBOOT=ReallySuppress.
            cowwoc cowwoc added a comment -

            This issue also occurs on a Windows master. This bug report is almost 3 years old. Please fix this!

            cowwoc cowwoc added a comment - This issue also occurs on a Windows master. This bug report is almost 3 years old. Please fix this!
            sogabe sogabe added a comment - created pull request https://github.com/jenkinsci/jenkins/pull/657
            robtechstuff Rob Techstuff added a comment -

            Glad to see that this has been fixed. What needs to be done to get the fix into the next LTS version? Our Jenkins build farm runs both Linux and Windows slaves, and this problem forces us to manually install and configure OS-specific JDK versions on all slaves.

            Thanks.

            robtechstuff Rob Techstuff added a comment - Glad to see that this has been fixed. What needs to be done to get the fix into the next LTS version? Our Jenkins build farm runs both Linux and Windows slaves, and this problem forces us to manually install and configure OS-specific JDK versions on all slaves. Thanks.
            hp Halvor Platou added a comment -

            Any chance of getting this into the release soon? Looks like the pull request is still open.

            hp Halvor Platou added a comment - Any chance of getting this into the release soon? Looks like the pull request is still open.
            hp Halvor Platou added a comment -

            Please...

            hp Halvor Platou added a comment - Please...

            Pretty please?

            christophlinder Christoph Linder added a comment - Pretty please?
            deag Diogo Guerra added a comment -

            I've tried @sogabe patch on 1.510 and it works. could you please accept the pull request?

            deag Diogo Guerra added a comment - I've tried @sogabe patch on 1.510 and it works. could you please accept the pull request?

            Code changed in jenkins
            User: Seiji Sogabe
            Path:
            core/src/main/java/hudson/tools/JDKInstaller.java
            http://jenkins-ci.org/commit/jenkins/fd4ccc106f603edfa5818befca271f1400bdbf96
            Log:
            [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Seiji Sogabe Path: core/src/main/java/hudson/tools/JDKInstaller.java http://jenkins-ci.org/commit/jenkins/fd4ccc106f603edfa5818befca271f1400bdbf96 Log: [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave

            Code changed in jenkins
            User: Seiji Sogabe
            Path:
            core/src/main/java/hudson/tools/JDKInstaller.java
            http://jenkins-ci.org/commit/jenkins/c86b6d7055a03db1add27acd4a0159ad7d024c17
            Log:
            Merge pull request #657 from ssogabe/JENKINS-5408

            [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave

            Compare: https://github.com/jenkinsci/jenkins/compare/d33e22d392a3...c86b6d7055a0

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Seiji Sogabe Path: core/src/main/java/hudson/tools/JDKInstaller.java http://jenkins-ci.org/commit/jenkins/c86b6d7055a03db1add27acd4a0159ad7d024c17 Log: Merge pull request #657 from ssogabe/ JENKINS-5408 [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave Compare: https://github.com/jenkinsci/jenkins/compare/d33e22d392a3...c86b6d7055a0
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2452
            [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave (Revision fd4ccc106f603edfa5818befca271f1400bdbf96)

            Result = SUCCESS
            Seiji Sogabe : fd4ccc106f603edfa5818befca271f1400bdbf96
            Files :

            • core/src/main/java/hudson/tools/JDKInstaller.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2452 [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave (Revision fd4ccc106f603edfa5818befca271f1400bdbf96) Result = SUCCESS Seiji Sogabe : fd4ccc106f603edfa5818befca271f1400bdbf96 Files : core/src/main/java/hudson/tools/JDKInstaller.java

            Code changed in jenkins
            User: Seiji Sogabe
            Path:
            core/src/main/java/hudson/tools/JDKInstaller.java
            http://jenkins-ci.org/commit/jenkins/9976bdfe18fdc5900064799448b49a6f5414b294
            Log:
            [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave
            (cherry picked from commit fd4ccc106f603edfa5818befca271f1400bdbf96)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Seiji Sogabe Path: core/src/main/java/hudson/tools/JDKInstaller.java http://jenkins-ci.org/commit/jenkins/9976bdfe18fdc5900064799448b49a6f5414b294 Log: [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave (cherry picked from commit fd4ccc106f603edfa5818befca271f1400bdbf96)

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            http://jenkins-ci.org/commit/jenkins/47c122063cb2659e394ffd1e9260656e8ae15faf
            Log:
            Merge pull request #657 from ssogabe/JENKINS-5408

            [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave

            Cherry-picked-from: c86b6d7055a03db1add27acd4a0159ad7d024c17

            Compare: https://github.com/jenkinsci/jenkins/compare/f6a4832c5f8c^...47c122063cb2

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: http://jenkins-ci.org/commit/jenkins/47c122063cb2659e394ffd1e9260656e8ae15faf Log: Merge pull request #657 from ssogabe/ JENKINS-5408 [FIXED JENKINS-5408] Quoting Issue with JDK Installer with Windows Slave Cherry-picked-from: c86b6d7055a03db1add27acd4a0159ad7d024c17 Compare: https://github.com/jenkinsci/jenkins/compare/f6a4832c5f8c ^...47c122063cb2

            People

              Unassigned Unassigned
              calculu5 calculu5
              Votes:
              6 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: