Update from Nextcloud 30 to 31 fails

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.0.17
How are you able to access your server: The webadmin
SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: No

Describe your issue

Hi Yunohost team,

I unfortunately get this error while trying to update Nextcloud from :

Error:
2025-06-04 10:51:45,418: DEBUG - syntax error, unexpected identifier “APP_NAME”, expecting “=”
2025-06-04 10:51:45,588: DEBUG - An unhandled exception has been thrown:
2025-06-04 10:51:45,589: DEBUG - ParseError: syntax error, unexpected identifier “APP_NAME”, expecting “=” in /var/www/nextcloud/apps/passwords/lib/AppInfo/Application.php:126

Here’s the corresponding data in the .php:

117 class Application extends App implements IBootstrap {

     const string APP_NAME = 'passwords';
 
     /**
      * Application constructor.
      *
      * @param array $urlParams
      */

126 public function __construct(array $urlParams = ) {
parent::__construct(self::APP_NAME, $urlParams);
}

All Nextcloud apps are up to date and there are none I can find in the list of unsupported apps for NC 31.
YNH_APP_CURRENT_VERSION: 30.0.4~ynh2 YNH_APP_ID: nextcloud YNH_APP_INSTANCE_NAME: nextcloud YNH_APP_INSTANCE_NUMBER: ‘1’ YNH_APP_MANIFEST_VERSION: 31.0.5~ynh1 YNH_APP_PACKAGING_FORMAT: ‘2.0’ YNH_APP_UPGRADE_TYPE: UPGRADE_APP

As per always thanks for the great work and hoping yup can help me here.

Best regards

Fil

Share relevant logs or error messages

https://paste.yunohost.org/raw/zavamoqoce

Hmmmmyeah so apparently having const string foobar = "value" in a syntax new in php8.3 and was not something valid in 8.2 …

But then in the upgrade flow the script wants to run an occ command … but runs it using php8.2 because .. nextcloud ain’t upgraded yet so it’s still somehow in version 30 (which uses php8.2) … but the new code is already here so it’s code intended for 8.3 …

It’s not clear to me what’s the proper fix is … Though i suppose we should in fact use the of php for the code we’re are upgrading to and not the code we are upgrading from …?

Edit: ah and on top of that I suppose we didnt catch this in our automatic test because it’s specifically the “passwords” app that triggers this case but during our test we don’t have that app installed…

1 Like