From 5e0d906f2e05476039e764049f58fc709bec8056 Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Thu, 23 Mar 2023 14:20:06 +0100 Subject: [PATCH] Block occ commands when in maintenance mode Signed-off-by: Anna Larch --- lib/private/Console/Application.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/Console/Application.php b/lib/private/Console/Application.php index 07e9dbb317b27..ef8ad9210cfae 100644 --- a/lib/private/Console/Application.php +++ b/lib/private/Console/Application.php @@ -32,6 +32,7 @@ use OC\MemoryInfo; use OC\NeedsUpdateException; +use OC\ServiceUnavailableException; use OC_App; use OCP\AppFramework\QueryException; use OCP\App\IAppManager; @@ -187,8 +188,9 @@ private function writeMaintenanceModeInfo( $errOutput = $output->getErrorOutput(); $errOutput->writeln( 'Nextcloud is in maintenance mode, hence the database isn\'t accessible.' . PHP_EOL . - 'Cannot perform any command except \'maintenance:mode --off\'' . PHP_EOL + 'Cannot perform any command except \'maintenance:mode --off\' and \'status\'' . PHP_EOL ); + throw new ServiceUnavailableException(); } }