Closed varet80 closed 1 month ago
Use docker compose exec -u33 bash
(or similar) to exec into your containers with the appropriate access/environment:
https://github.com/nextcloud/docker?tab=readme-ov-file#using-the-nextcloud-command-line-interface
Out of curiosity, why are you manually running occ upgrade
?
Well the entrypoint
is failing to run with the error I shared. and thus I need to run it manually on every image change.
the error you see is from the container startup. Added teh command it executes (reading the script)
here is the container stdout
nextcloud Configuring Redis as session handler
nextcloud Initializing nextcloud 30.0.0.14 ...
nextcloud Upgrading nextcloud from 29.0.0.14 ...
nextcloud => Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/pre-upgrade
nextcloud An unhandled exception has been thrown:
nextcloud Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "r*pg" (1*9), port 5432 failed: could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied
nextcloud connection to server at "r*g" (1*9), port 5432 failed: FATAL: pg_hba.conf rejects connection for host "****", user "ne*d", database "nextcloud", no encryption in /var/www/html/lib/private/DB/Connection.php:233
nextcloud Stack trace:
nextcloud #0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(453): OC\DB\Connection->connect()
nextcloud #1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(411): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
nextcloud #2 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(318): Doctrine\DBAL\Connection->detectDatabasePlatform()
nextcloud #3 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1320): Doctrine\DBAL\Connection->getDatabasePlatform()
nextcloud #4 /var/www/html/lib/private/DB/Connection.php(191): Doctrine\DBAL\Connection->setNestTransactionsWithSavepoints(true)
nextcloud #5 /var/www/html/3rdparty/doctrine/dbal/src/DriverManager.php(197): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDO\PgSQL\Driver), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
nextcloud #6 /var/www/html/lib/private/DB/ConnectionFactory.php(148): Doctrine\DBAL\DriverManager::getConnection(Object(SensitiveParameterValue), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
nextcloud #7 /var/www/html/lib/private/Server.php(819): OC\DB\ConnectionFactory->getConnection('pgsql', Array)
nextcloud #8 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud #9 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud #10 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\DB\\Connectio...')
nextcloud #11 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\DB\\Connectio...', true)
nextcloud #12 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OC\\DB\\Connectio...', true)
nextcloud #13 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
nextcloud #14 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
nextcloud #15 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
nextcloud #16 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\DB\\Connectio...')
nextcloud #17 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\DB\\Connectio...', true)
nextcloud #18 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\DB\\Connectio...')
nextcloud #19 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\DB\\Connectio...')
nextcloud #20 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
nextcloud #21 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud #22 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OCP\\IDBConnecti...')
nextcloud #23 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OCP\\IDBConnecti...', true)
nextcloud #24 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OCP\\IDBConnecti...', true)
nextcloud #25 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
nextcloud #26 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
nextcloud #27 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
nextcloud #28 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Authenticati...')
nextcloud #29 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
nextcloud #30 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OC\\Authenticati...', true)
nextcloud #31 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
nextcloud #32 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
nextcloud #33 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
nextcloud #34 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Authenticati...')
nextcloud #35 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
nextcloud #36 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OC\\Authenticati...', true)
nextcloud #37 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
nextcloud #38 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
nextcloud #39 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
nextcloud #40 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Authenticati...')
nextcloud #41 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
nextcloud #42 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\Authenticati...')
nextcloud #43 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\Authenticati...')
nextcloud #44 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
nextcloud #45 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud #46 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\Authenticati...')
nextcloud #47 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
nextcloud #48 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\Authenticati...')
nextcloud #49 /var/www/html/lib/private/Server.php(497): OC\AppFramework\Utility\SimpleContainer->get('OC\\Authenticati...')
nextcloud #50 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud #51 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud #52 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\User\\Session')
nextcloud #53 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\User\\Session', true)
nextcloud #54 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\User\\Session')
nextcloud #55 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\User\\Session')
nextcloud #56 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
nextcloud #57 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud #58 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OCP\\IUserSessio...')
nextcloud #59 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OCP\\IUserSessio...', true)
nextcloud #60 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OCP\\IUserSessio...')
nextcloud #61 /var/www/html/lib/private/Server.php(857): OC\AppFramework\Utility\SimpleContainer->get('OCP\\IUserSessio...')
nextcloud #62 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud #63 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud #64 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\App\\AppManag...')
nextcloud #65 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\App\\AppManag...', true)
nextcloud #66 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\App\\AppManag...')
nextcloud #67 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\App\\AppManag...')
nextcloud #68 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
nextcloud #69 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud #70 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OCP\\App\\IAppMan...')
nextcloud #71 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OCP\\App\\IAppMan...', true)
nextcloud #72 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OCP\\App\\IAppMan...', true)
nextcloud #73 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
nextcloud #74 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
nextcloud #75 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
nextcloud #76 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\AppFramework...')
nextcloud #77 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\AppFramework...', true)
nextcloud #78 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\AppFramework...')
nextcloud #79 /var/www/html/lib/public/Server.php(39): OC\AppFramework\Utility\SimpleContainer->get('OC\\AppFramework...')
nextcloud #80 /var/www/html/lib/base.php(656): OCP\Server::get('OC\\AppFramework...')
nextcloud #81 /var/www/html/lib/base.php(1132): OC::init()
nextcloud #82 /var/www/html/console.php(28): require_once('/var/www/html/l...')
nextcloud #83 /var/www/html/occ(11): require_once('/var/www/html/c...')
same error. the su command with preservation of env variables causes this error in occ, during startup. And thus upgrades need to happen manually.
This came up once before.
This jogged my memory.
From what I recall, the only reason the error appears is because of something else already failing on the authentication side w/ PostgreSQL. It shouldn't even be trying to load certs from there unless there's an earlier problem. It's fallback behavior that triggers it in the pg client library.
Also see: https://github.com/nextcloud/docker/issues/2053#issuecomment-1676392064
You can use your favorite search engine for the cert error from pg and find additional context.
I do face an issue with
occ upgrade
during startup of the image. I am using a postgresql connectionThe issue is:
if I modify entrypoint and remove the
-p
in the run_as function. This works diff from the entry pointConfig:list: