[Critical BUG] Circles cannot be enabled after nextcloud update to 18 (postgres)

There’s everything writen up:

I cannot enable circles after update. It crashes on DB access.

Error in log is:

From docker log:

postgres_1   | 2020-01-28T16:45:23.898718928Z 2020-01-28 16:45:23.898 UTC [886] ERROR:  index "primary" does not exist
postgres_1   | 2020-01-28T16:45:23.898763755Z 2020-01-28 16:45:23.898 UTC [886] STATEMENT:  DROP INDEX "primary"
app_1        | 10.201.2.6 -  28/Jan/2020:16:45:19 +0000 "POST /index.php" 500

From nextcloud log:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'DROP INDEX "primary"': SQLSTATE[42704]: Undefined object: 7 ERROR: index "primary" does not exist

    /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 169:

    Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException("An exceptio ... t", Doctrine\DBA ... ]})

    /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 145:

    Doctrine\DBAL\DBALException::wrapException(Doctrine\DBA ... {}, Doctrine\DBA ... ]}, "An exceptio ... t")

    /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 1012:

    Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBA ... {}, Doctrine\DBA ... ]}, "DROP INDEX \"primary\"")

    /var/www/html/lib/private/DB/Migrator.php - line 262:

    Doctrine\DBAL\Connection->query("DROP INDEX \"primary\"")

    /var/www/html/lib/private/DB/Migrator.php - line 85:

    OC\DB\Migrator->applySchema(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/Connection.php - line 457:

    OC\DB\Migrator->migrate(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/MigrationService.php - line 486:

    OC\DB\Connection->migrateToSchema(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/MigrationService.php - line 414:

    OC\DB\MigrationService->executeStep("0017Date20191206144441", false)

    /var/www/html/lib/private/Installer.php - line 151:

    OC\DB\MigrationService->migrate()

    /var/www/html/apps/settings/lib/Controller/AppSettingsController.php - line 443:

    OC\Installer->installApp("circles")

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 170:

    OCA\Settings\Controller\AppSettingsController->enableApps([ "circles"], [])

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 99:

    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/AppFramework/App.php - line 125:

    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

    OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})

    <<closure>>

    OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})

    /var/www/html/lib/private/Route/Router.php - line 299:

    call_user_func(OC\AppFramew ... {}, { _route: "s ... "})

    /var/www/html/lib/base.php - line 1008:

    OC\Route\Router->match("/settings/apps/enable")

    /var/www/html/index.php - line 38:

    OC::handleRequest()

Caused by Doctrine\DBAL\Driver\PDOException: SQLSTATE[42704]: Undefined object: 7 ERROR: index "primary" does not exist

    /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 1010:

    Doctrine\DBAL\Driver\PDOConnection->query("DROP INDEX \"primary\"")

    /var/www/html/lib/private/DB/Migrator.php - line 262:

    Doctrine\DBAL\Connection->query("DROP INDEX \"primary\"")

    /var/www/html/lib/private/DB/Migrator.php - line 85:

    OC\DB\Migrator->applySchema(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/Connection.php - line 457:

    OC\DB\Migrator->migrate(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/MigrationService.php - line 486:

    OC\DB\Connection->migrateToSchema(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/MigrationService.php - line 414:

    OC\DB\MigrationService->executeStep("0017Date20191206144441", false)

    /var/www/html/lib/private/Installer.php - line 151:

    OC\DB\MigrationService->migrate()

    /var/www/html/apps/settings/lib/Controller/AppSettingsController.php - line 443:

    OC\Installer->installApp("circles")

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 170:

    OCA\Settings\Controller\AppSettingsController->enableApps([ "circles"], [])

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 99:

    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/AppFramework/App.php - line 125:

    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

    OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})

    <<closure>>

    OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})

    /var/www/html/lib/private/Route/Router.php - line 299:

    call_user_func(OC\AppFramew ... {}, { _route: "s ... "})

    /var/www/html/lib/base.php - line 1008:

    OC\Route\Router->match("/settings/apps/enable")

    /var/www/html/index.php - line 38:

    OC::handleRequest()

Caused by PDOException: SQLSTATE[42704]: Undefined object: 7 ERROR: index "primary" does not exist

    /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php - line 88:

    PDO->query("DROP INDEX \"primary\"")

    /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 1010:

    Doctrine\DBAL\Driver\PDOConnection->query("DROP INDEX \"primary\"")

    /var/www/html/lib/private/DB/Migrator.php - line 262:

    Doctrine\DBAL\Connection->query("DROP INDEX \"primary\"")

    /var/www/html/lib/private/DB/Migrator.php - line 85:

    OC\DB\Migrator->applySchema(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/Connection.php - line 457:

    OC\DB\Migrator->migrate(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/MigrationService.php - line 486:

    OC\DB\Connection->migrateToSchema(Doctrine\DBAL\Schema\Schema {})

    /var/www/html/lib/private/DB/MigrationService.php - line 414:

    OC\DB\MigrationService->executeStep("0017Date20191206144441", false)

    /var/www/html/lib/private/Installer.php - line 151:

    OC\DB\MigrationService->migrate()

    /var/www/html/apps/settings/lib/Controller/AppSettingsController.php - line 443:

    OC\Installer->installApp("circles")

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 170:

    OCA\Settings\Controller\AppSettingsController->enableApps([ "circles"], [])

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 99:

    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/AppFramework/App.php - line 125:

    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

    OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, { _route: "s ... "})

    <<closure>>

    OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "s ... "})

    /var/www/html/lib/private/Route/Router.php - line 299:

    call_user_func(OC\AppFramew ... {}, { _route: "s ... "})

    /var/www/html/lib/base.php - line 1008:

    OC\Route\Router->match("/settings/apps/enable")

    /var/www/html/index.php - line 38:

    OC::handleRequest()

Thanks for your report, can you please try to upgrade to Circles 0.18.1 ?

I’m sorry, still nope.

./occ app:update --all
circles new version available: 0.18.1
Error: An exception occurred while executing 'DROP INDEX "primary"':

SQLSTATE[42704]: Undefined object: 7 ERROR:  index "primary" does not exist

Similar problem with MariaDB. Primary key exist, isn’t dropped and stops complete migration to NC18.
¯\(ツ)