Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-30085

PluginUpgradeTasks not running when performing online restore with 5.2

      Possibly related to CONF-30084:

      I set up a new Confluence 5.2 system and installed a plugin which contains a PluginUpgradeTask defined in the manner suggested by Atlassian.

      Next, I went to Admin->Backup & Restore and told it to restore a previously-saved XML backup of a Confluence 5.1 system.

      The restore seems to complete successfully, but the PluginUpgradeTask in my plugin is never run. The plugin is fully operational, except my persisted username data is never migrated to user keys, which poses a big problem.

      If I then go to the UPM and upload the plugin again, the PluginUpgradeTask does run successfully. (If I shut down and restart the system, I get hit by CONF-30084 problem and the system never comes back up.)

      Analogous to CONF-30084, the PluginUpgradeTask does get run if the upgrade is performed in other ways (such as by doing a fresh Conf 5.2 install and feeding it the 5.1.x XML during the initial setup, then installing the plugin after the restore completes). It's just the admin-section-initiated restore that seems to be having problems.

            [CONFSERVER-30085] PluginUpgradeTasks not running when performing online restore with 5.2

            You are correct sdudley. The original "fix" was really not particularly good and I feared it would be too easy to miss, which you have confirmed!
            (It was really impaired by the need to do nothing destabilising.)

            I promise it is properly fixed now

            Paul Curren added a comment - You are correct sdudley . The original "fix" was really not particularly good and I feared it would be too easy to miss, which you have confirmed! (It was really impaired by the need to do nothing destabilising.) I promise it is properly fixed now

            pcurren - ah, thanks, I see it now. I was expecting it to appear after the import was complete, rather than before I started the process, so I zoomed over that initial page without bothering to read anything. Although the "after complete" location seems like it might be a better idea in the long term, given that this is a temporary fix and that the permanent one is already code-complete, I won't bother advocating for it.

            Scott Dudley [Inactive] added a comment - pcurren - ah, thanks, I see it now. I was expecting it to appear after the import was complete, rather than before I started the process, so I zoomed over that initial page without bothering to read anything. Although the "after complete" location seems like it might be a better idea in the long term, given that this is a temporary fix and that the permanent one is already code-complete, I won't bother advocating for it.

            sdudley, I was just confirming that the message was working. It does appear to be OK with the plugins I've been testing with anyway. See screenshot -

            Paul Curren added a comment - sdudley , I was just confirming that the message was working. It does appear to be OK with the plugins I've been testing with anyway. See screenshot -

            Paul,

            No, there was no warning that I could see...the screenshot I sent was from that tab (the same one I used to start the restore) once the restore process had presumably been completed (or at least so said the log file)

            Scott Dudley [Inactive] added a comment - Paul, No, there was no warning that I could see...the screenshot I sent was from that tab (the same one I used to start the restore) once the restore process had presumably been completed (or at least so said the log file)

            Hi sdudley, thanks for testing.

            The warning is presented on the screen where you instigate the restore. Hopefully you saw it there?

            There is certainly a lot of scope for the space import operation to get some UI/UX love but I'm afraid that the warning message was introduced so late in the 5.2 development cycle that we had to make the minimal change possible.

            5.3 will not require warnings or any manual work around.

            Paul Curren added a comment - Hi sdudley , thanks for testing. The warning is presented on the screen where you instigate the restore. Hopefully you saw it there? There is certainly a lot of scope for the space import operation to get some UI/UX love but I'm afraid that the warning message was introduced so late in the 5.2 development cycle that we had to make the minimal change possible. 5.3 will not require warnings or any manual work around.

            pcurren, I just tried performing an online upgrade with 5.2.3 as per the original description, but when the upgrade is done, all I get is what you see in this screenshot (no warning messages, no next button, no nothing): http://cl.ly/image/1q3G0r2S1Y0Y

            However, I confirmed that the upgrade task does run if I disable and reenable the plugin.

            Ideas?

            Scott Dudley [Inactive] added a comment - pcurren , I just tried performing an online upgrade with 5.2.3 as per the original description, but when the upgrade is done, all I get is what you see in this screenshot (no warning messages, no next button, no nothing): http://cl.ly/image/1q3G0r2S1Y0Y However, I confirmed that the upgrade task does run if I disable and reenable the plugin. Ideas?

            5.2-rc1 should show a warning box listing the plugins that will need restarted on the Backup/Restore screen.

            So if you do test, it would be good to confirm that disabling and re-enabling your plugin does trigger the necessary upgrade tasks.

            Paul Curren added a comment - 5.2-rc1 should show a warning box listing the plugins that will need restarted on the Backup/Restore screen. So if you do test, it would be good to confirm that disabling and re-enabling your plugin does trigger the necessary upgrade tasks.

            Thanks, pcurren! Is the mitigation present in 5.2-rc1, or is it to be published in a future rc? (Just wondering if we should be trying to test it now.)

            Scott Dudley [Inactive] added a comment - Thanks, pcurren ! Is the mitigation present in 5.2-rc1, or is it to be published in a future rc? (Just wondering if we should be trying to test it now.)

            A "mitigation" has been committed to 5.2. A message will be displayed on the site import screen listing any plugins that you will manually need to restart after a restore (causing their upgrade tasks to run). The message also informs the admin that they can instead restart the instance for the same effect.

            For 5.3 we aim to include the riskier fix of restarting the plugin system after a restore (see com.atlassian.plugin.manager.DefaultPluginManager.warmRestart() which will cause upgrade tasks to run and will also clear any stale caches, etc.

            Paul Curren added a comment - A "mitigation" has been committed to 5.2. A message will be displayed on the site import screen listing any plugins that you will manually need to restart after a restore (causing their upgrade tasks to run). The message also informs the admin that they can instead restart the instance for the same effect. For 5.3 we aim to include the riskier fix of restarting the plugin system after a restore (see com.atlassian.plugin.manager.DefaultPluginManager.warmRestart() which will cause upgrade tasks to run and will also clear any stale caches, etc.

            pcurren,

            Did you figure it out, or do you still need a copy of the plugin? If the latter, just shoot me an email and I'll send you a link.

            For what it's worth, the plugin stores data exclusively in Bandana, and it implements com.atlassian.sal.api.upgrade.PluginUpgradeTask as suggested by the link in the description.

            Scott Dudley [Inactive] added a comment - pcurren , Did you figure it out, or do you still need a copy of the plugin? If the latter, just shoot me an email and I'll send you a link. For what it's worth, the plugin stores data exclusively in Bandana, and it implements com.atlassian.sal.api.upgrade.PluginUpgradeTask as suggested by the link in the description.

              onevalainen Olli Nevalainen
              7c60ab039b09 Scott Dudley [Inactive]
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: