nextcloud / docker

⛴ Docker image of Nextcloud
https://hub.docker.com/_/nextcloud/
GNU Affero General Public License v3.0
6.09k stars 1.83k forks source link

su issue, occ upgrade not working during an upgrade. #2305

Closed varet80 closed 1 month ago

varet80 commented 1 month ago

I do face an issue with occ upgrade during startup of the image. I am using a postgresql connection

The issue is:

su -p "www-data" -s /bin/bash -c "php /var/www/html/occ upgrade"
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "re******.pg" (*****), port 5432 failed: could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied
connection to server at "re**.pg" (***), port 5432 failed: FATAL:  pg_hba.conf rejects connection for host "*****", user "*****", database "*****", no encryption in /var/www/html/lib/private/DB/Connection.php:233
Stack trace:
#0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(453): OC\DB\Connection->connect()
#1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(411): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(318): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1320): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/html/lib/private/DB/Connection.php(191): Doctrine\DBAL\Connection->setNestTransactionsWithSavepoints(true)
#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))
#6 /var/www/html/lib/private/DB/ConnectionFactory.php(148): Doctrine\DBAL\DriverManager::getConnection(Object(SensitiveParameterValue), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#7 /var/www/html/lib/private/Server.php(819): OC\DB\ConnectionFactory->getConnection('pgsql', Array)
#8 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}(Object(OC\Server))
#9 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#10 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\DB\\Connectio...')
#11 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\DB\\Connectio...', true)
#12 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OC\\DB\\Connectio...', true)
#13 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
#14 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
#15 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
#16 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\DB\\Connectio...')
#17 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\DB\\Connectio...', true)
#18 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\DB\\Connectio...')
#19 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\DB\\Connectio...')
#20 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#21 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#22 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OCP\\IDBConnecti...')
#23 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OCP\\IDBConnecti...', true)
#24 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OCP\\IDBConnecti...', true)
#25 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
#26 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
#27 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
#28 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Authenticati...')
#29 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
#30 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OC\\Authenticati...', true)
#31 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
#32 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
#33 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
#34 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Authenticati...')
#35 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
#36 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OC\\Authenticati...', true)
#37 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
#38 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
#39 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
#40 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\Authenticati...')
#41 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
#42 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\Authenticati...')
#43 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\Authenticati...')
#44 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#45 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#46 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\Authenticati...')
#47 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...', true)
#48 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\Authenticati...')
#49 /var/www/html/lib/private/Server.php(497): OC\AppFramework\Utility\SimpleContainer->get('OC\\Authenticati...')
#50 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}(Object(OC\Server))
#51 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#52 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\User\\Session')
#53 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\User\\Session', true)
#54 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\User\\Session')
#55 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\User\\Session')
#56 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#57 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#58 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OCP\\IUserSessio...')
#59 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OCP\\IUserSessio...', true)
#60 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OCP\\IUserSessio...')
#61 /var/www/html/lib/private/Server.php(857): OC\AppFramework\Utility\SimpleContainer->get('OCP\\IUserSessio...')
#62 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}(Object(OC\Server))
#63 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#64 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OC\\App\\AppManag...')
#65 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\App\\AppManag...', true)
#66 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\App\\AppManag...')
#67 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(175): OC\AppFramework\Utility\SimpleContainer->get('OC\\App\\AppManag...')
#68 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#69 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#70 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet('OCP\\App\\IAppMan...')
#71 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OCP\\App\\IAppMan...', true)
#72 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(74): OC\ServerContainer->query('OCP\\App\\IAppMan...', true)
#73 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(ReflectionParameter))
#74 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(61): array_map(Object(Closure), Array)
#75 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(106): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))
#76 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(124): OC\AppFramework\Utility\SimpleContainer->resolve('OC\\AppFramework...')
#77 /var/www/html/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query('OC\\AppFramework...', true)
#78 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query('OC\\AppFramework...')
#79 /var/www/html/lib/public/Server.php(39): OC\AppFramework\Utility\SimpleContainer->get('OC\\AppFramework...')
#80 /var/www/html/lib/base.php(656): OCP\Server::get('OC\\AppFramework...')
#81 /var/www/html/lib/base.php(1132): OC::init()
#82 /var/www/html/console.php(28): require_once('/var/www/html/l...')
#83 /var/www/html/occ(11): require_once('/var/www/html/c...')

if I modify entrypoint and remove the -p in the run_as function. This works diff from the entry point

 run_as() {
     if [ "$(id -u)" = 0 ]; then
-        su -p "$user" -s /bin/sh -c "$1"
+        su "$user" -s /bin/sh -c "$1"
     else
         sh -c "$1"
     fi

Config:list:

{
    "system": {
        "bulkupload.enabled": false,
        "htaccess.RewriteBase": "\/",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "logfile": "data\/nextcloud.log",
        "enable_previews": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "objectstore_multibucket": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "num_buckets": 4,
                "bucket": "varet-nextcloud-",
                "autocreate": false,
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "region": "eu-central-003",
                "use_path_style": true,
                "hostname": "s3.eu-central-003.backblazeb2.com"
            }
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "default_phone_region": "DE",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "trusted_domains": [
            "localhost",
            "*****"
        ],
        "allow_local_remote_servers": true,
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.0.14",
        "overwrite.cli.url": "https:\/\/nc.***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "loglevel": 2,
        "maintenance": false,
        "theme": "",
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/exiftool-bin\/exiftool-amd64-glibc",
        "maintenance_window_start": 1,
        "upgrade.disable-web": true
    },
    "apps": {
        "activity": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "3.0.0"
        },
        "admin_audit": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "1.20.0"
        },
        "backgroundjob": {
            "lastjob": "1755"
        },
        "bruteforcesettings": {
            "types": "",
            "enabled": "yes",
            "installed_version": "3.0.0"
        },
        "calendar": {
            "types": "",
            "enabled": "yes",
            "installed_version": "5.0.0"
        },
        "circles": {
            "installed_version": "25.0.0",
            "types": "filesystem,dav",
            "loopback_tmp_scheme": "http",
            "enabled": "no",
            "maintenance_run": "0",
            "maintenance_update": "{\"3\":1670216013,\"2\":1670216013,\"1\":1670216013}"
        },
        "cloud_federation_api": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.13.0"
        },
        "comments": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "1.20.1"
        },
        "contactsinteraction": {
            "types": "dav",
            "enabled": "yes",
            "installed_version": "1.11.0"
        },
        "core": {
            "installedat": "1670096280.6527",
            "vendor": "nextcloud",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "backgroundjobs_mode": "cron",
            "public_files": "files_sharing\/public.php",
            "metadataGenerationDone": true,
            "emailTestSuccessful": "1",
            "shareapi_default_internal_expire_date": "yes",
            "shareapi_default_permission_canupdate": "no",
            "shareapi_default_permission_candelete": "no",
            "shareapi_default_permissions": "5",
            "shareapi_default_permission_canshare": "no",
            "moveavatarsdone": "yes",
            "previewsCleanedUp": "1",
            "files_metadata_installed": "1",
            "lastupdateResult": "[]",
            "lastupdatedat": 1728125576,
            "lastcron": 1728147003,
            "files_metadata": {
                "blurhash": {
                    "value": null,
                    "type": "string",
                    "etag": "66fe95b6316df",
                    "indexed": false,
                    "editPermission": 0
                }
            },
            "oc.integritycheck.checker": []
        },
        "dashboard": {
            "types": "",
            "enabled": "yes",
            "installed_version": "7.10.0"
        },
        "dav": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.31.1",
            "regeneratedBirthdayCalendarsForYearFix": "yes",
            "buildCalendarSearchIndex": "yes",
            "buildCalendarReminderIndex": "yes",
            "chunks_migrated": "1",
            "builtSocialSearchIndex": "yes"
        },
        "deck": {
            "types": "dav",
            "installed_version": "1.14.1",
            "enabled": "yes"
        },
        "federatedfilesharing": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.20.0"
        },
        "federation": {
            "types": "authentication",
            "enabled": "yes",
            "installed_version": "1.20.0"
        },
        "files": {
            "types": "filesystem",
            "enabled": "yes",
            "mimetype_version": "30.0.0.14",
            "installed_version": "2.2.0"
        },
        "files_downloadlimit": {
            "installed_version": "3.0.0",
            "types": "",
            "enabled": "yes"
        },
        "files_external": {
            "installed_version": "1.22.0",
            "types": "filesystem",
            "enabled": "yes",
            "user_mounting_backends": "ftp,dav,owncloud,sftp,amazons3,swift,\\OC\\Files\\Storage\\SFTP_Key"
        },
        "files_pdfviewer": {
            "types": "",
            "enabled": "yes",
            "installed_version": "3.0.0"
        },
        "files_reminders": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.3.0"
        },
        "files_rightclick": {
            "enabled": "no",
            "types": "",
            "installed_version": "1.6.0"
        },
        "files_sharing": {
            "types": "filesystem",
            "enabled": "yes",
            "incoming_server2server_share_enabled": "no",
            "outgoing_server2server_share_enabled": "yes",
            "outgoing_server2server_group_share_enabled": "no",
            "incoming_server2server_group_share_enabled": "no",
            "installed_version": "1.22.0"
        },
        "files_trashbin": {
            "types": "filesystem,dav",
            "enabled": "yes",
            "installed_version": "1.20.1"
        },
        "files_versions": {
            "types": "filesystem,dav",
            "enabled": "yes",
            "installed_version": "1.23.0"
        },
        "firstrunwizard": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "3.0.0"
        },
        "integration_onedrive": {
            "installed_version": "1.1.4",
            "types": "",
            "use_popup": "1",
            "client_id": "***REMOVED SENSITIVE VALUE***",
            "client_secret": "***REMOVED SENSITIVE VALUE***",
            "enabled": "no"
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "3.0.0",
            "types": "logging"
        },
        "lookup_server_connector": {
            "types": "authentication",
            "enabled": "yes",
            "installed_version": "1.18.0"
        },
        "maps": {
            "types": "filesystem",
            "enabled": "no",
            "installed_version": "1.4.0"
        },
        "memories": {
            "installed_version": "4.11.0",
            "enabled": "no",
            "types": ""
        },
        "nextcloud_announcements": {
            "types": "logging",
            "enabled": "yes",
            "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200",
            "installed_version": "2.0.0"
        },
        "notifications": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "3.0.0"
        },
        "oauth2": {
            "types": "authentication",
            "enabled": "yes",
            "installed_version": "1.18.1"
        },
        "password_policy": {
            "types": "authentication",
            "enabled": "yes",
            "installed_version": "2.0.0",
            "enforceUpperLowerCase": "1",
            "enforceNumericCharacters": "1",
            "enforceSpecialCharacters": "1"
        },
        "photos": {
            "types": "dav,authentication",
            "installed_version": "2.0.1",
            "enabled": "no"
        },
        "privacy": {
            "types": "",
            "enabled": "yes",
            "installed_version": "2.0.0"
        },
        "provisioning_api": {
            "types": "prevent_group_restriction",
            "enabled": "yes",
            "installed_version": "1.20.0"
        },
        "quota_warning": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.20.0"
        },
        "recognize": {
            "types": "filesystem,dav",
            "installed_version": "3.6.1",
            "enabled": "no",
            "node_binary": "\/var\/www\/html\/custom_apps\/recognize\/bin\/node"
        },
        "recommendations": {
            "types": "",
            "enabled": "yes",
            "installed_version": "3.0.0"
        },
        "related_resources": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.5.0"
        },
        "richdocuments": {
            "external_apps": "",
            "types": "prevent_group_restriction",
            "wopi_allowlist": "*****",
            "enabled": "yes",
            "public_wopi_url": "https:\/\/****",
            "disable_certificate_verification": "yes",
            "installed_version": "8.5.1",
            "edit_groups": "",
            "wopi_url": "https:\/\/nc.****\/custom_apps\/richdocumentscode\/proxy.php?req="
        },
        "richdocumentscode": {
            "types": "",
            "installed_version": "24.4.702",
            "enabled": "yes"
        },
        "serverinfo": {
            "types": "",
            "enabled": "yes",
            "installed_version": "2.0.0",
            "cached_count_storages": "17",
            "cached_count_filecache": "477911"
        },
        "settings": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.13.0"
        },
        "sharebymail": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "1.20.0"
        },
        "sociallogin": {
            "custom_providers": "null",
            "types": "",
            "enabled": "yes",
            "disable_registration": "1",
            "create_disabled_users": "",
            "allow_login_connect": "1",
            "prevent_create_email_exists": "",
            "update_profile_on_login": "",
            "no_prune_user_groups": "",
            "auto_create_groups": "",
            "restrict_users_wo_mapped_groups": "",
            "restrict_users_wo_assigned_groups": "",
            "disable_notify_admins": "",
            "hide_default_login": "",
            "button_text_wo_prefix": "",
            "oauth_providers": "{\"google\":{\"appid\":\"\",\"secret\":\"\",\"auth_params\":{\"hd\":\"\"}},\"amazon\":{\"appid\":\"\",\"secret\":\"\"},\"facebook\":{\"appid\":\"\",\"secret\":\"\"},\"twitter\":{\"appid\":\"\",\"secret\":\"\"},\"GitHub\":{\"appid\":\"\",\"secret\":\"\",\"orgs\":\"\"},\"discord\":{\"appid\":\"\",\"secret\":\"\",\"guilds\":\"\"},\"QQ\":{\"appid\":\"\",\"secret\":\"\"},\"slack\":{\"appid\":\"\",\"secret\":\"\"},\"telegram\":{\"appid\":\"\",\"secret\":\"\"},\"mailru\":{\"appid\":\"\",\"secret\":\"\",\"auth_params\":{\"hd\":\"\"}},\"yandex\":{\"appid\":\"\",\"secret\":\"\",\"auth_params\":{\"hd\":\"\"}},\"BitBucket\":{\"appid\":\"\",\"secret\":\"\",\"workspace\":\"\"},\"PlexTv\":{\"appid\":\"\"}}",
            "installed_version": "5.6.6"
        },
        "support": {
            "types": "session",
            "enabled": "yes",
            "installed_version": "2.0.0",
            "SwitchUpdaterServerHasRun": "yes"
        },
        "survey_client": {
            "installed_version": "1.13.0",
            "types": "",
            "enabled": "no"
        },
        "systemtags": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "1.20.0"
        },
        "tasks": {
            "installed_version": "0.16.1",
            "types": "",
            "enabled": "no"
        },
        "text": {
            "types": "dav",
            "enabled": "yes",
            "installed_version": "4.1.0"
        },
        "theming": {
            "types": "logging",
            "enabled": "yes",
            "installed_version": "2.5.0",
            "disable-user-theming": "yes",
            "cachebuster": "1"
        },
        "twofactor_backupcodes": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.19.0"
        },
        "twofactor_totp": {
            "types": "",
            "enabled": "yes",
            "installed_version": "12.0.0-dev"
        },
        "updatenotification": {
            "sociallogin": "5.5.4",
            "types": "",
            "enabled": "yes",
            "installed_version": "1.20.0",
            "related_resources": "1.0.4",
            "tasks": "0.15.0",
            "calendar": "4.7.16",
            "recognize": "3.6.1",
            "core": "29.0.7.1",
            "deck": "1.12.2",
            "richdocuments": "8.4.5",
            "update_check_errors": 0
        },
        "user_status": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.10.0"
        },
        "user_usage_report": {
            "types": "filesystem",
            "installed_version": "1.14.0",
            "enabled": "no"
        },
        "viewer": {
            "types": "",
            "enabled": "yes",
            "installed_version": "3.0.0"
        },
        "weather_status": {
            "types": "",
            "enabled": "yes",
            "installed_version": "1.10.0"
        },
        "webhook_listeners": {
            "installed_version": "1.1.0-dev",
            "types": "filesystem",
            "enabled": "yes"
        },
        "workflowengine": {
            "types": "filesystem",
            "enabled": "yes",
            "installed_version": "2.12.0"
        }
    }
}
joshtrichards commented 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?

varet80 commented 1 month ago

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.

joshtrichards commented 1 month ago

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.