Trying to upgrade from Nextcloud 19.0.13.1 to 20.0.12 issue

Support intro

Hi,

I’m trying to upgrade nextcloud from 19.0.13.1 to 20.0.12. I’m running into an issue where I’m getting this error message:

root@nextcloud-nginx-9f99f5d75-grr6s:/var/www/html/nextcloud# sudo -u www-data bash -c 'php -f occ upgrade -vv'
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
2021-11-21T04:14:38+00:00 Setting log level to debug
2021-11-21T04:14:38+00:00 Repair step: Repair MySQL collation
2021-11-21T04:14:38+00:00 Repair info: All tables already have the correct collation -> nothing to do
2021-11-21T04:14:38+00:00 Repair step: Repair SQLite autoincrement
2021-11-21T04:14:38+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2021-11-21T04:14:38+00:00 Repair step: Drop account terms table when migrating from ownCloud
2021-11-21T04:14:38+00:00 Updating database schema
2021-11-21T04:14:39+00:00 Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_storages_credentials` (`user`, `identifier`, `credentials`) VALUES(?, ?, ?)' with params ["some.user", "password::logincredentials\/credentials", "xxxyyy|xxxyyy|xxxyyy|x"]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'some.user-password::logincredentials/credentials' for key 'stocred_ui'
2021-11-21T04:14:39+00:00 Update failed
2021-11-21T04:14:39+00:00 Maintenance mode is kept active
2021-11-21T04:14:39+00:00 Resetting log level

I’m not sure why I’m running into this, any idea?

Nextcloud version (eg, 20.0.5): 19.0.13.1
Operating system and version (eg, Ubuntu 20.04): bullseye/sid
Apache or nginx version (eg, Apache 2.4.25): nginx/1.18.0
PHP version (eg, 7.4): 7.4

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. upgrade the nextcloud installation
  2. RUN: sudo -u www-data bash -c ‘php -f occ upgrade -vv’
  3. check the logs.

The output of your Nextcloud log in Admin > Logging:

n/a (installation is broken.)

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

<?php
$CONFIG = array (
  'instanceid' => 'xxxyyy',
  'passwordsalt' => 'xxxyyy',
  'secret' => 'xxxyyy',
  'trusted_domains' => 
  array (
    0 => 'example.net',
  ),
  'forwarded_for_headers' => 
  array (
    0 => 'HTTP_X_FORWARDED',
    1 => 'HTTP_FORWARDED_FOR',
  ),
  'trusted_proxies'   => '10.42.0.0/16',
  'overwritecondaddr' => '^10\.42\.0\.1$',
  'overwriteprotocol' => 'https',
  'forcessl' => true,
  'integrity.check.disabled' => true,
  'overwrite.cli.url' => 'https://example.net',
  'dbtype' => 'mysql',
  'version' => '19.0.13.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb-mariadb.databases',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxyyy',
  'installed' => true,
  'filesystem_cache_readonly' => true,
  'cache_path' => '',
  'objectstore' => 
  array (
    'class' => 'OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => 's3bucket',
      'autocreate' => false,
      'key' => 'xxxyyy',
      'secret' => 'xxxyyy',
      'hostname' => 's3bucket',
      'port' => 9000,
      'use_ssl' => false,
      'region' => 'optional',
      'use_path_style' => true,
    ),
  ),
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'port' => 6379,
    'host' => 'redis-ha.cache-service',
    'database' => 510,
  ),
  'theme' => '',
  'loglevel' => 0,
  'maintenance' => false,
);