diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php
index ed1aeeff9220de9fdd5c9571493de6a4c61696af..fc219e79bcdd42591341dd18ddd394ba1802e969 100644
--- a/core/Command/Maintenance/Install.php
+++ b/core/Command/Maintenance/Install.php
@@ -218,6 +218,7 @@ class Install extends Command {
 
 	private function printThrowable(OutputInterface $output, Throwable $t): void {
 		$output->write('<info>Trace: ' . $t->getTraceAsString() . '</info>');
+		$output->writeln('');
 		if ($t->getPrevious() !== null) {
 			$output->writeln('');
 			$output->writeln('<info>Previous: ' . get_class($t->getPrevious()) . ': ' . $t->getPrevious()->getMessage() . '</info>');
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index 54542de72bffdde4b6e44f3d92c7b946b374ece2..966c97edf553853aba0510455a1db7d1a177c913 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -66,7 +66,7 @@ class MySQL extends AbstractDatabase {
 		} catch (\Exception $e) {
 			$this->logger->logException($e);
 			throw new \OC\DatabaseSetupException($this->trans->t('MySQL username and/or password not valid'),
-				$this->trans->t('You need to enter details of an existing account.'));
+				$this->trans->t('You need to enter details of an existing account.'), 0, $e);
 		}
 	}
 
diff --git a/lib/private/Setup/OCI.php b/lib/private/Setup/OCI.php
index 1d7fe27e8b8df2e416ae855efa893684b32ddc47..ed05e0bf14c9ec916d67549687c6bf6170baebd7 100644
--- a/lib/private/Setup/OCI.php
+++ b/lib/private/Setup/OCI.php
@@ -74,14 +74,14 @@ class OCI extends AbstractDatabase {
 					. ' ORACLE_SID=' . getenv('ORACLE_SID')
 					. ' LD_LIBRARY_PATH=' . getenv('LD_LIBRARY_PATH')
 					. ' NLS_LANG=' . getenv('NLS_LANG')
-					. ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable');
+					. ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable', 0, $e);
 			}
 			throw new \OC\DatabaseSetupException($this->trans->t('Oracle username and/or password not valid'),
 				'Check environment: ORACLE_HOME=' . getenv('ORACLE_HOME')
 				. ' ORACLE_SID=' . getenv('ORACLE_SID')
 				. ' LD_LIBRARY_PATH=' . getenv('LD_LIBRARY_PATH')
 				. ' NLS_LANG=' . getenv('NLS_LANG')
-				. ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable');
+				. ' tnsnames.ora is ' . (is_readable(getenv('ORACLE_HOME') . '/network/admin/tnsnames.ora') ? '' : 'not ') . 'readable', 0, $e);
 		}
 
 		$this->config->setValues([
diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php
index 3d7a0b2a4b13d30dffe0a2bd82c68b4bb30e7f49..1f0b7b8f8948dca0f40325710a920c16ffbbe01e 100644
--- a/lib/private/Setup/PostgreSQL.php
+++ b/lib/private/Setup/PostgreSQL.php
@@ -99,7 +99,7 @@ class PostgreSQL extends AbstractDatabase {
 		} catch (\Exception $e) {
 			$this->logger->logException($e);
 			throw new \OC\DatabaseSetupException($this->trans->t('PostgreSQL username and/or password not valid'),
-				$this->trans->t('You need to enter details of an existing account.'));
+				$this->trans->t('You need to enter details of an existing account.'), 0, $e);
 		}
 	}