John2
May 16, 2023, 6:26pm
1
I updated using the command line from (I think) version 25.0.5.1 to 25.0.6.1. After the update I can no longer run sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
.
I get this error:
An unhandled exception has been thrown:
ParseError: syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in /var/www/nextcloud/ap
ps/user_migration/lib/Command/Export.php:45
Stack trace:
#0 /var/www/nextcloud/lib/composer/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#2 [internal function]: spl_autoload_call()
#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(114): ReflectionClass->__construct()
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(133): OC\AppFramework\Utility\SimpleConta
iner->resolve()
#5 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(466): OC\AppFramework\Utility\Sim
pleContainer->query()
#6 /var/www/nextcloud/lib/private/ServerContainer.php(145): OC\AppFramework\DependencyInjection\DIContainer->queryNo
Fallback()
#7 /var/www/nextcloud/lib/private/Console/Application.php(220): OC\ServerContainer->query()
#8 /var/www/nextcloud/lib/private/Console/Application.php(130): OC\Console\Application->loadCommandsFromInfoXml()
#9 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#10 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
I thought maybe it has to do with the config file but I do not see any issues with that:
<?php
$CONFIG = array (
'updatechecker' => false,
'instanceid' => '[...]',
'passwordsalt' => '[...]',
'secret' => '[...]',
'trusted_domains' =>
array (
0 => '192.168.0.202',
1 => '[...].com',
),
'datadirectory' => '/data/ocdata',
'overwrite.cli.url' => 'http://192.168.0.202/nextcloud',
'dbtype' => 'mysql',
'version' => '25.0.6.1',
'dbname' => 'ocdb',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'dbuser' => '[...]',
'dbpassword' => '[...]',
'logtimezone' => 'UTC',
'installed' => true,
'maintenance' => false,
'theme' => '',
'loglevel' => 1,
'htaccess.RewriteBase' => '/nextcloud',
'trashbin_retention_obligation' => '30, 370',
'mysql.utf8mb4' => true,
);
tcit
May 17, 2023, 6:02am
2
This is an issue with the user_migration
app, which broke compatibility with PHP7.4, which you probably use.
nextcloud:main
← nextcloud:feat/cli-export-part
**issue:** This PHP 8.0+ syntax will not work with PHP7.4, which is the oldest v… ersion supported with NC 25.
Try to disable the app with occ app:disable user_migration
before.
EDIT: Proper issue at
opened 06:16AM - 17 May 23 UTC
bug
regression
Nextcloud 25 oldest supported PHP version is PHP 7.4.
https://github.com/next… cloud/user_migration/pull/402 and https://github.com/nextcloud/user_migration/pull/408 make use of PHP8.0+ exclusive syntax.
Moreover, because of the signature change introduced in https://github.com/nextcloud/server/pull/38104, it's not possible to have a release which is compatible with both 25 (with 7.4 compatibility) and 27.
Therefore I suggest to make another 4.0.1 release with PHP8.0+ syntax removed to fix 25 instances, then bump to 5.0.0 for a 26+ exclusive release. You can find such code in branch ` fix-nc25-php7.4-compat` (but it's not compatible with 27 !)
Otherwise we can have a 4.0.1 release based on `stable25`'s code, but it will miss changes from 4.0.0. :s
Ref: https://help.nextcloud.com/t/error-after-updating-to-version-25-0-6-1/162279
@Pytal @come-nc
1 Like
John2
May 17, 2023, 4:10pm
3
Would it be better to update my version of php if possible?
$ php -v
PHP 7.4.33 (cli) (built: Feb 14 2023 18:30:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
John2
May 17, 2023, 7:23pm
4
I get the same error when trying to disable user migration.
~$ sudo -u www-data php /var/www/nextcloud/occ app:disable user_migration
An unhandled exception has been thrown:
ParseError: syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in /var/www/nextcloud/apps/user_migration/lib/Command/Export.php:45
Stack trace:
#0 /var/www/nextcloud/lib/composer/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#2 [internal function]: spl_autoload_call()
#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(114): ReflectionClass->__construct()
#4 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(133): OC\AppFramework\Utility\SimpleContainer->resolve()
#5 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(466): OC\AppFramework\Utility\SimpleContainer->query()
#6 /var/www/nextcloud/lib/private/ServerContainer.php(145): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#7 /var/www/nextcloud/lib/private/Console/Application.php(220): OC\ServerContainer->query()
#8 /var/www/nextcloud/lib/private/Console/Application.php(130): OC\Console\Application->loadCommandsFromInfoXml()
#9 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#10 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
tcit
May 18, 2023, 8:30am
5
Try occ app:remove user_migration
then (it will only remove the app code, not any user data).
John2
May 26, 2023, 8:28pm
6
I get the same error. I do not think I can do any thing that requires running occ.
John2
May 27, 2023, 2:44am
7
Thanks for your help. I ended up updating to php 8.2 but that gave me an error so I changed to php 8.1. It seems to be working now on php 8.1.