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

JS error on MBPL configuration for GitHub branch source

      1. Create a new multi-branch pipeline
      2. Under "Branch Sources", click "GitHub"
      TypeError: inputTbody.childNodes[4] is undefined
          findNeighboringDynamicInput http://localhost:8080/plugin/github-branch-source/github-scm-source.js:25
          <anonymous> http://localhost:8080/plugin/github-branch-source/github-scm-source.js:30
          applySubtree http://localhost:8080/static/7e7618a8/scripts/behavior.js:116
          applySubtree http://localhost:8080/static/7e7618a8/scripts/behavior.js:111
          applySubtree http://localhost:8080/static/7e7618a8/scripts/behavior.js:93
          <anonymous> http://localhost:8080/adjuncts/7e7618a8/lib/form/hetero-list/hetero-list.js:110    renderOnDemand http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:684
          next http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:723
          onreadystatechange http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2850
          loadScript http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2846
          evalInnerHtmlScripts http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:701
          next http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:723
          onreadystatechange http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2850
          loadScript http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2846
          evalInnerHtmlScripts http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:701
          next http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:723
          onreadystatechange http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2850
          loadScript http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2846
          evalInnerHtmlScripts http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:701
          next http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:723
          evalInnerHtmlScripts http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:706
          next http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:723
          onreadystatechange http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2850
          loadScript http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:2846
          evalInnerHtmlScripts http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:701
          next http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:723
          sequencer http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:726
          evalInnerHtmlScripts http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:711
          renderOnDemand http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:682
          onSuccess http://localhost:8080/adjuncts/7e7618a8/org/kohsuke/stapler/bind.js:57
          respondToReadyState http://localhost:8080/static/7e7618a8/scripts/prototype.js:1657
          onStateChange http://localhost:8080/static/7e7618a8/scripts/prototype.js:1600
          bind http://localhost:8080/static/7e7618a8/scripts/prototype.js:414
          request http://localhost:8080/static/7e7618a8/scripts/prototype.js:1581
          initialize http://localhost:8080/static/7e7618a8/scripts/prototype.js:1550
          wrap http://localhost:8080/static/7e7618a8/scripts/prototype.js:452
          klass http://localhost:8080/static/7e7618a8/scripts/prototype.js:101
          methodName http://localhost:8080/adjuncts/7e7618a8/org/kohsuke/stapler/bind.js:48
          renderOnDemand http://localhost:8080/static/7e7618a8/scripts/hudson-behavior.js:661
          <anonymous> http://localhost:8080/adjuncts/7e7618a8/lib/form/hetero-list/hetero-list.js:56
          notify http://localhost:8080/static/7e7618a8/scripts/yui/event/event-min.js:7
          fire http://localhost:8080/static/7e7618a8/scripts/yui/event/event-min.js:7
          e http://localhost:8080/static/7e7618a8/scripts/yui/menu/menu-min.js:7 

      Visible impact: It's not possible to add a new entry under "Behaviors", such as "Discover tags".

          [JENKINS-64328] JS error on MBPL configuration for GitHub branch source

          Devin Nusbaum added a comment -

          timja Just a heads up, but from what I can tell you still cannot configure behaviors for newly-created GitHub branch sources even after https://github.com/jenkinsci/github-branch-source-plugin/pull/360 (although the console error listed in the Jira ticket is gone). If you reconfigure an existing GitHub branch source, then you can add new behaviors, but if you create a new multibranch project and add a new GitHub branch source, you cannot add behaviors until after you save the branch source. Notably, I see the same behavior for Git branch sources, which suggests that something is wrong in branch-api or maybe scm-api, but I'm not sure.

          Devin Nusbaum added a comment - timja Just a heads up, but from what I can tell you still cannot configure behaviors for newly-created GitHub branch sources even after https://github.com/jenkinsci/github-branch-source-plugin/pull/360 (although the console error listed in the Jira ticket is gone). If you reconfigure an existing GitHub branch source, then you can add new behaviors, but if you create a new multibranch project and add a new GitHub branch source, you cannot add behaviors until after you save the branch source. Notably, I see the same behavior for Git branch sources, which suggests that something is wrong in branch-api or maybe scm-api , but I'm not sure.

          Tim Jacomb added a comment -

          Is that with a minimal plugin set? Last I tested this it did work on that pull request, maybe another plugin is causing the issue

          Tim Jacomb added a comment - Is that with a minimal plugin set? Last I tested this it did work on that pull request, maybe another plugin is causing the issue

          Devin Nusbaum added a comment -

          That is with mvn hpi:run from the current master branch of github-branch-source and no other plugins. The key thing seems to be that it only happens before the branch source is saved. If you reconfigure a source that has been saved, everything works.

          Also to clarify, I think the PR does help, because it fixes the error in the description of the ticket, it's just that something else seems to be wrong as well.

          Devin Nusbaum added a comment - That is with mvn hpi:run from the current master branch of github-branch-source and no other plugins. The key thing seems to be that it only happens before the branch source is saved. If you reconfigure a source that has been saved, everything works. Also to clarify, I think the PR does help, because it fixes the error in the description of the ticket, it's just that something else seems to be wrong as well.

          Tim Jacomb added a comment - - edited

          Reproduced, and yeah well that explains why I missed it .

          I would have been re-configuring the same one over again I expect.

          Workaround till we figure out what's going on:
          1. Create the multi branch project
          2. Add the SCM configuration
          3. Save
          4. Click configure
          5. You can now add behaviours

          Ok, I found what is likely the cause, there's 3 table elements in the page when you add the github SCM

          1. Discover branches behaviour
          2. Discover pull requests from origin
          3. Discover pull requests from forks

          and I haven't been able to find where those are coming from =/

          and after saving the table elements are gone and they are in their proper elements, weird...

          From what I can tell it's not the github branch source plugin causing it, each plugin installed needs to be checked, (I don't have time right now to look at it any more)

          Tim Jacomb added a comment - - edited Reproduced, and yeah well that explains why I missed it . I would have been re-configuring the same one over again I expect. Workaround till we figure out what's going on: 1. Create the multi branch project 2. Add the SCM configuration 3. Save 4. Click configure 5. You can now add behaviours Ok, I found what is likely the cause, there's 3 table elements in the page when you add the github SCM 1. Discover branches behaviour 2. Discover pull requests from origin 3. Discover pull requests from forks and I haven't been able to find where those are coming from =/ and after saving the table elements are gone and they are in their proper elements, weird... From what I can tell it's not the github branch source plugin causing it, each plugin installed needs to be checked, (I don't have time right now to look at it any more)

          Devin Nusbaum added a comment -

          Those three table elements are the default traits/behaviors for GitHubSCMSource, and the most relevant file seems like traits.jelly in scm-api Maybe the issue has to do with the use of the divBasedFormLayout variable in traits.jelly when that taglib is used by other plugins? We could try replacing https://github.com/jenkinsci/scm-api-plugin/pull/82 with a PR that bumps the minimum Jenkins version and switches to just always using divs to see if that helps.

          Devin Nusbaum added a comment - Those three table elements are the default traits/behaviors for GitHubSCMSource , and the most relevant file seems like traits.jelly in scm-api Maybe the issue has to do with the use of the divBasedFormLayout variable in traits.jelly when that taglib is used by other plugins? We could try replacing https://github.com/jenkinsci/scm-api-plugin/pull/82 with a PR that bumps the minimum Jenkins version and switches to just always using divs to see if that helps.

          Tim Jacomb added a comment - - edited

          this is probably fixed in 2.271 with https://github.com/jenkinsci/jenkins/pull/5075

          you got time to re-check on that version / latest weekly?

          Tim Jacomb added a comment - - edited this is probably fixed in 2.271 with https://github.com/jenkinsci/jenkins/pull/5075 you got time to re-check on that version / latest weekly?

          Devin Nusbaum added a comment -

          Sure will do, although it will be a few hours before I have time to check. Thanks!

          Devin Nusbaum added a comment - Sure will do, although it will be a few hours before I have time to check. Thanks!

          Devin Nusbaum added a comment -

          timja I tested with 2.274 and everything worked, so yeah https://github.com/jenkinsci/jenkins/pull/5075 probably fixed it. Thanks!

          Devin Nusbaum added a comment - timja I tested with 2.274 and everything worked, so yeah https://github.com/jenkinsci/jenkins/pull/5075 probably fixed it. Thanks!

          Tim Jacomb added a comment -

          Cool we should probably bump the minimum version then

          Tim Jacomb added a comment - Cool we should probably bump the minimum version then

          timja Should this be closed as it seems released in github-branch-source:2.9.4 ?

          Allan BURDAJEWICZ added a comment - timja Should this be closed as it seems released in github-branch-source:2.9.4 ?

            timja Tim Jacomb
            danielbeck Daniel Beck
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: