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

Duplicate include of pluginSetupWizard.js

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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"
      

        Attachments

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

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

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

            Show
            oleg_nenashev Oleg Nenashev added a comment - My plan is to create a patch to https://github.com/jenkinsci/js-modules
            Show
            oleg_nenashev Oleg Nenashev added a comment - https://github.com/jenkinsci/js-modules/pull/1
            Hide
            oleg_nenashev 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...

            Show
            oleg_nenashev 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...
            Hide
            oleg_nenashev 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>
            
            Show
            oleg_nenashev 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>
            Hide
            danielbeck Daniel Beck added a comment -
            Show
            danielbeck Daniel Beck added a comment - JENKINS-34669 ?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            According to the clarification from Manuel Recena Soto, 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 Tom FENNELLY is working on it

            Show
            oleg_nenashev Oleg Nenashev added a comment - According to the clarification from Manuel Recena Soto , 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 Tom FENNELLY is working on it
            Hide
            tfennelly Tom FENNELLY added a comment -

            Hmmm how are these not duplicates? IOW ... what's the remaining issue once I fix JENKINS-34669 ?

            Show
            tfennelly Tom FENNELLY added a comment - Hmmm how are these not duplicates? IOW ... what's the remaining issue once I fix JENKINS-34669 ?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I think we need to upgrade js-modules. It should also prevent hanging on similar cases

            Show
            oleg_nenashev Oleg Nenashev added a comment - I think we need to upgrade js-modules. It should also prevent hanging on similar cases
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I'll rephrase the issue

            Show
            oleg_nenashev Oleg Nenashev added a comment - I'll rephrase the issue
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Daniel Beck Tom FENNELLY
            Is it better now?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Daniel Beck Tom FENNELLY Is it better now?
            Hide
            tfennelly Tom FENNELLY added a comment -

            But the root cause issue is that there are duplicate .js files on the page. The js-modules that's in use there will work fine so long as there are not multiple .js files trying to export to the same namespace.

            Show
            tfennelly Tom FENNELLY added a comment - But the root cause issue is that there are duplicate .js files on the page. The js-modules that's in use there will work fine so long as there are not multiple .js files trying to export to the same namespace.
            Hide
            tfennelly Tom FENNELLY added a comment -

            Keith Zantow has agreed to resolve the underlying issue as part of https://github.com/jenkinsci/jenkins/pull/2281

            b5576a7 might be the commit, but need to check with Keith.

            Show
            tfennelly Tom FENNELLY added a comment - Keith Zantow has agreed to resolve the underlying issue as part of https://github.com/jenkinsci/jenkins/pull/2281 b5576a7 might be the commit, but need to check with Keith.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: kzantow
            Path:
            core/src/main/java/hudson/PluginManager.java
            core/src/main/java/jenkins/install/InstallState.java
            core/src/main/java/jenkins/install/InstallStateFilter.java
            core/src/main/java/jenkins/install/InstallUtil.java
            core/src/main/java/jenkins/install/SetupWizard.java
            core/src/main/java/jenkins/install/UpgradeWizard.java
            core/src/main/java/jenkins/model/Jenkins.java
            core/src/main/resources/hudson/security/GlobalSecurityConfiguration/index.groovy
            core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token.jelly
            core/src/main/resources/jenkins/install/SetupWizard/client-scripts.jelly
            core/src/main/resources/jenkins/install/SetupWizard/footer.jelly
            core/src/main/resources/jenkins/install/SetupWizard/index.jelly
            core/src/main/resources/jenkins/install/SetupWizard/wizard-ui.jelly
            core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts.jelly
            core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts.properties
            core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts_fr.properties
            core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts_lt.properties
            core/src/main/resources/jenkins/install/UpgradeWizard/footer.jelly
            core/src/main/resources/jenkins/install/UpgradeWizard/footer.properties
            core/src/main/resources/jenkins/install/UpgradeWizard/footer_fr.properties
            core/src/main/resources/jenkins/install/UpgradeWizard/footer_lt.properties
            core/src/main/resources/jenkins/install/pluginSetupWizard.properties
            core/src/main/resources/jenkins/model/Jenkins/login.jelly
            core/src/main/resources/jenkins/model/Jenkins/loginError.jelly
            core/src/main/resources/lib/layout/html.jelly
            test/src/test/java/jenkins/install/InstallUtilTest.java
            test/src/test/java/jenkins/install/SetupWizardTest.java
            test/src/test/java/jenkins/install/UpgradeWizardTest.java
            test/src/test/java/jenkins/util/SystemPropertiesTest.java
            war/gulpfile.js
            war/src/main/js/api/pluginManager.js
            war/src/main/js/pluginSetupWizardGui.js
            war/src/main/js/templates/pluginSelectList.hbs
            war/src/main/js/templates/pluginSelectionPanel.hbs
            war/src/main/js/templates/successPanel.hbs
            war/src/main/js/templates/upgradePanel.hbs
            war/src/main/js/templates/upgradeSkippedPanel.hbs
            war/src/main/js/templates/upgradeSuccessPanel.hbs
            war/src/main/js/upgradeWizard.js
            war/src/main/js/util/jenkins.js
            war/src/main/less/pluginSetupWizard.less
            war/src/main/webapp/WEB-INF/web.xml
            war/src/main/webapp/css/style.css
            war/src/test/js/pluginSetupWizard-spec.js
            http://jenkins-ci.org/commit/jenkins/89a24abcb0eabc36c7281979d1620c92b6a128a9
            Log:
            [FIX JENKINS-33663] - Upgrade wizard

            Add Upgrade Wizard
            Add 'replace' handlebars method in jenkins.js
            Fix state transitions to follow a single basic pattern
            Suggested plugins selected by default
            Add an install state for INITIAL_SECURITY_SETUP
            Removed duplicate setupWizard.js on page [FIX JENKINS-34676]
            Exclude plugins which are already installed when determining platform
            Change 'snooze' to not look like a 'close' button
            Make sure unlock screen doesn't show up after new install
            Add compatibility check when offering suggested plugins
            More appropriate handling of security token filter

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: kzantow Path: core/src/main/java/hudson/PluginManager.java core/src/main/java/jenkins/install/InstallState.java core/src/main/java/jenkins/install/InstallStateFilter.java core/src/main/java/jenkins/install/InstallUtil.java core/src/main/java/jenkins/install/SetupWizard.java core/src/main/java/jenkins/install/UpgradeWizard.java core/src/main/java/jenkins/model/Jenkins.java core/src/main/resources/hudson/security/GlobalSecurityConfiguration/index.groovy core/src/main/resources/jenkins/install/SetupWizard/authenticate-security-token.jelly core/src/main/resources/jenkins/install/SetupWizard/client-scripts.jelly core/src/main/resources/jenkins/install/SetupWizard/footer.jelly core/src/main/resources/jenkins/install/SetupWizard/index.jelly core/src/main/resources/jenkins/install/SetupWizard/wizard-ui.jelly core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts.jelly core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts.properties core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts_fr.properties core/src/main/resources/jenkins/install/UpgradeWizard/client-scripts_lt.properties core/src/main/resources/jenkins/install/UpgradeWizard/footer.jelly core/src/main/resources/jenkins/install/UpgradeWizard/footer.properties core/src/main/resources/jenkins/install/UpgradeWizard/footer_fr.properties core/src/main/resources/jenkins/install/UpgradeWizard/footer_lt.properties core/src/main/resources/jenkins/install/pluginSetupWizard.properties core/src/main/resources/jenkins/model/Jenkins/login.jelly core/src/main/resources/jenkins/model/Jenkins/loginError.jelly core/src/main/resources/lib/layout/html.jelly test/src/test/java/jenkins/install/InstallUtilTest.java test/src/test/java/jenkins/install/SetupWizardTest.java test/src/test/java/jenkins/install/UpgradeWizardTest.java test/src/test/java/jenkins/util/SystemPropertiesTest.java war/gulpfile.js war/src/main/js/api/pluginManager.js war/src/main/js/pluginSetupWizardGui.js war/src/main/js/templates/pluginSelectList.hbs war/src/main/js/templates/pluginSelectionPanel.hbs war/src/main/js/templates/successPanel.hbs war/src/main/js/templates/upgradePanel.hbs war/src/main/js/templates/upgradeSkippedPanel.hbs war/src/main/js/templates/upgradeSuccessPanel.hbs war/src/main/js/upgradeWizard.js war/src/main/js/util/jenkins.js war/src/main/less/pluginSetupWizard.less war/src/main/webapp/WEB-INF/web.xml war/src/main/webapp/css/style.css war/src/test/js/pluginSetupWizard-spec.js http://jenkins-ci.org/commit/jenkins/89a24abcb0eabc36c7281979d1620c92b6a128a9 Log: [FIX JENKINS-33663] - Upgrade wizard Add Upgrade Wizard Add 'replace' handlebars method in jenkins.js Fix state transitions to follow a single basic pattern Suggested plugins selected by default Add an install state for INITIAL_SECURITY_SETUP Removed duplicate setupWizard.js on page [FIX JENKINS-34676] Exclude plugins which are already installed when determining platform Change 'snooze' to not look like a 'close' button Make sure unlock screen doesn't show up after new install Add compatibility check when offering suggested plugins More appropriate handling of security token filter
            Hide
            recena Manuel Recena Soto added a comment -

            Keith Zantow Do you think this issue should be updated?

            Show
            recena Manuel Recena Soto added a comment - Keith Zantow Do you think this issue should be updated?
            Hide
            kzantow Keith Zantow added a comment -

            Manuel Recena Soto this should be split to 2 issues. I think we should change the title of this to 'duplicate js included' or something similar and close this ticket.

            Show
            kzantow Keith Zantow added a comment - Manuel Recena Soto this should be split to 2 issues. I think we should change the title of this to 'duplicate js included' or something similar and close this ticket.

              People

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

                Dates

                Created:
                Updated:
                Resolved: