Iâm not able to solve lots of âhash_hkdf(): Argument #2 ($key) cannot be emptyâ. I canât find the real cause of this problem. I will describe my situation a little bit to give context. Maybe someone understands what this is about
I upgraded Nextcloud from 29 to 31. I also had to do a lot of other upgrades to meet the system requirements. I had to move from Ubuntu 20 to 24, from PHP 8.1 ot 8.3, and bring MariaDB to 10.6
Somehow I managed to do this at some point with my very limited skills.
But since push notifications do not work anymore - on all android devices with the android client. They do work on several macOS devices with the desktop client.
What I see in the nextcloud.log are lots of erros like:
[no app in context] Error: hash_hkdf(): Argument #2 ($key) cannot be empty in file â/var/www/nextcloud/lib/private/Security/Crypto.phpâ line 147
GET /ocs/v2.php/cloud/capabilities?format=json
from xxx.xxx.xxx.xxx by xxx at 22.06.2025, 11:54:23
Does anyone have any ideas on how I can narrow this down? Would more information be needed?
I would be very grateful for help, as I have been looking for a solution to this problem for weeks.
It might be, that during the process of your updates, you (accidentally) changed the instance id. Do you have an old backup to check if the id changed in the config file?
Also, you could try to run occ user:keys:verify
for an affected user, not totally sure, could be that you see the same error there.
Oh, that could possibly be a good hint. I had to go back to the old instance id at some point during the upgrade to get passwords from the Passwords app. But what exactly does that mean? What is the problem if the instance id changes?
The instance id is used for encryption of some parameters, if it changes, those informations canât be decrypted anymore. Thatâs what youâre seeing here.
What does the occ command output?
The output of the occ command is:
An unhandled exception has been thrown:
ValueError: hash_hkdf(): Argument #2 ($key) cannot be empty in /var/www/nextcloud/lib/private/Security/Crypto.php:147
Stack trace:
#0 /var/www/nextcloud/lib/private/Security/Crypto.php(147): hash_hkdf()
#1 /var/www/nextcloud/lib/private/Security/Crypto.php(102): OC\Security\Crypto->decryptWithoutSecret()
#2 /var/www/nextcloud/lib/private/Security/IdentityProof/Manager.php(100): OC\Security\Crypto->decrypt()
#3 /var/www/nextcloud/lib/private/Security/IdentityProof/Manager.php(117): OC\Security\IdentityProof\Manager->retrieveKey()
#4 /var/www/nextcloud/core/Command/User/Keys/Verify.php(54): OC\Security\IdentityProof\Manager->getKey()
#5 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(326): OC\Core\Command\User\Keys\Verify->execute()
#6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run()
#7 /var/www/nextcloud/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#9 /var/www/nextcloud/lib/private/Console/Application.php(187): Symfony\Component\Console\Application->run()
#10 /var/www/nextcloud/console.php(87): OC\Console\Application->run()
#11 /var/www/nextcloud/occ(33): require_once('...')