nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.65k stars 3.99k forks source link

[Bug]: Missing semver prevents update from completing on 32-bit #35433

Closed m0n4 closed 1 year ago

m0n4 commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

commit faa747e44575269d9f4eb09d0a2c6aa3fe0501f8 introduced a fix to prevent 32-bit PHP version to upgrade to an unsupported version.

The check is done using Semver.

As Semver isn't available this raise un error:

An unhandled exception has been thrown:
Error: Class "Composer\Semver\Semver" not found in /var/www/html/nextcloud/lib/private/Updater.php:142
Stack trace:
#0 /var/www/html/nextcloud/core/Command/Upgrade.php(225): OC\Updater->upgrade()
#1 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
#2 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#3 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#4 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#5 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#6 /var/www/html/nextcloud/console.php(100): OC\Console\Application->run()
#7 /var/www/html/nextcloud/occ(11): require_once('...')
#8 {main}

This prenvents upgrading to the last supported version for 32bits machines

Steps to reproduce

  1. upgrade from 25.0.1 to 25.0.2 RC1 without semver

Expected behavior

Upgrading to the last supported version ;-(

Installation method

Official All-in-One appliance

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "something.qq"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.2.0",
        "overwrite.cli.url": "https://something.qq",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "mysql.utf8mb4": true,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "preview_max_x": "1152",
        "preview_max_y": "720",
        "preview_max_scale_factor": 1,
        "default_phone_region": "FR",
        "mail_smtpmode": "sendmail",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "pipe",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "encryption.legacy_format_support": false,
        "updater.release.channel": "stable",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - bookmarks: 11.0.4
  - bruteforcesettings: 2.5.0
  - calendar: 4.1.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - files: 1.20.1
  - files_external: 1.17.0
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - firstrunwizard: 2.14.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recommendations: 1.4.0
  - related_resources: 1.0.3
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - viewer: 1.9.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - breezedark: 24.0.2
  - comments: 1.8.0
  - contactsinteraction: 1.0.0
  - encryption
  - federation: 1.8.0
  - files_markdown: 2.3.6
  - files_trashbin: 1.6.0
  - files_versions: 1.12.0
  - support: 1.1.1
  - survey_client: 1.6.0
  - suspicious_login
  - systemtags: 1.8.0
  - twofactor_totp
  - user_ldap
  - user_status: 1.0.1
  - weather_status: 1.0.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"9yluG0SqjDGOMhiE3Rix","level":0,"time":"2022-11-25T20:20:03+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"CLI cron call has selected job with ID 140","userAgent":"--","version":"25.0.2.0","data":{"app":"cron"}}

Additional info

Running Raspbian 11 (Bullseye) on a raspi 3B+ Nexcloud have been upgraded from stable to stable since v15

szaimen commented 1 year ago

Hi, thanks for your report! Can you please apply this patch and check if updating works afterwards? https://patch-diff.githubusercontent.com/raw/nextcloud/server/pull/35434.patch

Thank you!

m0n4 commented 1 year ago

Sorry I fixed the issue without waiting for a reply. The current version is "CustomString 25.0.2 RC1" so this let us update until NC26 as you expected.

szaimen commented 1 year ago

@MichaIng as you meant you wanted to test on 32-bit next time, could you maybe check if https://patch-diff.githubusercontent.com/raw/nextcloud/server/pull/35434.patch makes the update to 25.0.2 RC1 work again on 32-bit? Thank you!

okaestne commented 1 year ago

Hi, thanks for your report! Can you please apply this patch and check if updating works afterwards? https://patch-diff.githubusercontent.com/raw/nextcloud/server/pull/35434.patch

This patch fixed the issue for me on armhf, thanks.

szaimen commented 1 year ago

Thanks for verifying!

czbr commented 1 year ago

Thanx for the report and the patch, it fixed the issue for me too.

m0n4 commented 1 year ago

Great ! I guess I can close it now

szaimen commented 1 year ago

Lets leave it open until the fix is released

MichaIng commented 1 year ago

Works here as well. Is it somehow possible to skip the check during second stage update completely but only do it when checking for a new update resp. when trying to apply the first stage update (installing new files)? One cannot break the system more than being stuck between first and second stage anyway. Or is the same script called in both stages?

szaimen commented 1 year ago

Is it somehow possible to skip the check during second stage update completely but only do it when checking for a new update resp. when trying to apply the first stage update (installing new files)? One cannot break the system more than being stuck between first and second stage anyway. Or is the same script called in both stages?

Sorry, I don't get the question.

MichaIng commented 1 year ago

Well: This code blocks the database migration and repair steps after the Nextcloud 26 files have been installed already, i.e. too late anyway. So I'm not sure what the purpose of the check at this stage is. Reasonable is it of course to not offer the update to Nextcloud 26 in the first place, and when running updater.phar, to block download/install of NC26 files.

EDIT: Okay, it does make sense in case users use the manual update path, download and install the files manually. So it can be reverted without having database and possibly other things migrated to NC26 already.

szaimen commented 1 year ago

EDIT: Okay, it does make sense in case users use the manual update path, download and install the files manually. So it can be reverted without having database and possibly other things migrated to NC26 already.

yes, this is the idea

szaimen commented 1 year ago

Closing as the backport is merged