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

Jenkins 2.80 setup wizard does not resume after restart

      JENKINS-42577/ https://github.com/jenkinsci/jenkins/pull/3010 added saving of the Jenkins version whenever Jenkins is saved.

      This caused the security issue JENKINS-47139, fixed by https://github.com/jenkinsci/jenkins/pull/3050

      While that resolved the security issue that skips the wizard and its default protections, the setup wizard is still broken in a more subtle form:

      In Jenkins 2.79, when restarting Jenkins while the setup wizard was unfinished, it would resume the setup wizard.

      In Jenkins 2.81, when restarting Jenkins while the setup wizard was unfinished, it does not resume the setup wizard. While it still set the security defaults, and users can log in using 'admin' and the setup unlock code, it may not be clear to users that this works, and they just have a locked instance.

          [JENKINS-47439] Jenkins 2.80 setup wizard does not resume after restart

          Proposed a PR

          Vincent Latombe added a comment - Proposed a PR

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/hudson/util/PluginServletFilter.java
          core/src/main/java/jenkins/install/InstallState.java
          core/src/main/java/jenkins/install/InstallUtil.java
          core/src/main/java/jenkins/install/SetupWizard.java
          core/src/main/java/jenkins/model/Jenkins.java
          test/src/test/java/jenkins/install/SetupWizardRestartTest.java
          http://jenkins-ci.org/commit/jenkins/30ab4481f286a5c33499489dfcb9b3df6587ff38
          Log:
          [FIXES JENKINS-47439] Setup wizard does not resume after restart (#3166)

          On first startup, the setup wizard goes into state NEW and the filter to
          force display the setup wizard is installed.

          On second startup, the setup wizard goes into state RESTART (which
          assumes the setup wizard is done), and the setup wizard is skipped
          completely.

          This test expects that state NEW is retained upon restart when nothing
          is done.

          In some cases, the heuristics to determine the current setup wizard state are
          fragile. It is safer to persist the install state so that upon restart,
          the setup wizard can resume where it was left off.

          • Missing javadoc and since for new public methods
          • s/XXX/FIXME/
          • Missed that one
          • Setup wizard filter should be removed when entering a state where setup is complete
          • Use parameterized logging
          • Improvements over previous impl
          • Removed static isUsingSecurityToken. Now only determined from install
            state.
          • Call onInstallStateUpdate before InstallState#initializeState as the
            latter can update state.
          • Triggering a new build

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/hudson/util/PluginServletFilter.java core/src/main/java/jenkins/install/InstallState.java core/src/main/java/jenkins/install/InstallUtil.java core/src/main/java/jenkins/install/SetupWizard.java core/src/main/java/jenkins/model/Jenkins.java test/src/test/java/jenkins/install/SetupWizardRestartTest.java http://jenkins-ci.org/commit/jenkins/30ab4481f286a5c33499489dfcb9b3df6587ff38 Log: [FIXES JENKINS-47439] Setup wizard does not resume after restart (#3166) JENKINS-47439 Add a failing test On first startup, the setup wizard goes into state NEW and the filter to force display the setup wizard is installed. On second startup, the setup wizard goes into state RESTART (which assumes the setup wizard is done), and the setup wizard is skipped completely. This test expects that state NEW is retained upon restart when nothing is done. JENKINS-47439 Persist InstallState In some cases, the heuristics to determine the current setup wizard state are fragile. It is safer to persist the install state so that upon restart, the setup wizard can resume where it was left off. Missing javadoc and since for new public methods s/XXX/FIXME/ Missed that one Setup wizard filter should be removed when entering a state where setup is complete Use parameterized logging Improvements over previous impl Removed static isUsingSecurityToken. Now only determined from install state. Call onInstallStateUpdate before InstallState#initializeState as the latter can update state. Triggering a new build

          Daniel Beck added a comment -

          Merged towards 2.94.

          Daniel Beck added a comment - Merged towards 2.94.

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/hudson/util/PluginServletFilter.java
          core/src/main/java/jenkins/install/InstallState.java
          core/src/main/java/jenkins/install/InstallUtil.java
          core/src/main/java/jenkins/install/SetupWizard.java
          core/src/main/java/jenkins/model/Jenkins.java
          test/src/test/java/jenkins/install/SetupWizardRestartTest.java
          http://jenkins-ci.org/commit/jenkins/c359b86053dfe48c797f3b2135f72fb32cf8b609
          Log:
          [FIXES JENKINS-47439] Setup wizard does not resume after restart (#3166)

          On first startup, the setup wizard goes into state NEW and the filter to
          force display the setup wizard is installed.

          On second startup, the setup wizard goes into state RESTART (which
          assumes the setup wizard is done), and the setup wizard is skipped
          completely.

          This test expects that state NEW is retained upon restart when nothing
          is done.

          In some cases, the heuristics to determine the current setup wizard state are
          fragile. It is safer to persist the install state so that upon restart,
          the setup wizard can resume where it was left off.

          • Missing javadoc and since for new public methods
          • s/XXX/FIXME/
          • Missed that one
          • Setup wizard filter should be removed when entering a state where setup is complete
          • Use parameterized logging
          • Improvements over previous impl
          • Removed static isUsingSecurityToken. Now only determined from install
            state.
          • Call onInstallStateUpdate before InstallState#initializeState as the
            latter can update state.
          • Triggering a new build

          (cherry picked from commit 30ab4481f286a5c33499489dfcb9b3df6587ff38)

          Compare: https://github.com/jenkinsci/jenkins/compare/bed6ccd71921...c359b86053df

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/hudson/util/PluginServletFilter.java core/src/main/java/jenkins/install/InstallState.java core/src/main/java/jenkins/install/InstallUtil.java core/src/main/java/jenkins/install/SetupWizard.java core/src/main/java/jenkins/model/Jenkins.java test/src/test/java/jenkins/install/SetupWizardRestartTest.java http://jenkins-ci.org/commit/jenkins/c359b86053dfe48c797f3b2135f72fb32cf8b609 Log: [FIXES JENKINS-47439] Setup wizard does not resume after restart (#3166) JENKINS-47439 Add a failing test On first startup, the setup wizard goes into state NEW and the filter to force display the setup wizard is installed. On second startup, the setup wizard goes into state RESTART (which assumes the setup wizard is done), and the setup wizard is skipped completely. This test expects that state NEW is retained upon restart when nothing is done. JENKINS-47439 Persist InstallState In some cases, the heuristics to determine the current setup wizard state are fragile. It is safer to persist the install state so that upon restart, the setup wizard can resume where it was left off. Missing javadoc and since for new public methods s/XXX/FIXME/ Missed that one Setup wizard filter should be removed when entering a state where setup is complete Use parameterized logging Improvements over previous impl Removed static isUsingSecurityToken. Now only determined from install state. Call onInstallStateUpdate before InstallState#initializeState as the latter can update state. Triggering a new build (cherry picked from commit 30ab4481f286a5c33499489dfcb9b3df6587ff38) Compare: https://github.com/jenkinsci/jenkins/compare/bed6ccd71921...c359b86053df

            vlatombe Vincent Latombe
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: