Error installing NextCloud on (at least) UCS 4.4 (now without sensitive information publicised)

Hello,

I have been trying to install NextCloud on my instance of UCS (4.4-9 errata1259)

I do the install edit the config.php to look like this:

<?php
$CONFIG = array (
  'passwordsalt' => 'REDACTED',
  'secret' => 'REDACTED',
  'trusted_domains' => 
  array (
    0 => 'ucs-9592.MYDOMAIN.dk',
    1 => '1.1.1.1',
    2 => 'MYDOMAIN.dk', # this is the actual edit
  ),
  'datadirectory' => '/var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data',
  'dbtype' => 'pgsql',
  'version' => '23.0.5.1',
  'overwrite.cli.url' => 'https://ucs-9592.MYDOMAIN.dk/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => '172.17.42.1:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'REDACTED',
  'installed' => true,
  'instanceid' => 'REDACTED',
  'updatechecker' => false,
  'upgrade.disable-web' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\APCu',
  'overwriteprotocol' => 'https',
  'overwritewbroot' => '/nextcloud',
  'htaccess.RewriteBase' => '/nextcloud',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'trusted_proxies' => 
  array (
    0 => '2.2.2.2',
  ),
);

and get an error like this:

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.
Technical details

    Remote Address: 172.17.42.1
    Request ID: 5YVWfNGdzaMBQQgmiVrh

When I look at the log inside the docker I get this when grepping for the ID string:

{"reqId":"5YVWfNGdzaMBQQgmiVrh","level":3,"time":"2022-06-17T19:57:18+00:00","remoteAddr":"172.17.42.1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"touch(): Utime failed: Permission denied at /var/www/html/lib/private/Config.php#248","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0","version":"","exception":{"Exception":"Error","Message":"touch(): Utime failed: Permission denied at /var/www/html/lib/private/Config.php#248","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/html/lib/private/Config.php","line":248,"function":"touch"},{"file":"/var/www/html/lib/private/Config.php","line":138,"function":"writeData","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/SystemConfig.php","line":142,"function":"setValue","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":1136,"function":"setValue","class":"OC\\SystemConfig","type":"->"},{"file":"/var/www/html/lib/base.php","line":419,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/var/www/html/lib/base.php","line":645,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/html/lib/base.php","line":1089,"function":"init","class":"OC","type":"::"},{"file":"/var/www/html/index.php","line":34,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"5YVWfNGdzaMBQQgmiVrh","level":3,"time":"2022-06-17T19:57:18+00:00","remoteAddr":"172.17.42.1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"fopen(/var/www/html/config/config.php): failed to open stream: Permission denied at /var/www/html/lib/private/Config.php#249","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0","version":"","exception":{"Exception":"Error","Message":"fopen(/var/www/html/config/config.php): failed to open stream: Permission denied at /var/www/html/lib/private/Config.php#249","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/html/lib/private/Config.php","line":249,"function":"fopen"},{"file":"/var/www/html/lib/private/Config.php","line":138,"function":"writeData","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/SystemConfig.php","line":142,"function":"setValue","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":1136,"function":"setValue","class":"OC\\SystemConfig","type":"->"},{"file":"/var/www/html/lib/base.php","line":419,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/var/www/html/lib/base.php","line":645,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/html/lib/base.php","line":1089,"function":"init","class":"OC","type":"::"},{"file":"/var/www/html/index.php","line":34,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"5YVWfNGdzaMBQQgmiVrh","level":3,"time":"2022-06-17T19:57:18+00:00","remoteAddr":"172.17.42.1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/html/lib/private/Config.php#252","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0","version":"","exception":{"Exception":"Error","Message":"chmod(): Operation not permitted at /var/www/html/lib/private/Config.php#252","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/html/lib/private/Config.php","line":252,"function":"chmod"},{"file":"/var/www/html/lib/private/Config.php","line":138,"function":"writeData","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/SystemConfig.php","line":142,"function":"setValue","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":1136,"function":"setValue","class":"OC\\SystemConfig","type":"->"},{"file":"/var/www/html/lib/base.php","line":419,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/var/www/html/lib/base.php","line":645,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/html/lib/base.php","line":1089,"function":"init","class":"OC","type":"::"},{"file":"/var/www/html/index.php","line":34,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"5YVWfNGdzaMBQQgmiVrh","level":3,"time":"2022-06-17T19:57:18+00:00","remoteAddr":"172.17.42.1","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":"Can't write into config directory!","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0","version":"","exception":{"Exception":"OCP\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Config.php","line":138,"function":"writeData","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/SystemConfig.php","line":142,"function":"setValue","class":"OC\\Config","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":1136,"function":"setValue","class":"OC\\SystemConfig","type":"->"},{"file":"/var/www/html/lib/base.php","line":419,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/var/www/html/lib/base.php","line":645,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/html/lib/base.php","line":1089,"function":"init","class":"OC","type":"::"},{"file":"/var/www/html/index.php","line":34,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Config.php","Line":256,"Hint":"This can usually be fixed by giving the webserver write access to the config directory.","CustomMessage":"--"}}
{"reqId":"5YVWfNGdzaMBQQgmiVrh","level":3,"time":"2022-06-17T19:57:18+00:00","remoteAddr":"172.17.42.1","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":"Failed to connect to the database: An exception occurred in the driver: could not find driver","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0","version":"","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: could not find driver","Code":0,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1519,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1041,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/lib/private/DB/Connection.php","line":237,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":345,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":287,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/AppConfig.php","line":361,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/AppConfig.php","line":126,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/html/lib/private/AppConfig.php","line":317,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/html/lib/private/App/AppManager.php","line":127,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/html/lib/private/App/AppManager.php","line":216,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":283,"function":"isEnabledForUser","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/html/index.php","line":44,"function":"printErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/html/lib/private/DB/Connection.php","Line":87,"CustomMessage":"--"}}

I tried doing a fresh install to test out if it was something I had tinkered with but got the same results…

Please advice :slight_smile:

update:
I just tried using the original config file:

  'trusted_domains' => 
  array (
    0 => 'ucs-9592.MYDOMAIN.dk',
    1 => '1.1.1.1',
  ),

and like this I can access ucs-9592.MYDOMAIN.dk/nextcloud but obviously not MYDOMAIN.dk/nextcloud which is what I’d like the users to be able to do…

Turns out it works better when done “the univention way”, go figure…

Mastodon