Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup AllConfig #32069

Merged
merged 1 commit into from
Apr 25, 2022
Merged

Cleanup AllConfig #32069

merged 1 commit into from
Apr 25, 2022

Conversation

CarlSchwan
Copy link
Member

  • Port to QueryBuilder
  • More typing when possible
  • Import classes with 'use'

@CarlSchwan CarlSchwan self-assigned this Apr 22, 2022
@CarlSchwan CarlSchwan force-pushed the cleanup/allconfig-sql branch from 770a04e to 178b5d8 Compare April 22, 2022 12:08
@CarlSchwan CarlSchwan requested a review from skjnldsv April 22, 2022 12:13
@CarlSchwan
Copy link
Member Author

phpunit is not happy, on it

- Port to QueryBuilder
- More typing when possible
- Import classes with 'use'

Signed-off-by: Carl Schwan <[email protected]>
@CarlSchwan CarlSchwan force-pushed the cleanup/allconfig-sql branch from 178b5d8 to 8bbdd9e Compare April 22, 2022 14:03
@@ -450,22 +454,20 @@ public function getUserValueForUsers($appName, $key, $userIds) {
}

$chunkedUsers = array_chunk($userIds, 50, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can bump to 1k as that is the oracle limit?

@nickvergessen nickvergessen added this to the Nextcloud 25 milestone Apr 25, 2022
@nickvergessen nickvergessen added 4. to release Ready to be released and/or waiting for tests to finish technical debt labels Apr 25, 2022
@CarlSchwan CarlSchwan mentioned this pull request Apr 25, 2022
15 tasks
@CarlSchwan CarlSchwan merged commit 59e0402 into master Apr 25, 2022
@CarlSchwan CarlSchwan deleted the cleanup/allconfig-sql branch April 25, 2022 16:56
@nickvergessen
Copy link
Member

cc @CarlSchwan there was a legit test failing...

Scenario: setup page is shown properly # /drone/src/build/integration/setup_features/setup.feature:3

The server can not be installed anymore locally.

@nickvergessen
Copy link
Member

An unhandled exception has been thrown:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud25.oc_appconfig' doesn't exist in server/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php:82
Stack trace:
#0 server/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php(82): PDO->query('SELECT * FROM `...')
#1 server/3rdparty/doctrine/dbal/src/Connection.php(1062): Doctrine\DBAL\Driver\PDO\Connection->query('SELECT * FROM `...')
#2 server/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 server/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 server/lib/private/DB/QueryBuilder/QueryBuilder.php(281): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 server/lib/private/AppConfig.php(411): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 server/lib/private/AppConfig.php(176): OC\AppConfig->loadConfigValues()
#7 server/lib/private/AppConfig.php(367): OC\AppConfig->getApps()
#8 server/lib/private/legacy/OC_App.php(983): OC\AppConfig->getValues(false, 'installed_versi...')
#9 server/lib/private/Server.php(713): OC_App::getAppVersions()
#10 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#11 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#12 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#14 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 server/lib/private/AppFramework/Utility/SimpleContainer.php(184): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache\\Fac...')
#16 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#17 server/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#18 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#19 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#20 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\ICacheFacto...')
#21 server/lib/private/Server.php(1105): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#22 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#23 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#24 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#25 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#26 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#27 server/lib/private/Server.php(2082): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#28 server/lib/private/Files/View.php(122): OC\Server->getLockingProvider()
#29 server/lib/private/Server.php(454): OC\Files\View->__construct()
#30 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#31 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#32 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#33 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#34 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#35 server/lib/private/Server.php(1445): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#36 server/lib/base.php(602): OC\Server->boot()
#37 server/lib/base.php(1104): OC::init()
#38 server/console.php(48): require_once('/home/nickv/Nex...')
#39 server/occ(11): require_once('/home/nickv/Nex...')
#40 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud25.oc_appconfig' doesn't exist in server/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php:26
Stack trace:
#0 server/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php(87): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
#1 server/3rdparty/doctrine/dbal/src/Connection.php(1062): Doctrine\DBAL\Driver\PDO\Connection->query('SELECT * FROM `...')
#2 server/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 server/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 server/lib/private/DB/QueryBuilder/QueryBuilder.php(281): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 server/lib/private/AppConfig.php(411): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 server/lib/private/AppConfig.php(176): OC\AppConfig->loadConfigValues()
#7 server/lib/private/AppConfig.php(367): OC\AppConfig->getApps()
#8 server/lib/private/legacy/OC_App.php(983): OC\AppConfig->getValues(false, 'installed_versi...')
#9 server/lib/private/Server.php(713): OC_App::getAppVersions()
#10 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#11 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#12 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#14 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 server/lib/private/AppFramework/Utility/SimpleContainer.php(184): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache\\Fac...')
#16 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#17 server/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#18 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#19 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#20 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\ICacheFacto...')
#21 server/lib/private/Server.php(1105): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#22 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#23 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#24 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#25 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#26 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#27 server/lib/private/Server.php(2082): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#28 server/lib/private/Files/View.php(122): OC\Server->getLockingProvider()
#29 server/lib/private/Server.php(454): OC\Files\View->__construct()
#30 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#31 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#32 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#33 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#34 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#35 server/lib/private/Server.php(1445): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#36 server/lib/base.php(602): OC\Server->boot()
#37 server/lib/base.php(1104): OC::init()
#38 server/console.php(48): require_once('/home/nickv/Nex...')
#39 server/occ(11): require_once('/home/nickv/Nex...')
#40 {main}

Next Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud25.oc_appconfig' doesn't exist in server/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:47
Stack trace:
#0 server/3rdparty/doctrine/dbal/src/Connection.php(1780): Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#1 server/3rdparty/doctrine/dbal/src/Connection.php(1719): Doctrine\DBAL\Connection->handleDriverException(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#2 server/3rdparty/doctrine/dbal/src/Connection.php(1067): Doctrine\DBAL\Connection->convertExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'SELECT * FROM `...', Array, Array)
#3 server/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#4 server/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#5 server/lib/private/DB/QueryBuilder/QueryBuilder.php(281): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 server/lib/private/AppConfig.php(411): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 server/lib/private/AppConfig.php(176): OC\AppConfig->loadConfigValues()
#8 server/lib/private/AppConfig.php(367): OC\AppConfig->getApps()
#9 server/lib/private/legacy/OC_App.php(983): OC\AppConfig->getValues(false, 'installed_versi...')
#10 server/lib/private/Server.php(713): OC_App::getAppVersions()
#11 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#12 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#13 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#14 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#15 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#16 server/lib/private/AppFramework/Utility/SimpleContainer.php(184): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache\\Fac...')
#17 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#18 server/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#19 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#20 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#21 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\ICacheFacto...')
#22 server/lib/private/Server.php(1105): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#23 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#24 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#25 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#26 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#27 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#28 server/lib/private/Server.php(2082): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#29 server/lib/private/Files/View.php(122): OC\Server->getLockingProvider()
#30 server/lib/private/Server.php(454): OC\Files\View->__construct()
#31 server/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#32 server/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#33 server/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#34 server/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#35 server/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#36 server/lib/private/Server.php(1445): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#37 server/lib/base.php(602): OC\Server->boot()
#38 server/lib/base.php(1104): OC::init()
#39 server/console.php(48): require_once('/home/nickv/Nex...')
#40 server/occ(11): require_once('/home/nickv/Nex...')
#41 {main}server

@CarlSchwan
Copy link
Member Author

cc @CarlSchwan there was a legit test failing...

Scenario: setup page is shown properly # /drone/src/build/integration/setup_features/setup.feature:3

The server can not be installed anymore locally.

The issue exists since a bit longer #31751 (comment)

@nickvergessen
Copy link
Member

Okay lemme check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants