diff options
author | F. E Noel Nfebe <fenn25.fn@gmail.com> | 2023-05-24 08:46:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-24 08:46:03 +0100 |
commit | 4220442fa138ff0d38a142468e27324ee85700e2 (patch) | |
tree | e5def978ba7bac1ecef6a267ac3cc63c0697d224 /lib | |
parent | 4811a02740bf39d892be6dd730ca010e8b31ff94 (diff) | |
parent | d0fc159975e00fac8c5c9cf939979d3afcc0cb86 (diff) | |
download | nextcloud-server-4220442fa138ff0d38a142468e27324ee85700e2.tar.gz nextcloud-server-4220442fa138ff0d38a142468e27324ee85700e2.zip |
Merge pull request #37458 from Fenn-CS/fix/37424/better-501-error-logging
Avoid db connections when logging db connection errors
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Server.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index bb4e217efa3..84860f8c494 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -730,7 +730,13 @@ class Server extends ServerContainer implements IServerContainer { if ($config->getSystemValueBool('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { if (!$config->getSystemValueBool('log_query')) { - $v = \OC_App::getAppVersions(); + try { + $v = \OC_App::getAppVersions(); + } catch (\Doctrine\DBAL\Exception $e) { + // Database service probably unavailable + // Probably related to https://github.com/nextcloud/server/issues/37424 + return $arrayCacheFactory; + } } else { // If the log_query is enabled, we can not get the app versions // as that does a query, which will be logged and the logging |