nextcloud / nextcloud/helm

only table oc_migration being created while installing nextcloud on k8s using helm chart with postgresql-ha and pgpool enabled

Open
#436 29 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

externalDatabase
Dominant language
Go Template
Stars
534
Forks
314
Avg merge
42m
Merged PRs (30d)
1

Description

Describe your Issue

Hello everyone..
we are using Nextcloud helm chart to install nextcloud on k8s..an external postgresql is installed via Postgres-HA bitnami helm chart..and a user called nextcloud has been given a full access to a database called nextcloud as well.several check has been done in order to make sure everything is okey with database..
when we install nextcloud it goes to a part of Initializign nextcloud and then provide some error about missing tables in postgress.intersting thing is only one table is being created which is called oc_migrations and that's why we are sure there is no problem due the connectivity between nextcloud and postgesql...
another thing that is very wired is that sometime the installation progress complete without any problem and many table get created with oc_* prefix.
it is worth to mention that we disable liveness and readiness to give the service sufficient time to do it's initialization.
many times we delete the whole service and install it again but many time we faced the same problem.

Logs and Errors
Starting nextcloud installation
Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_migrations" does not exist
LINE 1: SELECT "version" FROM "oc_migrations" WHERE "app" = $1 ORDER...
                              ^
Trace: #0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1814): Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1749): Doctrine\DBAL\Connection->handleDriverException(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#2 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1055): Doctrine\DBAL\Connection->convertExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'SELECT "version...', Array, Array)
#3 /var/www/html/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery('SELECT "version...', Array, Array, NULL)
#4 /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery('SELECT "version...', Array, Array)
#5 /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 /var/www/html/lib/private/DB/MigrationService.php(191): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 /var/www/html/lib/private/DB/MigrationService.php(256): OC\DB\MigrationService->getMigratedVersions()
#8 /var/www/html/lib/private/DB/MigrationService.php(434): OC\DB\MigrationService->getMigrationsToExecute('latest')
#9 /var/www/html/lib/private/DB/MigrationService.php(409): OC\DB\MigrationService->migrateSchemaOnly('latest')
#10 /var/www/html/lib/private/Setup/AbstractDatabase.php(158): OC\DB\MigrationService->migrate('latest', true)
#11 /var/www/html/lib/private/Setup.php(371): OC\Setup\AbstractDatabase->runMigrations()
#12 /var/www/html/core/Command/Maintenance/Install.php(104): OC\Setup->install(Array)
#13 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/console.php(100): OC\Console\Application->run()
#19 /var/www/html/occ(11): require_once('/var/www/html/c...')
#20 {main}
Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_appconfig" does not exist
LINE 1: SELECT * FROM "oc_appconfig"
                      ^
Trace: #0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1814): Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1749): Doctrine\DBAL\Connection->handleDriverException(Object(Doctrine\DBAL\Driver\PDO\Exception), Object(Doctrine\DBAL\Query))
#2 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1055): Doctrine\DBAL\Connection->convertExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'SELECT * FROM "...', Array, Array)
#3 /var/www/html/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
#4 /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery('SELECT * FROM "...', Array, Array)
#5 /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 /var/www/html/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 /var/www/html/lib/private/AppConfig.php(226): OC\AppConfig->loadConfigValues()
#8 /var/www/html/lib/private/AllConfig.php(217): OC\AppConfig->getValue('core', 'vendor', '')
#9 /var/www/html/lib/private/DB/MigrationService.php(119): OC\AllConfig->getAppValue('core', 'vendor', '')
#10 /var/www/html/lib/private/DB/MigrationService.php(183): OC\DB\MigrationService->createMigrationTable()
#11 /var/www/html/lib/private/DB/MigrationService.php(256): OC\DB\MigrationService->getMigratedVersions()
#12 /var/www/html/lib/private/DB/MigrationService.php(434): OC\DB\MigrationService->getMigrationsToExecute('latest')
#13 /var/www/html/lib/private/DB/MigrationService.php(409): OC\DB\MigrationService->migrateSchemaOnly('latest')
#14 /var/www/html/lib/private/Setup/AbstractDatabase.php(158): OC\DB\MigrationService->migrate('latest', true)
#15 /var/www/html/lib/private/Setup.php(371): OC\Setup\AbstractDatabase->runMigrations()
#16 /var/www/html/core/Command/Maintenance/Install.php(104): OC\Setup->install(Array)
#17 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OC\Core\Command\Maintenance\Install->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Install), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/html/console.php(100): OC\Console\Application->run()

Describe your Environment

  • Kubernetes distribution: rke-v1.24.8

  • Helm chart version -> nextcloud-3.5.19

  • App VERSION -> 27.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the installation with nextcloud-3.5.19, App 27.0.0, PostgreSQL HA, and pgpool enabled, then inspect the chart configuration and initialization ordering. Trace the database setup entry points in lib/private/DB/MigrationService.php and lib/private/Setup/AbstractDatabase.php, comparing successful and failed runs. Done means a fresh deployment consistently completes and creates the expected oc_* tables.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes, postgresql
Domain
databases, devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.