Docker manager doesn't handle upgrade failures well


(Dan Porter) #1

Continuing the discussion from Unable to upgrade using Docker after rake task improvements:

A fix has been pushed to Github for this previous issue, but the manager is still acting up after an upgrade fail. I cannot apply the latest updates as the button is now greyed out.

(Note that I will probably be able to rebuild the image file now using ./launcher rebuild app, but this is to point out that docker manager exhibits weird unintended behaviour when it fails to upgrade.)


(Jeff Atwood) #2

This is by design, you’re not supposed to be able to upgrade Discourse until you upgrade Docker Manager.

Hence the upgrade button is correctly greyed out.


(Dan Porter) #3

My bad. The reason I wanted to upgrade Discourse first, is it’s currently broken as of the last update. As upgrading docker_manager also runs rake tasks, this also results in the upgrade for docker manager failing too.




(Jeff Atwood) #4

OK then upload at the command line:

cd /var/discourse
git pull
./launcher rebuild app

(If you need to upgrade Docker-the-tool, there is a bit more.)


(Dan Porter) #5

This is all fine, and I can upgrade Discourse fine by rebuilding the app, so Discourse is working again. I don’t need help upgrading - this isn’t what the topic is about (which is why it’s not a support request, but a bug report)


Notice after an upgrade fail from 1a31eb1 to 2ad7564 (as highlighted in the first post) leaves docker manager in a broken state, providing incorrect information.

What has happened:

  • Docker manager has git reset --hard from 1a31eb1 to 2ad7564
  • Rake tasks have failed post git reset, and we’re stuck in a lobotomised state

Problems with Docker manager:

  • “discourse (1a31eb1)” being displayed is incorrect. It was the last commit that we were on before upgrading, but we’re actually on 2ad7564 without rake tasks performed
  • Likewise, docker manager displays ‘0 new commits’. This is actually correct because we are on 2ad7564, but the display message is wrong (we have failed in upgrading, whereas the rest of this section is suggestive of ‘updates available’)
  • When selecting ‘Upgrade to the Latest Version’, we are presented with a screen that shows half the information from the old broken upgrade, plus a button to start upgrading, despite the progress bar already being partly progressed.

In conclusion, as a user it is not clear from these screens that an upgrade has previously failed, no options are provided to rectify the situation (such as reverting the the last known working commit), and the information that is provided is inconsistent with the current state of discourse.


(Jeff Atwood) #6

Isn’t this why there is a reset button on the upgrade page? I have used it before and it works.


(Dan Porter) #7

This should work. However if I’ve moved away from that page, I get the screens you can see in the first post with no reset button.

Surely a reset/rollback should explicitly happen after a failed upgrade? My point is simply is that there’s no way to roll back after moving away from the page, and the manager doesn’t display correct information.


Sorry if I’m causing stress. :slight_smile: I’m just sure there could be better behaviour / information in docker manager when an upgrade fails. As it’s not priority, but would be nice to have before Discourse 1.0, I’ll swallow this and see if I can help with a pull request.


(Jeff Atwood) #8

You can take it up with @eviltrout, but I have personally done 20+ upgrades using the new upgrader and never had any serious problems.