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

Work around javaws incorrectly putting quotes into the PATH environment variable

    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

          trejkaz trejkaz created issue -
          Hide
          trejkaz trejkaz added a comment -

          Created an attachment (id=647)
          Our solution to the problem (a hack, to be honest)

          Show
          trejkaz trejkaz added a comment - Created an attachment (id=647) Our solution to the problem (a hack, to be honest)
          Hide
          trejkaz trejkaz added a comment -

          I'm sure there is probably a better solution to this, but I've put the patch
          here anyway.

          One other thing that remains an unknown is whether this also happens for *nix.

          Show
          trejkaz trejkaz added a comment - I'm sure there is probably a better solution to this, but I've put the patch here anyway. One other thing that remains an unknown is whether this also happens for *nix.
          Hide
          trejkaz trejkaz added a comment -
          Show
          trejkaz trejkaz added a comment - Upstream bug record: http://bugs.sun.com/view_bug.do?bug_id=6715800
          Hide
          sits sits added a comment -

          This issue affects me too. Can we get this patch applied?

          Show
          sits sits added a comment - This issue affects me too. Can we get this patch applied?
          Hide
          sits sits added a comment -

          Adding myself as a Cc.

          Show
          sits sits added a comment - Adding myself as a Cc.
          Hide
          ksmyth ksmyth added a comment -

          Another workaround: launch headlessly as in http://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds

          Show
          ksmyth ksmyth added a comment - Another workaround: launch headlessly as in http://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds
          Hide
          ksmyth ksmyth added a comment -

          Another workaround: at the beginning of a "Execute Windows batch command":
          set PATH=%PATH:"=%

          (Of course, this only affects that build step)

          Show
          ksmyth ksmyth added a comment - Another workaround: at the beginning of a "Execute Windows batch command": set PATH=%PATH:"=% (Of course, this only affects that build step)
          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 :/
          radzaw rad zaw made changes -
          Field Original Value New Value
          Issue Type Improvement [ 4 ] Bug [ 1 ]
          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.
          alex_okrushko Alex Okrushko made changes -
          Assignee Kohsuke Kawaguchi [ kktest3 ]
          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.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 133498 ] JNJira + In-Review [ 174038 ]

            People

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

              Dates

              • Created:
                Updated: