Server: Updating multiple apps at once results in some not being updated

Created on 19 Dec 2017  Â·  7Comments  Â·  Source: nextcloud/server

Steps to reproduce

  1. Open "Apps"
  2. Have multiple to-be-updated apps
  3. Click multiple "Update" buttons fast

Expected behaviour

All apps should be updated, at least after a while.

Actual behaviour

At least in NC13b3, I reproduced twice that updateing Brute-force settings, Impersonate and Retention at "once" doesn't work out. Brute-force settings was updated, the other two remained in status "Updating". After waiting LONG, I reloaded the page and restarted the update once each and waited for termination, then all worked fine.

bug apps management install and update papercut

Most helpful comment

When the server is updating an app it enters in maintenance mode, and any other request to the server while it is in maintenance mode will result in a 503 Service unavailable HTTP error. Therefore, trying to update other apps while the first one is being updated fails.

If the update fails, why is no error shown? Because the call to updateapp.php is not set to handle HTTP errors. It can handle errors returned by the updater in JSON format, but only if they are returned in a successful HTTP response.

Therefore, all the update buttons should be disabled while an update is running, and the call to jQuery.post should be chained with a fail() to handle HTTP errors too.

All 7 comments

cc @rullzer @danxuliu Should we just disable the "update" button if a update is running?

@MorrisJobke yes seems the most sensible

When the server is updating an app it enters in maintenance mode, and any other request to the server while it is in maintenance mode will result in a 503 Service unavailable HTTP error. Therefore, trying to update other apps while the first one is being updated fails.

If the update fails, why is no error shown? Because the call to updateapp.php is not set to handle HTTP errors. It can handle errors returned by the updater in JSON format, but only if they are returned in a successful HTTP response.

Therefore, all the update buttons should be disabled while an update is running, and the call to jQuery.post should be chained with a fail() to handle HTTP errors too.

The "Update" buttons are the ones most likely clicked. But as maintenance mode is global,

  • the "Enable", "Disable", and "Remove" buttons should be disabled as well, and
  • the admin just updating the app should be aware that the entire Nextcloud instance will be in maintenance mode, affecting all users.

These two could be combined that clicking with a modal overlay on the admin's view, stating that the server is currently in maintenance mode for the app update. Then it is clear that this affects all users (so the admin will be aware of it, in the near future) and the admin will also try to click ahead.

BTW: As mentioned in #8389, there is a mix between "Update" and "Upgrade" in the UI for the same thing. Which is the preferred term?

BTW: As mentioned in #8389, there is a mix between "Update" and "Upgrade" in the UI for the same thing. Which is the preferred term?

Usually we refer to "upgrade" as "running the migrations and put something in maintenance mode" and "update" as in replace the code. In the server itself the "updater" only replaces old code with new and the "upgrade" step runs the actual migrations. A bit confusing but hopefully you get the point.

Thanks for the explanation. It would be nice if it were clear to the average admin and translator out there as well (I have no silver bullet to where to put that information, though; for translators, an explanatory list of keywords might help).

Here are some text strings from settings/l10n/de.json:

"App up to date" : "App ist aktuell",
"Upgrading …" : "Aktualisiere ...",
"Could not upgrade app" : "App konnte nicht aktualisiert werden",
"Updated" : "Aktualisiert",

The original strings are a mix between "upgrade" and "update" (when they should all be forms of "update", as far as I understand @MorrisJobke's explanation above, as for apps, there seems to be no specific migration step).

The translator merged both terms into one (I also checked French, Russian, and Spanish, and they seem to do the same.)

Fixed with #9565

Was this page helpful?
0 / 5 - 0 ratings