summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-02-07 09:11:58 +0100
committerGitHub <noreply@github.com>2020-02-07 09:11:58 +0100
commit976db32a93d6ad1c8d6fbff40aa559ee6aba0aa2 (patch)
treea28e27ac4f3130baafb10f19e2b8401553015551 /lib/private/Setup.php
parent8e35ea0e1f83a2efac05af5a1e677d9e92326572 (diff)
parent686686b2e2710da0dabc08a5386801821293e462 (diff)
downloadnextcloud-server-976db32a93d6ad1c8d6fbff40aa559ee6aba0aa2.tar.gz
nextcloud-server-976db32a93d6ad1c8d6fbff40aa559ee6aba0aa2.zip
Merge pull request #19326 from nextcloud/backport/19303/stable18
[stable18] Fix occ maintenance:install database connect failure
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r--lib/private/Setup.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index 9b604895468..795c8cabcea 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -353,11 +353,9 @@ class Setup {
$this->config->setValues($newConfigValues);
+ $dbSetup->initialize($options);
try {
- $dbSetup->initialize($options);
$dbSetup->setupDatabase($username);
- // apply necessary migrations
- $dbSetup->runMigrations();
} catch (\OC\DatabaseSetupException $e) {
$error[] = [
'error' => $e->getMessage(),
@@ -371,6 +369,16 @@ class Setup {
];
return $error;
}
+ try {
+ // apply necessary migrations
+ $dbSetup->runMigrations();
+ } catch (Exception $e) {
+ $error[] = [
+ 'error' => 'Error while trying to initialise the database: ' . $e->getMessage(),
+ 'hint' => '',
+ ];
+ return $error;
+ }
//create the user and group
$user = null;