nextcloud / server

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

[Bug]: error after automatic upgrade (php compatibility) #45490

Closed rponline closed 1 week ago

rponline commented 1 month ago

⚠️ This issue respects the following points: ⚠️

Bug description

Hello!

I have a nextcloud running on my server
(Debian, nginx, php-fpm, mariadb)

I had auto-upgrade enabled and "suddenly" got the following error when accessing it via web:

Downgrading is not supported and is likely to cause unpredictable issues (from 29.0.1.1 to 29.0.0.19) 

I solved the issue by upgrading from PHP 8.1 to PHP 8.2.

But maybe the software should check, if the update will break the installation?

Steps to reproduce

Having php-fpm 8.1 and upgrade nextcloud to version 29.0.1.1

Expected behavior

Automatic update should not proceed since nextcloud could check that the installed php version is not compatible with the new nextcloud version. Instead a notification to the admins sould be sent

Installation method

Community Manual installation with Archive

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

MySQL

Configuration report

"version": "29.0.1.1",
"maintenance_window_start": 3,
rponline commented 1 month ago

I'm actually not sure if it's a bug or a feature request :))

It takes a lot of effort to test versions on different environments, create and maintain compatibility lists.

Using a boxed solution (docker?) packaging the right dependencies would be the brutal but kinda easy way to overcome this issue.

So even if this will be a wontfix, maybe this issue helps people solving the error on their installation.

rponline commented 1 month ago

Small bugfix suggestion:
The error output is in any case misleading.

The database and the installation files were on the level.
It was not about downgrading.

Maybe it's possible to catch this case and output a matching error?

kesselb commented 1 month ago
joshtrichards commented 1 month ago

I solved the issue by upgrading from PHP 8.1 to PHP 8.2. But maybe the software should check, if the update will break the installation?

My guess is what fixed this wasn't the PHP update you did, but the restarting of mod_php/fpm inherent in doing so.

Likely the /version.php file from your old installation was cached as @kesselb noted.

It's quite common to need to restart PHP after major changes, but the specific needs depend on local environment's PHP settings for validation/re-validation, particularly if you've changed them from the defaults:

A couple reports like this came up on the help forum too.

P.S. You won't even be offered the option to upgrade via the Updater if your environment doesn't meet the new Nextcloud Server version's PHP version requirements. So we do check this and run integration tests against all supported PHP versions. :)

joshtrichards commented 1 month ago

Out of curiosity what are your PHP config values for:

opcache.validate_timestamps opcache.revalidate_freq

Are they non-default?

nextcloud-command commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.