Skip to content

fix(maintenance): allow AppAPI to serve requests during maintenance mode#61294

Open
oleksandr-nc wants to merge 1 commit into
masterfrom
fix/noid/appapi-maintenance-mode
Open

fix(maintenance): allow AppAPI to serve requests during maintenance mode#61294
oleksandr-nc wants to merge 1 commit into
masterfrom
fix/noid/appapi-maintenance-mode

Conversation

@oleksandr-nc

Copy link
Copy Markdown
Contributor

Summary

This PR allows AppAPI to work during the maintenance mode.

Reason? When admin enables maintenance mode, Nextcloud returns a 503 for every app route. This also shuts down AppAPI's own routes and its occ commands. But maintenance mode is when admins run backups and upgrades, so today this can break the whole ExApp setup.

Main findings from bug-reports:

  • HaRP can no longer read ExApp metadata from the NC or check user access from Nextcloud, so calls to running ExApps start failing with misleading 401/404 errors. If HaRP restarts during the maintenance window, every ExApp route stops working.
  • ExApps cannot report their status back to Nextcloud (those callbacks go over OCS), so any ExApp install or update that was in progress when maintenance started is left broken.
  • The occ app_api:* commands are not loaded during maintenance, so an admin cannot manage or recover ExApps from the command line either.

Conditions:

  1. AppAPI must be enabled to serve it's endpoints.
  2. No upgrade may be pending (needUpgrade() must be false) - as there can be a pending upgrade of AppAPI.

Everything else stays exactly as before (I hope 🤗)

We would also like to request a backport this for Nextcloud 34, for which we are already asking admins to use HaRP - and with it, this problem looks more serious.

Note: WebDAV and the other entry points are untouched. ExApp-provided dynamic occ commands (loaded from register_command.php) are intentionally not registered during maintenance.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
@oleksandr-nc oleksandr-nc added this to the Nextcloud 34.0.1 milestone Jun 15, 2026
@oleksandr-nc oleksandr-nc requested a review from julien-nc June 15, 2026 12:53
@oleksandr-nc oleksandr-nc requested a review from a team as a code owner June 15, 2026 12:53
@oleksandr-nc oleksandr-nc requested review from ArtificialOwl, CarlSchwan, nfebe and sorbaugh and removed request for a team June 15, 2026 12:53
@oleksandr-nc oleksandr-nc added the 3. to review Waiting for reviews label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant