Skip to content

OAuth2 failure during upgrade from 15.0.5.3 to 16.0.0.5 (beta 3) #14998

Description

@zauguin

Steps to reproduce

  1. Run updater

Expected behaviour

Update runs without problems

Actual behaviour

After

Updating <oauth2> ...

the updater fails with

An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\\Authentication\\Token\\Manager::getTokenById() must be of the type int, string given in /usr/share/webapps/nextcloud/apps/oauth2/lib/Migration/SetTokenExpiration.php:68
Stack trace:
#0 /usr/share/webapps/nextcloud/apps/oauth2/lib/Migration/SetTokenExpiration.php(68): $this->tokenProvider->getTokenById('1140')
#1 /usr/share/webapps/nextcloud/lib/private/Repair.php(98): OCA\OAuth2\Migration\SetTokenExpiration->run(Object(OC\Repair))
#2 /usr/share/webapps/nextcloud/lib/private/legacy/app.php(966): OC\Repair->run()
#3 /usr/share/webapps/nextcloud/lib/private/legacy/app.php(903): OC_App::executeRepairSteps('oauth2', Array)
#4 /usr/share/webapps/nextcloud/lib/private/Updater.php(365): OC_App::updateApp('oauth2')
#5 /usr/share/webapps/nextcloud/lib/private/Updater.php(245): OC\Updater->doAppUpgrade()
#6 /usr/share/webapps/nextcloud/lib/private/Updater.php(121): OC\Updater->doUpgrade('16.0.0.5', '15.0.5.3')
#7 /usr/share/webapps/nextcloud/core/Command/Upgrade.php(258): OC\Updater->upgrade()
#8 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(901): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /usr/share/webapps/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /usr/share/webapps/nextcloud/console.php(97): OC\Console\Application->run()
#14 /usr/share/webapps/nextcloud/occ(11): require_once('/usr/share/weba...')
#15 {main}

The update finished without further problems after manually casting the token id to int in SetTokenExpiration.php, but I can not tell how it became a string in the first place.

Server configuration

Operating system: Arch Linux

Web server: Nginx

Database: MariaDB

PHP version: 7.3.4

Nextcloud version: (see Nextcloud admin page) Upgrading from 15.0.5.3 to 16.0.0.5 (beta 3)

Updated from an older Nextcloud/ownCloud or fresh install: see above

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
  - accessibility: 1.2.0
  - activity: 2.9.0
  - bookmarks: 0.16.4
  - cloud_federation_api: 0.2.0
  - comments: 1.6.0
  - contacts: 3.0.5
  - dav: 1.9.2
  - drop_account: 0.1.0
  - federatedfilesharing: 1.6.0
  - federation: 1.6.0
  - files: 1.11.0
  - files_markdown: 2.0.6
  - files_pdfviewer: 1.5.0
  - files_rightclick: 0.13.0
  - files_sharing: 1.8.0
  - files_texteditor: 2.8.0
  - files_trashbin: 1.6.0
  - files_versions: 1.9.0
  - files_videoplayer: 1.5.0
  - firstrunwizard: 2.5.0
  - gallery: 18.3.0
  - groupfolders: 2.0.4
  - logreader: 2.1.0
  - lookup_server_connector: 1.4.0
  - nextcloud_announcements: 1.5.0
  - notes: 2.5.1
  - notifications: 2.4.1
  - oauth2: 1.4.2
  - password_policy: 1.6.0
  - passwords: 2019.4.0
  - phonetrack: 0.5.0
  - polls: 0.10.2
  - privacy: 1.0.0
  - provisioning_api: 1.6.0
  - rainloop: 6.0.2
  - recommendations: 0.4.0
  - serverinfo: 1.6.0
  - sharebymail: 1.6.0
  - social: 0.1.4
  - socialsharing_email: 1.0.5
  - support: 1.0.0
  - twofactor_backupcodes: 1.5.0
  - twofactor_gateway: 0.13.0
  - twofactor_totp: 2.1.2
  - twofactor_u2f: 2.1.3
  - updatenotification: 1.6.0
  - viewer: 1.0.0
  - workflowengine: 1.6.0

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "apps_paths": [
            {
                "path": "\/usr\/share\/webapps\/nextcloud-apps\/apps3",
                "url": "\/apps3",
                "writable": false
            },
            {
                "path": "\/usr\/share\/webapps\/nextcloud-apps\/apps2",
                "url": "\/apps2",
                "writable": true
            },
            {
                "path": "\/usr\/share\/webapps\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            }
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "16.0.0.5",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "default_language": "de_DE",
        "theme": "",
        "loglevel": 0,
        "maintenance": false,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauthtype": "PLAIN",
        "updater.release.channel": "beta",
        "app.mail.accounts.default": {
            "email": "%USERID%@***REMOVED SENSITIVE VALUE***",
            "imapHost": "***REMOVED SENSITIVE VALUE***",
            "imapPort": 143,
            "imapSslMode": "tls",
            "smtpHost": "***REMOVED SENSITIVE VALUE***",
            "smtpPort": 587,
            "smtpSslMode": "tls"
        },
        "mysql.utf8mb4": true,
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: No

Client configuration

n/a (No client involved)

Logs

Web server error log

Web server error log

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions