During fixing of JENKINS-34669 I've discovered that Jenkins 2.1 bundles the obsolete version of jenkins-js-builder. The last release version is 0.0.51, but Jenkins core still bundles 0.0.40. It means the core does not get patches like this one: https://github.com/tfennelly/jenkins-js-modules/commit/dd98ceefcc28861b11272214aeb9bc32a3aaae62

      This fix is required to prevent fatal failures on module duplicates

      Background

      We have a plugin, which tweaks Jenkins UI before the startup in order to initialize some stuff (add extra plugins, etc.). So the plugin has an additional UI page. When I bundle this plugin into Jenkins.war, Jenkins 2.0 installation Wizard hangs infinitely.
      
      According to the JS debugger, it happens due to the ""Jenkins global module 'pluginSetupWizard' already registered." error. There are stacktraces for the first and second export operations.
      
      Jenkins WebUI should at least return an error for such failures. Ideally it should be robust agains such "hacks in plugins"
      

        1. hangingInstallationWizard.png
          hangingInstallationWizard.png
          137 kB
        2. firstCall.png
          firstCall.png
          305 kB
        3. secondCall.png
          secondCall.png
          278 kB

          [JENKINS-34676] Duplicate include of pluginSetupWizard.js

          Oleg Nenashev created issue -
          Oleg Nenashev made changes -
          Labels New: jenkins2.0 regression
          Oleg Nenashev made changes -
          Assignee New: Oleg Nenashev [ oleg_nenashev ]
          Oleg Nenashev made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Oleg Nenashev added a comment -

          My plan is to create a patch to https://github.com/jenkinsci/js-modules

          Oleg Nenashev added a comment - My plan is to create a patch to https://github.com/jenkinsci/js-modules

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - https://github.com/jenkinsci/js-modules/pull/1

          Oleg Nenashev added a comment -

          In my case Jenkins uses the version without this patch: https://github.com/jenkinsci/js-modules/commit/dd98ceefcc28861b11272214aeb9bc32a3aaae62 . I'm not sure why...

          Oleg Nenashev added a comment - In my case Jenkins uses the version without this patch: https://github.com/jenkinsci/js-modules/commit/dd98ceefcc28861b11272214aeb9bc32a3aaae62 . I'm not sure why...

          Oleg Nenashev added a comment -

          According to the page sources, pluginSetupWizard.js is being included twice

            <script src="/jenkins/static/671957ce/scripts/yui/cookie/cookie-min.js"></script><script src="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.js" type="text/javascript"></script><link rel="stylesheet" href="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.css" type="text/css" /></head><body data-model-type="jenkins.install.SetupWizard" id="jenkins" class="yui-skin-sam jenkins-2.2-SNAPSHOT (CloudBees Jenkins Enterprise 15.11)" data-version="2.2-SNAPSHOT (CloudBees Jenkins Enterprise 15.11)"><div id="main-panel" style="margin-left: 0;"><a name="skip2content"></a><div class="plugin-setup-wizard-container"></div><script src="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.js" type="text/javascript"></script><link rel="stylesheet" href="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.css" type="text/css" /></div></body></html>
          

          Oleg Nenashev added a comment - According to the page sources, pluginSetupWizard.js is being included twice <script src="/jenkins/static/671957ce/scripts/yui/cookie/cookie-min.js"></script><script src="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.js" type="text/javascript"></script><link rel="stylesheet" href="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.css" type="text/css" /></head><body data-model-type="jenkins.install.SetupWizard" id="jenkins" class="yui-skin-sam jenkins-2.2-SNAPSHOT (CloudBees Jenkins Enterprise 15.11)" data-version="2.2-SNAPSHOT (CloudBees Jenkins Enterprise 15.11)"><div id="main-panel" style="margin-left: 0;"><a name="skip2content"></a><div class="plugin-setup-wizard-container"></div><script src="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.js" type="text/javascript"></script><link rel="stylesheet" href="/jenkins/static/671957ce/jsbundles/pluginSetupWizard.css" type="text/css" /></div></body></html>

          Daniel Beck added a comment -

          Daniel Beck added a comment - JENKINS-34669 ?

          Oleg Nenashev added a comment -

          According to the clarification from recena, these issues are not duplicates. This one is rather about an unflexible behavior of js-modules. But yes, fix of JENKINS-34669 should also solve it for the default core. IIRC tfennelly is working on it

          Oleg Nenashev added a comment - According to the clarification from recena , these issues are not duplicates. This one is rather about an unflexible behavior of js-modules. But yes, fix of JENKINS-34669 should also solve it for the default core. IIRC tfennelly is working on it

            recena Manuel Recena Soto
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: