Upgrade from 30.0.6 to 31.0.0

After upgrading Nextcloud from 30.0.6 to 31.0.0 I get following error:

An unhandled exception has been thrown:
Error: Typed static property OC::$server must not be accessed before initialization in /var/www/html/lib/public/Server.php:39
Stack trace:
#0 /var/www/html/lib/public/Util.php(41): OCP\Server::get('OCP\\ServerVersi...')
#1 /var/www/html/config/config.php(62): OCP\Util::getVersion()
#2 /var/www/html/lib/private/Config.php(209): include('/var/www/html/c...')
#3 /var/www/html/lib/private/Config.php(40): OC\Config->readData()
#4 /var/www/html/lib/base.php(89): OC\Config->__construct('/var/www/html/c...')
#5 /var/www/html/lib/base.php(579): OC::initPaths()
#6 /var/www/html/lib/base.php(1149): OC::init()
#7 /var/www/html/console.php(28): require_once('/var/www/html/l...')
#8 /var/www/html/occ(11): require_once('/var/www/html/c...')
#9 {main}

I’m running the Nextcloud image on Kubernetes.

Where can I find additional logging to solve this issue?

Unfortunately you’ve ignored the Support Template and didn’t provide any valuable information about your environment, the installed apps etc. Other users, who ran into uprade issues, very often had an unsupported app installed on their servers. Maybe that is a starting point for further investigation.

1 Like

Sorry for the inconvience I didn’t use the template because I have a simple and pretty straight forward install and only use the social login app.

Furthermore I was just looking for a location to find some additional logging. The error assumes some issue with a variable, but I cannot find changes for that in the release notes.

For that reason a documentation has been written :wink:

1 Like

There are multiple images. And there are multiple ways of deploying with k8s. Perhaps you can share more specifics?

Also, what precisely were you trying to do when you saw this stack trace from occ?

Logging will depend on your logging configuration. :wink: But by default it’ll be in nextcloud.log located in your configured data directory. However based on the trace, I suspect something else is going on here in your environment.

I’m running image nextcloud:30.0.6-apache and when I upgrade to nextcloud:31.0.0-apache I see this in my pod logs:

Configuring Redis as session handler
Initializing nextcloud 31.0.0.18 ...
Upgrading nextcloud from 30.0.6.2 ...
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/pre-upgrade
An unhandled exception has been thrown:
Error: Typed static property OC::$server must not be accessed before initialization in /var/www/html/lib/public/Server.php:39
Stack trace:
#0 /var/www/html/lib/public/Util.php(41): OCP\Server::get('OCP\\ServerVersi...')
#1 /var/www/html/config/config.php(62): OCP\Util::getVersion()
#2 /var/www/html/lib/private/Config.php(209): include('/var/www/html/c...')
#3 /var/www/html/lib/private/Config.php(40): OC\Config->readData()
#4 /var/www/html/lib/base.php(89): OC\Config->__construct('/var/www/html/c...')
#5 /var/www/html/lib/base.php(579): OC::initPaths()
#6 /var/www/html/lib/base.php(1149): OC::init()
#7 /var/www/html/console.php(28): require_once('/var/www/html/l...')
#8 /var/www/html/occ(11): require_once('/var/www/html/c...')
#9 {main}

The nextcloud.log doesn’t show any logging during the time of upgrading.

My config file is:

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'datadirectory' => '/var/www/html/data',
  'dbhost' => getenv('POSTGRES_HOST'),
  'dbname' => getenv('POSTGRES_DB'),
  'dbpassword' => getenv('POSTGRES_PASSWORD'),
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbtype' => 'pgsql',
  'dbuser' => getenv('POSTGRES_USER'),
  'default_phone_region' => 'NL',
  'instanceid' => 'ocuipheunq4t',
  'installed' => true,

  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'REDACTED',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'REDACTED',
  'mail_smtpport' => '25',
  'maintenance_window_start' => 1,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'REDACTED',
  'redis' => 
  array (
    'host' => getenv('REDIS_HOST'),
    'password' => getenv('REDIS_HOST_PASSWORD'),
    'port' => 6379,
  ),
  'passwordsalt' => 'REDACTED',
  'secret' => 'REDACTED',
  'social_login_auto_redirect' => true,
  'trusted_domains' => 
  array (
    0 => 'REDACTED',
  ),
  'trusted_proxies' => 
  array (
    0 => 'REDACTED',
  ),
  'upgrade.disable-web' => true,
  'version' => implode('.', \OCP\Util::getVersion()),
);

This is the cause. This won’t work.

Thanks that fixed my issue.