Does Nextcloud install sodium.so in the background?

The story:
I have had a peculiar problem for my existing NC production and testing environment.
From on day to the other no one was able to log in anymore. Every user got the error “wrong username or password”. In the NC log I found errors pointing out that the library sodium.so couldn’t be found and the timestamp corresponded with the first occurences of 401 unauthorized messages in the apache log.

As I am on a webspace and don’t have access to the php config or the installation on the drive I opened a ticket with my hoster and asked them if they removed it (accidentally) during a maintenance or something. I’m still in contact with them with no real progress.

As a test I installed a completely fresh NC instance in a new DB using completely separate users, passwords and a new subdomain.

While the new NC instace is for some reason slow as all hell, i was able to log in. At the same time, I suddenly was able to log in into the existing instances again too.

So let’s move on to the question:
Is the nextcloud installation routine installing sodium.so in the background if it isn’t present?

Because of this issue i think sodium is needed since Nextcloud 21. But i am not sure.

You can use phpinfo to test if sodium is installed. Here a test php-file:

phpinfo.php:

<?php
phpinfo();
phpinfo(INFO_MODULES);
?>

Thank you for the answer, but I’m not sure that’s the same issue. It might be related though.

I couldn’t log into the NC, so I wasn’t able to check for any errors on the Overview.
Additionally I wasn’t installing or upgrading any of my two existing NC instances when the error appeared. While the error was there, I took a look at the phpinfo page and sodium was mentioned at various places:

Additional .ini files parsed
/opt/plesk/php/7.4/etc/php.d/sodium.ini

sodium

|sodium support |enabled|
|libsodium headers version |1.0.16|
|libsodium library version |1.0.16|

At the same time the NC log had this error though:
{“reqId”:“YqlgbMPyZoIAACrk7nwAAACI”,“level”:3,“time”:“2022-06-15T04:30:37+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:“GET”,“url”:"/index.php/204",“message”:“PHP Startup: Unable to load dynamic library ‘sodium.so’ (tried: /opt/plesk/php/7.4/lib/php/modules/sodium.so (/opt/plesk/php/7.4/lib/php/modules/sodium.so: cannot open shared object file: No such file or directory), /opt/plesk/php/7.4/lib/php/modules/sodium.so.so (/opt/plesk/php/7.4/lib/php/modules/sodium.so.so: cannot open shared object file: No such file or directory)) at Unknown#0”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.20.2”,“version”:“24.0.0.12”}

With php.ini setting: extension_dir /opt/plesk/php/7.4/lib/php/modules

What confuses me, is that the error vanished the moment I installed a new NC instance on the same webspace with another base folder, subdomain, DB and own php config, so no relation whatsoever.

My working theory is, that the timing was a coincidence and my hoster fixed the issue on the server side and simply hasn’t informed me yet.