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

Cannot configure job if the job name contains single quote

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • Ubuntu 11.10, Google Chrome 17.0.963.79

      Steps:

      1. Create a new job with name of "This won't work" (without double quotes)
      2. Go to the Configure page of the job you have just created

      The page keeps loading and seems to be broken

          [JENKINS-13121] Cannot configure job if the job name contains single quote

          Kieran Shaw added a comment -

          Appears to be here:

          "function registerValidator(e) {
          e.targetElement = findFollowingTR(e, "validation-error-area").firstChild.nextSibling;
          e.targetUrl = function()

          { return eval(this.getAttribute("checkUrl")); }

          ;"

          Where "this.getAttribute("checkUrl")" blows up because checkUrl contains something like: "'/checkDisplayName?displayName='encodeURIComponent(this.value)'&jobName='+encodeURIComponent('Job with single'quote')"

          Kieran Shaw added a comment - Appears to be here: "function registerValidator(e) { e.targetElement = findFollowingTR(e, "validation-error-area").firstChild.nextSibling; e.targetUrl = function() { return eval(this.getAttribute("checkUrl")); } ;" Where "this.getAttribute("checkUrl")" blows up because checkUrl contains something like: "'/checkDisplayName?displayName=' encodeURIComponent(this.value) '&jobName='+encodeURIComponent('Job with single'quote')"

          I have also experienced this issue in our Jenkins 1.478 on Windows Server 2003. I've confirmed the issue in IE, Firefox, Chrome, and Opera.

          David Schamber added a comment - I have also experienced this issue in our Jenkins 1.478 on Windows Server 2003. I've confirmed the issue in IE, Firefox, Chrome, and Opera.

          evernat added a comment -

          I do not reproduce the issue using Jenkins 1.534 and Firefox or Chrome.
          Can we close this?

          evernat added a comment - I do not reproduce the issue using Jenkins 1.534 and Firefox or Chrome. Can we close this?

          Daniel Beck added a comment -

          Cannot reproduce in 1.563. Browser console also shows numerous successful requests that seem related, e.g.

          http://localhost:8080/job/This%20won%27t%20work/descriptorByName/hudson.model.FreeStyleProject/checkAssignedLabelString?value=
          

          Daniel Beck added a comment - Cannot reproduce in 1.563. Browser console also shows numerous successful requests that seem related, e.g. http: //localhost:8080/job/This%20won%27t%20work/descriptorByName/hudson.model.FreeStyleProject/checkAssignedLabelString?value=

          Juhana Harmanen added a comment - - edited

          Env: Jenkins 1.589 on Centos 6.5
          Browser: Chrome 38.0.2125.111 on Windows 8.1

          Problem: Job with a Maven project name containing 'something' in between. For example, Job with a name: CI build and Test 'master' branch

          When trying to re-configure the Job:

          • stalls on Loading (which doesn't actually prevent trying to edit, since not spanning over the whole view)
          • from the failing 404 GET requests one can identify that it appends / char before ' char on some requests. By executing these request directly without the appended / character before the ' char they do work.
          • One can swap through the HTML elements with tab and press to Save (wanted to fix the Job by renaming the project) which produces an Error: JSONObject["scm"] is not a JSONObject

          When trying to Delete Maven Project:

          • Uncaught SyntaxError: Unexpected identifier

          Juhana Harmanen added a comment - - edited Env: Jenkins 1.589 on Centos 6.5 Browser: Chrome 38.0.2125.111 on Windows 8.1 Problem: Job with a Maven project name containing 'something' in between. For example, Job with a name: CI build and Test 'master' branch When trying to re-configure the Job: stalls on Loading (which doesn't actually prevent trying to edit, since not spanning over the whole view) from the failing 404 GET requests one can identify that it appends / char before ' char on some requests. By executing these request directly without the appended / character before the ' char they do work. One can swap through the HTML elements with tab and press to Save (wanted to fix the Job by renaming the project) which produces an Error: JSONObject ["scm"] is not a JSONObject When trying to Delete Maven Project: Uncaught SyntaxError: Unexpected identifier

          Daniel Beck added a comment -

          I can confirm much of what harmia describes on 1.586, except that it's backslashes instead of forward slashes. Most of the impact seems to stem from buggy escaping in the Javascript.

          Daniel Beck added a comment - I can confirm much of what harmia describes on 1.586, except that it's backslashes instead of forward slashes. Most of the impact seems to stem from buggy escaping in the Javascript.

          Kevin Gentile added a comment -

          User error but this may help someone:

          I encountered this issue with Jenkins 2.235.1. In addition to the above, my browser also reported a bad Content Security Policy for some of the resources. I resolved this by removing the Content-Security-Policy header in my reverse proxy config, instead letting Jenkins handle this header. 

          Kevin Gentile added a comment - User error but this may help someone: I encountered this issue with Jenkins 2.235.1. In addition to the above, my browser also reported a bad Content Security Policy for some of the resources. I resolved this by removing the Content-Security-Policy header in my reverse proxy config, instead letting Jenkins handle this header. 

            Unassigned Unassigned
            julienarchille jul
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: