[nextcloud] Nextcloud upgrade fails with phpseclib error

Problems with packages? Post here, using [tags] of the package name.

[nextcloud] Nextcloud upgrade fails with phpseclib error

Postby loki279 » Mon Feb 22, 2021 8:27 pm

Hello, I updated nextcloud to v21 using the arch arm package (21.0.0-7).
I also successfully changed the configuration to use the new 'nextcloud' user.
Now I get an error trying to upgrade my installation:

$this->bbcode_second_pass_code('', 'Starting code integrity check...
An unhandled exception has been thrown:
TypeError: decbin(): Argument #1 ($num) must be of type int, float given in /usr/share/webapps/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php:662
Stack trace:
#0 /usr/share/webapps/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php(662): decbin()
#1 /usr/share/webapps/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Crypt/RSA.php(2848): phpseclib\Math\BigInteger->toBits()
#2 /usr/share/webapps/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Crypt/RSA.php(3177): phpseclib\Crypt\RSA->_rsassa_pss_verify()
#3 /usr/share/webapps/nextcloud/lib/private/IntegrityCheck/Checker.php(371): phpseclib\Crypt\RSA->verify()
#4 /usr/share/webapps/nextcloud/lib/private/IntegrityCheck/Checker.php(571): OC\IntegrityCheck\Checker->verify()
#5 /usr/share/webapps/nextcloud/lib/private/IntegrityCheck/Checker.php(592): OC\IntegrityCheck\Checker->verifyCoreSignature()
#6 /usr/share/webapps/nextcloud/lib/private/Updater.php(288): OC\IntegrityCheck\Checker->runInstanceVerification()
#7 /usr/share/webapps/nextcloud/lib/private/Updater.php(132): OC\Updater->doUpgrade()
#8 /usr/share/webapps/nextcloud/core/Command/Upgrade.php(255): OC\Updater->upgrade()
#9 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
#10 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#11 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#12 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#13 /usr/share/webapps/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#14 /usr/share/webapps/nextcloud/console.php(100): OC\Console\Application->run()
#15 /usr/share/webapps/nextcloud/occ(11): require_once('...')
#16 {main}')

Someting seems to be messed up with phpseclib which comes with the nextcloud package.
Searching the internet I found other useres with the same problem: https://www.reddit.com/r/NextCloud/comm ... /?sort=old
The solution was not to use the arch arm package but to clone the git repo, so I guess there must be a problem with the package itself. Can someone confirm or maybe provide a solution using the original package?
loki279
 
Posts: 54
Joined: Tue Mar 07, 2017 7:59 am

Re: [nextcloud] Nextcloud upgrade fails with phpseclib error

Postby loki279 » Tue Feb 23, 2021 4:23 pm

Found a solution:

https://github.com/nextcloud/server/issues/25746


change 3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php line 662 from:

$this->bbcode_second_pass_code('', '$bits = str_pad(decbin(hexdec(substr($hex, $i, 8))), 32, '0', STR_PAD_LEFT) . $bits;')

to

$this->bbcode_second_pass_code('', '$bits = str_pad(decbin(intval(hexdec(substr($hex, $i, 8)))), 32, '0', STR_PAD_LEFT) . $bits;')
loki279
 
Posts: 54
Joined: Tue Mar 07, 2017 7:59 am

Re: [nextcloud] Nextcloud upgrade fails with phpseclib error

Postby loki279 » Fri Feb 26, 2021 10:09 am

This seems to be related to a php-8 bug that apperes on 32bit installations only:

https://bugs.php.net/bug.php?id=80796
loki279
 
Posts: 54
Joined: Tue Mar 07, 2017 7:59 am


Return to Packages

Who is online

Users browsing this forum: No registered users and 8 guests