Skip to content
Prev Previous commit
Next Next commit
fix: Do not try to load IAppManager too soon
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Mar 25, 2025
commit 8caa1a70e95449708f53e5f8882225e82304a27c
5 changes: 2 additions & 3 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,13 @@ public function __construct($webRoot, \OC\Config $config) {
$config = $c->get(SystemConfig::class);
/** @var ServerVersion $serverVersion */
$serverVersion = $c->get(ServerVersion::class);
$appManager = $c->get(IAppManager::class);

if ($config->getValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
$logQuery = $config->getValue('log_query');
$prefixClosure = function () use ($logQuery, $serverVersion, $appManager): ?string {
$prefixClosure = function () use ($logQuery, $serverVersion): ?string {
if (!$logQuery) {
try {
$v = $appManager->getAppInstalledVersions();
$v = \OCP\Server::get(IAppManager::class)->getAppVersions();
} catch (\Doctrine\DBAL\Exception $e) {
// Database service probably unavailable
// Probably related to https://github.com/nextcloud/server/issues/37424
Expand Down