diff --git a/lib/SelfTest.php b/lib/SelfTest.php
index 971be765..e0f8e43a 100644
--- a/lib/SelfTest.php
+++ b/lib/SelfTest.php
@@ -75,19 +75,22 @@ public function test(string $server, OutputInterface $output, bool $ignoreProxyE
// test if the push server can load storage mappings from the db
[$storageId, $count] = $this->getStorageIdForTest();
- try {
- $retrievedCount = (int)$this->client->get($server . '/test/mapping/' . $storageId, ['nextcloud' => ['allow_local_address' => true], 'verify' => false])->getBody();
- } catch (\Exception $e) {
- $msg = $e->getMessage();
- $output->writeln("🗴 can't connect to push server: $msg");
- return self::ERROR_OTHER;
- }
+ // If no admin user was created during the installation, there are no oc_filecache and oc_mounts entries yet, so this check has to be skipped.
+ if ($storageId !== null) {
+ try {
+ $retrievedCount = (int)$this->client->get($server . '/test/mapping/' . $storageId, ['nextcloud' => ['allow_local_address' => true], 'verify' => false])->getBody();
+ } catch (\Exception $e) {
+ $msg = $e->getMessage();
+ $output->writeln("🗴 can't connect to push server: $msg");
+ return self::ERROR_OTHER;
+ }
- if ((int)$count === $retrievedCount) {
- $output->writeln('✓ push server can load mount info from database');
- } else {
- $output->writeln("🗴 push server can't load mount info from database");
- return self::ERROR_OTHER;
+ if ((int)$count === $retrievedCount) {
+ $output->writeln('✓ push server can load mount info from database');
+ } else {
+ $output->writeln("🗴 push server can't load mount info from database");
+ return self::ERROR_OTHER;
+ }
}
// test if the push server can reach nextcloud by having it request the cookie