Nextcloud 21 update with command line not working, updated php8 before Nextcloud 21

Hi, wanting the new nextcloud 21 i went to updater and beta and received 20.0.8Rc1 so i updated. The bad and obviously dumb mistake i made was updating php8 first. I’ve tried everything including purging to rollback. Now i cant get nextcloud back up and running and again now have php8 installed and I’m just trying to install nextcloud 21 by command line since i cant get into my web updater.

I’ve tried the following to install nextcloud 21:
Turn off maintenance mode
@nextcloudpi:~ $ sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off
This version of Nextcloud is not compatible with > PHP 7.4.
You are currently running 8.0.2.

Command updater:
from below
https://docs.nextcloud.com/server/latest/admin_manual/maintenance/update.htm

Received the following with command

i@nextcloudpi:~ $ sudo -u www-data php /var/www/nextcloud/updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 20.0.8 RC1.
PHP Fatal error: Uncaught Error: Call to undefined function NC\Updater\curl_init() in phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php:455
Stack trace:
#0phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php(119): NC\Updater\Updater->getUpdateServerResponse()
#1phar:///var/www/nextcloud/updater/updater.phar/lib/UpdateCommand.php(147): NC\Updater\Updater->checkForUpdate()
#2phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Command/Command.php(256): NC\Updater\UpdateCommand->execute()
#3phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(820): Symfony\Component\Console\Command\Command->run()
#4phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(187): Symfony\Component\Console\Application->doRunCommand()
#5phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(118): Symfony\Component\Console\Application->doRun()
#6phar:///var/www/nextcloud/updater/updater.phar/updater.php(10): Symfony\Component\Console\Application->run()
#7 /var/www/nextcloud/updater/updater.phar(10): require(’…’)
#8 {main}
thrown in phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php on line 455

Here is my system

  • raspberry pi 4 8gb overclocked 2.0GHz
  • @nextcloudpi:~ $ php -v
    PHP 8.0.2 (cli) (built: Feb 20 2021 05:34:43) ( NTS )
    Copyright © The PHP Group
    Zend Engine v4.0.2, Copyright © Zend Technologies
    with Zend OPcache v8.0.2, Copyright ©, by Zend Technologies
  • php modules
    @nextcloudpi:~ $ php -m
    [PHP Modules]
    calendar
    Core
    ctype
    date
    exif
    FFI
    fileinfo
    filter
    ftp
    gettext
    hash
    iconv
    json
    libxml
    openssl
    pcntl
    pcre
    PDO
    Phar
    posix
    readline
    Reflection
    session
    shmop
    sockets
    sodium
    SPL
    standard
    sysvmsg
    sysvsem
    sysvshm
    tokenizer
    Zend OPcache
    zlib

[Zend Modules]
Zend OPcache

**** Nextcloud System Info***

System Info

NextCloudPi version v1.34.7
NextCloudPi image NextCloudPi_11-27-20
distribution Debian GNU/Linux 10 \n \l
automount yes
USB devices sda sdb sdc
datadir /media/myCloudDrive/ncdata
data in SD no
data filesystem btrfs
data disk usage 12G/7.3T
rootfs usage 4.8G/29G
swapfile /var/swap
dbdir /var/lib/mysql
Nextcloud check error
HTTPD service up
PHP service up
MariaDB service up
Redis service up
Postfix service up
internet check ok
port check 80 open
port check 443 open
IP
gateway
interface eth0
certificates
NAT loopback no
uptime 54min

version 20.0.8.0

Updating question:
I would like to know if there is any way to just update and/or upgrade to NC 21 with a command line or lines and if so what are they? I have been researching and trying different methods for a day now and cant find a solution. Any help wound be greatly appreciated! Thank you!

Sorry I don’t have any other logs as I can’t grab them

**|UPDATE2021-02-24T23:16:00Z___________________

Well after reading my own post i noticed missing modules. lol
So I installed this command:

sudo apt install -y php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-zip

new module list:

@nextcloudpi:~ $ php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Updating Now:

That worked for the update to perform but as of now it is only installing the below
@nextcloudpi:~ $ sudo -u www-data php /var/www/nextcloud/updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 20.0.8 RC1.

Update to Nextcloud 20.0.8 available. (channel: “beta”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-20.0.8.zip
Open changelog :arrow_upper_right:

Steps that will be executed:
Check for expected files
Check for write permissions
Create backup
Downloading
Verify integrity
Extracting
Enable maintenance mode
Replace entry points
Delete old files
Move new files in place
Done

Start update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[:heavy_check_mark:] Check for expected files
[:heavy_check_mark:] Check for write permissions
[:heavy_check_mark:] Create backup
[:heavy_check_mark:] Downloading
[:heavy_check_mark:] Verify integrity
[:heavy_check_mark:] Extracting
[:heavy_check_mark:] Enable maintenance mode
[:heavy_check_mark:] Replace entry points
[:heavy_check_mark:] Delete old files
[:heavy_check_mark:] Move new files in place
[:heavy_check_mark:] Done

Update of code successful.

Should the “occ upgrade” command be executed? [Y/n] y
This version of Nextcloud is not compatible with > PHP 7.4.
You are currently running 8.0.2.
Keep maintenance mode active? [y/N] n
This version of Nextcloud is not compatible with > PHP 7.4.
You are currently running 8.0.2.
Maintenance mode is disabled

After Update:

I still cannot update to nextcloud 21 is there a way to force NC21 since after the update it stays on 20.0.0.8?
Thank you

This method or any method is updating to 21 is
When update to 21 is shown in settings info.
We have to wait until Update is shown.

1 Like

Thank you for the reply
Ahhh
So I have no next cloud until I receive the 21 update?

Just thought there might be way to install with a command line

Have you tried uninstalling PHP8.0 and reinstalling PHP7.4. ?

1 Like

Yep I tried all night the other night to switch back to php 7.4 and php7.3. Multiple different ways.

Then I purged php and installed php 7.3 and got a internal error.
The internal error stayed all the way up until php8 and then got maintenance mode.

Well thank you to everyone that helped on this. I finally got it with by removing php8 and then installing php7.4 and the doing a new update with the command line.
Thanks to @bb77, @JimmyKater, @earth, @Soko and others for there help in this! Here are the steps I took to find a solution just incase someone runs into this. Again I apologize for my poor forum educate on this topic.

checked my php

php -v

PHP 8.0.2 (cli) (built: Feb 20 2021 05:34:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.2, Copyright (c) Zend Technologies
with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies

Removed php8 |Note do not purge|

sudo apt remove php8*

Checked php version again to make sure php8 was removed

php -v

PHP 7.4.15 (cli) (built: Feb 20 2021 05:32:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies

Checked what modules I had installed in php7.4

php -m

i@nextcloudpi:~ $ php -m
[PHP Modules]
apc
apcu
calendar
Core
ctype
date
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
igbinary
json
libxml
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

Noticed a lot of missing modules and istalled them

sudo apt-get install php7.4 php7.4-cli php7.4-common php7.4-mysql php7.4-fpm php7.4-curl php7.4-opcache libapache2-mod-php7.4 php7.4-mbstring php7.4-xml php7.4-gd php7.4-imagick php7.4-tidy php7.4-xmlrpc php7.4-bz2 php7.4-intl php7.4-json php7.4-mbstring php7.4-imap php7.4-pspell

After this operation, 72.0 MB of additional disk space will be used.
Err:1 https://packages.sury.org/php buster/main arm64 php7.4-curl arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:2 https://packages.sury.org/php buster/main arm64 php7.4-dev arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:3 https://packages.sury.org/php buster/main arm64 php7.4-gd arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:4 https://packages.sury.org/php buster/main arm64 php7.4-imap arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:5 https://packages.sury.org/php buster/main arm64 php7.4-intl arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:6 https://packages.sury.org/php buster/main arm64 php7.4-mbstring arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:7 https://packages.sury.org/php buster/main arm64 php7.4-soap arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:8 https://packages.sury.org/php buster/main arm64 php7.4-xml arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:9 https://packages.sury.org/php buster/main arm64 php7.4-xmlrpc arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
Err:10 https://packages.sury.org/php buster/main arm64 php7.4-zip arm64 7.4.15-5+0~20210220.39+debian10~1.gbpb3863c
404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-curl_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-dev_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-gd_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-imap_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-intl_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-mbstring_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-soap_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-xml_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-xmlrpc_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.4/php7.4-zip_7.4.15-5+0~20210220.39+debian10~1.gbpb3863c_arm64.deb 404 Not Found [IP: 2606:4700:3037::6815:1294 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Noticed the needed a update here to install more module errors and needed a update here to install more modules

sudo apt-get update

Fetched 1,357 kB in 3s (464 kB/s)

Then performed a full upgrade

sudo apt full-upgrade

21 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,950 kB of archives.
After this operation, 5,120 B of additional disk space will be used

Then installed modules again

sudo apt install php7.4-gd php7.4-mysql php7.4-curl php7.4-mbstring php7.4-intl php7.4-gmp php7.4-bcmath php-imagick php7.4-xml php7.4-zip

sudo apt-get install php7.4 php7.4-cli php7.4-common php7.4-mysql php7.4-fpm php7.4-curl php7.4-opcache libapache2-mod-php7.4 php7.4-mbstring php7.4-xml php7.4-gd php7.4-imagick php7.4-tidy php7.4-xmlrpc php7.4-bz2 php7.4-intl php7.4-json php7.4-mbstring php7.4-imap php7.4-pspell

Checked my modules again to make sure they installed

php -m

php -m
[PHP Modules]
apc
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imagick
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
pspell
readline
redis
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Another update to make sure everything is up to date

sudo apt update

All packages are up to date.

Then Enabled and updated 7.4 and apache2 with the following

sudo a2dismod php7.4

sudo a2enmod php7.4

sudo service apache2 restart

sudo update-alternatives --set php /usr/bin/php7.4

sudo update-alternatives --set phar /usr/bin/phar7.4

sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4

sudo update-alternatives --set phpize /usr/bin/phpize7.4

sudo update-alternatives --set php-config /usr/bin/php-config7.4

sudo service apache2 restart

Then I ran a Nectcloud update with command line

sudo -u www-data php /var/www/nextcloud/updater/updater.phar

Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 20.0.8.

Update to Nextcloud 20.0.8 available. (channel: “beta”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-20.0.8.zip
Open changelog :arrow_upper_right:

Steps that will be executed:
[:heavy_check_mark:] Check for expected files
[:heavy_check_mark:] Check for write permissions
[:heavy_check_mark:] Create backup
[:heavy_check_mark:] Downloading
[:heavy_check_mark:] Verify integrity
[:heavy_check_mark:] Extracting
[:heavy_check_mark:] Enable maintenance mode
[:heavy_check_mark:] Replace entry points
[:heavy_check_mark:] Delete old files
[:heavy_check_mark:] Move new files in place
[:heavy_check_mark:] Done

Continue update? [y/N] Y

After the update I was back up and running
Also as soon as i was up and running i logged in and received a notice to update to NextCloud 21.
LOL
I think I will wait for a little while

2 Likes

@sharkbyte
if you want to upgrade to 21
u can do it manually following this link

1 Like

OMG, You Rock!

1 Like