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

RegExp related Javascript exception on job configuration page

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            ean 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 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'
            tchap Ondrej Kupka added a comment -

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

            tchap Ondrej Kupka added a comment - It is happening to us too, and there are no hyphens in the project name.
            tchap 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.

            tchap 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.

            markogerber 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

            chuenniger 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
            tchap 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

            tchap 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
            pedersen 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.

            markogerber Stephan Lehmann added a comment - Argh. Sorry pedersen didn't discovered this issue before creating.
            chuenniger Christian Hünniger added a comment - - edited

            @Ondrej Kupka - Thank you. Has helped.

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

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

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

            People

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

              Dates

                Created:
                Updated:
                Resolved: