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

RegExp related Javascript exception on job configuration page

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • Jenkins 1.528

      Upgraded to Jenkins 1.528. Since we upgraded the job configuration page stays in loading state (because of a javascript exception):

      Uncaught SyntaxError: Invalid flags supplied to RegExp constructor 'sonar'
      (anonymous function)
      e.targetUrl hudson-behavior.js:416
      registerValidator hudson-behavior.js:428
      (anonymous function) behavior.js:111
      (anonymous function) behavior.js:107
      Behaviour.applySubtree behavior.js:93
      Behaviour.apply behavior.js:76
      (anonymous function) behavior.js:71
      window.onload behavior.js:125
      

      The URL path for this exception is /job/sonar-analyse/configure. We have this issue on all jobs.

          [JENKINS-19323] RegExp related Javascript exception on job configuration page

          Ean Rollings added a comment -

          I am experiencing the same after upgrading. It is because of the hyphen in the project name.

          I think I've tracked it down to this URI:

          '/view/enterprise/job/my-project-name-with-hypens/descriptorByName/jenkins.plugins.publish_over_ssh.BapSshTransfer/checkExecCommand'

          It should probably be this instead:

          '/view/enterprise/job/' + encodeURIComponent('my-project-name-with-hypens') + '/descriptorByName/jenkins.plugins.publish_over_ssh.BapSshTransfer/checkExecCommand'

          Ean Rollings added a comment - I am experiencing the same after upgrading. It is because of the hyphen in the project name. I think I've tracked it down to this URI: '/view/enterprise/job/my-project-name-with-hypens/descriptorByName/jenkins.plugins.publish_over_ssh.BapSshTransfer/checkExecCommand' It should probably be this instead: '/view/enterprise/job/' + encodeURIComponent('my-project-name-with-hypens') + '/descriptorByName/jenkins.plugins.publish_over_ssh.BapSshTransfer/checkExecCommand'

          Ondrej Kupka added a comment -

          It is happening to us too, and there are no hyphens in the project name.

          Ondrej Kupka added a comment - It is happening to us too, and there are no hyphens in the project name.

          Ondrej Kupka added a comment -

          I tried a quick fix by putting

          if (url.indexOf("'") == -1) url = "'" + url + "'";

          to the place of the exception and although I am not claiming it's correct, it seems to work.

          Ondrej Kupka added a comment - I tried a quick fix by putting if (url.indexOf("'") == -1) url = "'" + url + "'"; to the place of the exception and although I am not claiming it's correct, it seems to work.

          Thanks tchap the quick fix seems to work for us too.

          Stephan Lehmann added a comment - Thanks tchap the quick fix seems to work for us too.

          Hi

          I have the same problem. A downgrade on ubuntu is not possible.

          Do you have a fast fix for me?

          I need this fix because we want configure a lot of Jobs. This is n ot possible at the moment.

          Thank you and Regards,
          Christian

          Christian Hünniger added a comment - Hi I have the same problem. A downgrade on ubuntu is not possible. Do you have a fast fix for me? I need this fix because we want configure a lot of Jobs. This is n ot possible at the moment. Thank you and Regards, Christian

          Ondrej Kupka added a comment -

          The fast fix I posted above seems to work for people, what about your try that as one well, chuenniger? Just find your hudson-behavior.js and add the line to the right spot (somewhere around line 416).

          Regards,
          Ondrej Kupka

          Ondrej Kupka added a comment - The fast fix I posted above seems to work for people, what about your try that as one well, chuenniger ? Just find your hudson-behavior.js and add the line to the right spot (somewhere around line 416). Regards, Ondrej Kupka

          Björn Pedersen added a comment - This seems to be related to https://issues.jenkins-ci.org/browse/JENKINS-19248

          Argh. Sorry pedersen didn't discovered this issue before creating.

          Stephan Lehmann added a comment - Argh. Sorry pedersen didn't discovered this issue before creating.

          Christian Hünniger added a comment - - edited

          @Ondrej Kupka - Thank you. Has helped.

          Christian Hünniger added a comment - - edited @Ondrej Kupka - Thank you. Has helped.

          Jesse Glick added a comment -

          Believed to have been resolved with the fix in JENKINS-19457.

          Jesse Glick added a comment - Believed to have been resolved with the fix in JENKINS-19457 .

            Unassigned Unassigned
            markogerber Stephan Lehmann
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: