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

Environment variables with a trailing double quotes are not escaped correctly on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • docker-workflow-plugin
    • None
    • Jenkins Version: 2.274
      Docker Pipeline Plugin: 1.25
      Linux master
      Windows agent
    • 1.28-r2

      Seeing an no output hang at the first step run by a docker agent when there is an environment variable with a value that ends with a double quote.

      Like when the github PR being built has a double quote at the end of it's title.

      https://github.com/jenkinsci/docker-workflow-plugin/pull/220 did fix the issue for double quotes in other positions.

       

      In my case, where only github PR titles were an issue, the following is a workaround.

      env.CHANGE_TITLE = env.CHANGE_TITLE.replaceAll('"','\'')
      

      That prevented the hang that had occurred when the PR title (env.CHANGE_ENV) was

      Checking if "quotes" are correctly ("escaped") "even with trailing ones"

      Note the hang did not occur when PR title (env.CHANGE_ENV) was:

      Checking if "quotes" are correctly ("escaped")
      

       

            p_hampson Paul "TBBle" Hampson
            allenbenz Allen Benz
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: