Upgrade 14.0.4. to 15.0.2 fails

Hi together,

After running the Upgrade:

  • Initializing

Current version is 14.0.4.
Update to Nextcloud 15.0.2 available. (channel: “stable”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-15.0.2.zip

  • Check for expected files

  • Check for write permissions

  • Create backup

  • Downloading

  • Verifying integrity

  • Extracting

  • Enable maintenance mode

  • Replace entry points

  • Delete old files

  • Move new files in place

  • Keep maintenance mode active?

Maintenance mode will kept active.
Now trigger the migration via command line: ./occ upgrade

  • Done

Go back to your Nextcloud instance to finish the update

I run the followiung command on the shell:
sudo -u www-data ./occ upgrade

wih the following output:

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Updating database schema
Updated database
Disabled incompatible app: user_external
Updating …
Updated to 1.1.0
Updating …
Updated to 1.5.0
Updating <files_pdfviewer> …
Updated <files_pdfviewer> to 1.4.0
Updating <files_texteditor> …
Updated <files_texteditor> to 2.7.0
Updating <files_videoplayer> …
Updated <files_videoplayer> to 1.4.0
Updating <password_policy> …
Updated <password_policy> to 1.5.0
Updating <provisioning_api> …
Updated <provisioning_api> to 1.5.0
Updating …
Updated to 1.5.0
Updating <survey_client> …
Updated <survey_client> to 1.3.0
Updating <twofactor_backupcodes> …
Updated <twofactor_backupcodes> to 1.4.1
Updating …
Updated to 1.5.0
Updating …
Updated to 1.5.0
Updating <lookup_server_connector> …
Updated <lookup_server_connector> to 1.3.0
Updating …
Updated to 1.3.0
Updating <user_ldap> …
Updated <user_ldap> to 1.5.0
Updating …
Updated to 1.10.0
Updating <cloud_federation_api> …
Updated <cloud_federation_api> to 0.1.0
Updating …
Fix broken values of calendar objects

Done
0/0 [>---------------------------] 0%
Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing ‘DELETE FROM oc_activity WHERE (affecteduser <> ?) AND (object_type = ?) AND (object_id = ?) AND (subjectparams LIKE ?)’ with params [“admin”, “calendar”, “2”, “%{“id”:“040000008200E00074C5B7101A82E008000000009082ABC42FE1CE010000000000000000100000000B1805C96FE5F34B97498617F70DF56C”%”]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘object_type’ in ‘where clause’
Update failed
Maintenance mode is kept active
Reset log level

So, the installation is broken now… :frowning:

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'installed' => true,
  'dbtype' => 'mysql',
  'dbname' => 'owncloud',
  'dbuser' => 'owncloud',
  'dbpassword' => 'bla',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'passwordsalt' => 'bla',
  'forcessl' => true,
  'blacklisted_files' => 
  array (
    0 => '.htaccess',
  ),
  'has_internet_connection' => true,
  'overwritehost' => '',
  'overwriteprotocol' => '',
  'overwritewebroot' => '',
  'overwritecondaddr' => '',
  '3rdpartyroot' => '',
  '3rdpartyurl' => '',
  'defaultapp' => 'calendar',
  'knowledgebaseenabled' => true,
  'appstoreenabled' => true,
  'mail_smtpdebug' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'bla',
  'mail_smtpport' => '25',
  'mail_smtptimeout' => 10,
  'mail_smtpauthtype' => 'LOGIN',
  'trashbin_retention_obligation' => '60, 120',
  'allow_user_to_change_display_name' => false,
  'appcodechecker' => '',
  'updatechecker' => true,
  'updater.server.url' => 'https://updates.nextcloud.com/updater_server/',
  'log_type' => 'file',
  'loglevel' => 2,
  'logfile' => '',
  'remember_login_cookie_lifetime' => 1296000,
  'maintenance' => true,
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/home/cloud.mediatis.de/public_html/apps',
      'url' => '/apps',
      'writable' => true,
    ),
  ),
  'user_backends' => 
  array (
  ),
  'instanceid' => '51c9884e70345',
  'datadirectory' => '/home/cloud.mediatis.de/public_html/data/',
  'version' => '14.0.4.2',
  'ldapIgnoreNamingRules' => false,
  'trusted_domains' => 
  array (
    0 => 'bla.de',
  ),
  'secret' => 'bla',
  'htaccess.RewriteBase' => '/',
  'logtimezone' => 'Europe/Berlin',
  'singleuser' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'updater.release.channel' => 'stable',
  'overwrite.cli.url' => 'https://bla/',
  'auth.bruteforce.protection.enabled' => true,
  'default_language' => 'en',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'bla.de',
  'theme' => '',
  'mail_smtpsecure' => 'tls',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'updater.secret' => 'bla',
);

Any hints?

Thank you

Wolfgang

I solved the problem for myself:

ALTER TABLE `oc_activity` ADD `object_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL;
ALTER TABLE `oc_activity` ADD `object_id` bigint(20) NOT NULL DEFAULT '0';

get me up and running…

Best regards

Wolfgang

Hy Wolfgang!

Thank You for posting the fix. I had exactly the same error on the upgrade to 15.12.

James