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

Work around javaws incorrectly putting quotes into the PATH environment variable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: remoting
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Last week I was tracking down an issue where I would get a PATH which looked
      like this:

      Path=C:\Windows\system32;...;"C:\Program Files\Java\jdk1.6.0_06\bin"

      The problem is the quotes - they caused a batch file somewhere deep in the build
      to break because the batch file (correctly!) quoted the %Path%.

      I put tracing info all over the place, and it turned out that this was already
      present at the time the slave was started via Java WebStart, so javaws must be
      the culprit. If you launch it from a command prompt where the quotes are not
      present, they are present by the time the slave starts up, and all goes to ****.

      The workaround for us was to hack EnvVars to strip quotes from that variable
      when it creates the initial one.

        Attachments

          Activity

          Hide
          ksmyth ksmyth added a comment -

          Is there a reason not to apply this patch, at least for Windows? Double quote is a disallowed character in file paths. %PATH% is semicolon delimited, so it should never contain double quotes.

          Show
          ksmyth ksmyth added a comment - Is there a reason not to apply this patch, at least for Windows? Double quote is a disallowed character in file paths. %PATH% is semicolon delimited, so it should never contain double quotes.
          Hide
          radzaw rad zaw added a comment -

          This bug still exists ! When I try to call Windows SDK command line i got error about quotes in PATH :/

          Show
          radzaw rad zaw added a comment - This bug still exists ! When I try to call Windows SDK command line i got error about quotes in PATH :/
          Hide
          wintee David Gibson added a comment -

          Another case of this bug.
          We have encountered it when calling the Microsoft Visual Studio 2010 vcvars.bat startup script.
          It's falling over because Jenkins has added quotes around one of the path elements:

          c:/cygwin/Cygwin.bat -xe C:\Users\comptest\AppData\Local\Temp\hudson3720934425733586645.sh
          PATH=C:\Program Files (x86)\Oracle\JavaFX 2.1 Runtime\bin/bin;C:\Windows\SysWOW64;C:\Program Files (x86)\Internet Explorer;;C:\Python27\;C:\Python27\Scripts;C:\PHP\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;%APPDATA%\Python\Scripts;"C:\Program Files (x86)\Oracle\JavaFX 2.1 Runtime\bin"

          This is a real headache as it's not evident in the shell when I invoke the cmd myself, so it looks as though it's being passed in by the jar.

          Show
          wintee David Gibson added a comment - Another case of this bug. We have encountered it when calling the Microsoft Visual Studio 2010 vcvars.bat startup script. It's falling over because Jenkins has added quotes around one of the path elements: c:/cygwin/Cygwin.bat -xe C:\Users\comptest\AppData\Local\Temp\hudson3720934425733586645.sh PATH=C:\Program Files (x86)\Oracle\JavaFX 2.1 Runtime\bin/bin;C:\Windows\SysWOW64;C:\Program Files (x86)\Internet Explorer;;C:\Python27\;C:\Python27\Scripts;C:\PHP\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;%APPDATA%\Python\Scripts;"C:\Program Files (x86)\Oracle\JavaFX 2.1 Runtime\bin" This is a real headache as it's not evident in the shell when I invoke the cmd myself, so it looks as though it's being passed in by the jar.
          Hide
          alex_okrushko Alex Okrushko added a comment -

          This bug still exists.

          Show
          alex_okrushko Alex Okrushko added a comment - This bug still exists.
          Hide
          estyrke Emil Styrke added a comment -

          Just got bitten by this. My workaround is the same as ksmyth's: launch headless, without javaws.

          Show
          estyrke Emil Styrke added a comment - Just got bitten by this. My workaround is the same as ksmyth's: launch headless, without javaws.

            People

            • Assignee:
              kktest3 Kohsuke Kawaguchi
              Reporter:
              trejkaz trejkaz
            • Votes:
              7 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated: