Issue upgrading NC to the latest available version with update.sh

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.4
Operating system and version (eg, Ubuntu 20.04): 20.04.1
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.41
PHP version (eg, 7.4): 7.4.3-4ubuntu2.18

The issue you are facing:
update.sh failing with the text:
Your PHP version isn’t compatible with the new version of Nextcloud. Please upgrade your PHP stack and try again.
I’ve installed php 8.1 and tried to run the script again. This time with the following error messages:

PHP Warning: PHP Startup: Unable to load dynamic library ‘redis.so’ (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/redis.so.so (/usr/lib/php/20210902/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

And followed by; Your current version is still not compatible with the version required to run this script.

I’m running the VM from T&M and it has been running smoothly for some time now, but looks like it can’t get me to the newest version of nextcloud…
I also see 23 old packages, these are related to php. I tried removing them and then upgrade, but that didn’t work either.
I got a snapshot so I’m able to return to a working instance if needed.
Thanks.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Install php 8.1
  2. Run update.sh

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => removed
  'secret' => 'removed
  'trusted_domains' =>
  array (
    0 => 'localhost',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '25.0.4.1',
  'overwrite.cli.url' => 'https://nextcloud/',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncadmin',
  'dbpassword' => 'removed',
  'installed' => true,
  'instanceid' => 'oc6jcg7pwokj',
  'upgrade.disable-web' => 'true',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'log.condition' =>
  array (
    'apps' =>
    array (
      0 => 'admin_audit',
    ),
  ),
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '10485760',
  'trashbin_retention_obligation' => 'auto, 180',
  'versions_retention_obligation' => 'auto, 365',
  'simpleSignUpLink.shown' => false,
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => 'QI=ddxrsZ3fdXhU5IhZeFvE5boRf6',
  ),
  'htaccess.RewriteBase' => '/',
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    11 => 'OC\\Preview\\PNG',
    12 => 'OC\\Preview\\JPEG',
    13 => 'OC\\Preview\\GIF',
    14 => 'OC\\Preview\\BMP',
    15 => 'OC\\Preview\\MarkDown',
    16 => 'OC\\Preview\\MP3',
    17 => 'OC\\Preview\\TXT',
    18 => 'OC\\Preview\\Movie',
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'maintenance' => false,
  'default_phone_region' => 'us',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'force_language' => 'en',
);

The output of your Apache/nginx/system log in /var/log/____:


[Mon Apr 24 00:00:02.756603 2023] [http2:warn] [pid 12770] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more de>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 00:00:02.823569 2023] [mpm_prefork:notice] [pid 12770] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 00:00:02.823621 2023] [core:notice] [pid 12770] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 24 08:19:21.483801 2023] [mpm_prefork:notice] [pid 12770] AH00169: caught SIGTERM, shutting down
[Mon Apr 24 08:19:21.779674 2023] [http2:warn] [pid 971884] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more d>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 08:19:21.824888 2023] [mpm_prefork:notice] [pid 971884] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 08:19:21.824978 2023] [core:notice] [pid 971884] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 24 10:09:56.756750 2023] [mpm_prefork:notice] [pid 971884] AH00169: caught SIGTERM, shutting down
[Mon Apr 24 10:10:51.137545 2023] [http2:warn] [pid 1401] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more dem>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 10:10:51.686866 2023] [mpm_prefork:notice] [pid 1401] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 10:10:51.687030 2023] [core:notice] [pid 1401] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 24 10:13:21.641475 2023] [mpm_prefork:notice] [pid 1401] AH00169: caught SIGTERM, shutting down
[Mon Apr 24 10:13:21.898872 2023] [http2:warn] [pid 4077] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more dem>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 10:13:21.997505 2023] [mpm_prefork:notice] [pid 4077] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 10:13:22.007620 2023] [core:notice] [pid 4077] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 24 10:35:17.615327 2023] [mpm_prefork:notice] [pid 4077] AH00169: caught SIGTERM, shutting down
[Mon Apr 24 10:35:17.827660 2023] [http2:warn] [pid 11509] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more de>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 10:35:17.866680 2023] [mpm_prefork:notice] [pid 11509] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 10:35:17.866766 2023] [core:notice] [pid 11509] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 24 10:47:36.091963 2023] [mpm_prefork:notice] [pid 11509] AH00169: caught SIGTERM, shutting down
[Mon Apr 24 10:47:36.330451 2023] [http2:warn] [pid 16362] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more de>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 10:47:36.370731 2023] [mpm_prefork:notice] [pid 16362] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 10:47:36.370818 2023] [core:notice] [pid 16362] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 24 10:49:46.561319 2023] [mpm_prefork:notice] [pid 16362] AH00169: caught SIGTERM, shutting down
[Mon Apr 24 10:49:46.772291 2023] [http2:warn] [pid 18726] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more de>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 10:49:46.821185 2023] [mpm_prefork:notice] [pid 18726] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 10:49:46.821281 2023] [core:notice] [pid 18726] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 24 10:59:30.360666 2023] [mpm_prefork:notice] [pid 18726] AH00169: caught SIGTERM, shutting down
[Mon Apr 24 10:59:30.575512 2023] [http2:warn] [pid 20839] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more de>
PHP Warning:  PHP Startup: Unable to load dynamic library 'redis.so' (tried: /usr/lib/php/20210902/redis.so (/usr/lib/php/20210902/redis.so: cannot open shared object file: No such file or directory), /us>
[Mon Apr 24 10:59:30.609889 2023] [mpm_prefork:notice] [pid 20839] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Apr 24 10:59:30.609971 2023] [core:notice] [pid 20839] AH00094: Command line: '/usr/sbin/apache2'

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

updates.sh output

root@nextcloud:/var/www/nextcloud/config# sudo bash /var/scripts/update.sh
PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Config.php on line 2095
The notifications app isn't enabled - unable to send notifications
Fetching latest packages with apt...
[⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻]
Ondrejs PPA is installed. Holding PHP to avoid upgrading to a newer version without migration...
dpkg-query: no packages found matching veracrypt
dpkg-query: no packages found matching nextcloud-spreed-signaling
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  php-cli php-common php-pear php7.4-bcmath php7.4-bz2 php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-fpm php7.4-gd php7.4-gmp php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring
  php7.4-opcache php7.4-pgsql php7.4-readline php7.4-soap php7.4-xml php7.4-zip
0 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
Trying to upgrade the Redis PECL extension...
Getting current PHP-version...
PHPVER=8.1
PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Config.php on line 2095
grep: /etc/php/8.1/fpm/php.ini: No such file or directory
dpkg-query: no packages found matching php-acpu
/var/scripts/nextcloud_update.sh: line 456: [: : integer expression expected
Restarting Apache2 and PHP-FPM...
Getting current PHP-version...
PHPVER=8.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-147-generic
Found initrd image: /boot/initrd.img-5.4.0-147-generic
Found linux image: /boot/vmlinuz-5.4.0-144-generic
Found initrd image: /boot/initrd.img-5.4.0-144-generic
device-mapper: reload ioctl on osprober-linux-sdc1  failed: Device or resource busy
Command failed.
done
dpkg-query: no packages found matching libzfs4linux
/var/scripts/nextcloud_update.sh: line 672: [: : integer expression expected
Your apps are already up to date!
/dev/fd/63: line 1489: [: : integer expression expected
/dev/fd/63: line 1527: [: : integer expression expected
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:139
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(281): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(183): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(374): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(967): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(725): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(184): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1119): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2070): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(117): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(462): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1472): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(617): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1144): OC::init()
#38 /var/www/nextcloud/console.php(48): require_once('...')
#39 /var/www/nextcloud/occ(11): require_once('...')
#40 {main}Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ -V failed
root@nextcloud:/var/www/nextcloud/config#
 

Update: I managed to get php8.1 installed and run the update script! NC is upgraded now. I get a 503 when opening NC tho.
Running upgrade of ubuntu now.
Looks like apache2 and php is ok, apache2 was missing a env I think so I ran a command that worked for someone. Not sure if it’s ok for me…

So everything I think is up to date but still 503 service unavailable. Not sure how to proceed the troubleshooting here…

apache2 log

[Mon Apr 24 19:50:08.740806 2023] [http2:warn] [pid 1262] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands >
PHP Warning: PHP Startup: Unable to load dynamic library ‘smbclient.so’ (tried: /usr/lib/php/20210902/smbclient.so (/usr/lib/php/20210902/smbclient.so: cannot open shared object file: No such file or director>
[Mon Apr 24 19:50:10.127137 2023] [mpm_prefork:notice] [pid 1262] AH00163: Apache/2.4.57 (Ubuntu) OpenSSL/1.1.1f configured – resuming normal operations
[Mon Apr 24 19:50:10.127310 2023] [core:notice] [pid 1262] AH00094: Command line: ‘/usr/sbin/apache2’

@cloms How did you install PHP8.1?