NextCloud on YunoHost, can't encrypt?

Nextcloud version : 18.0.2
Operating system and version: Yunohost 3.7.1.1
Apache or nginx version : nginx 1.10.3
PHP version : 7.3.16

The issue you are facing:

NC always displays this error just after turning on server-side encryption:
“La clave privada no es válida para la app de cifrado. Por favor, actualice la contraseña de su clave privada en sus ajustes personales para recuperar el acceso a sus archivos cifrados.” (“The private key is not valid for the encryption app. Please update your private key password in your personal settings to regain access to your encrypted files.”)

Is this the first time you’ve seen this error?
No, error is also present on a different instance with NC 18.0.3, Linux 3.10.0-962.3.2.lve1.5.26.3.el7.x86_64, Apache (Note sure of the version), PHP 7.2.

Steps to replicate it:

  1. Set up NC in YNH.
  2. Log in as admin user
  3. Turn on default encryption module
  4. log out then back in Nextcloud
  5. Go to username > Configuration > Personal > Security, look for “Basic encryption module” and the passwords fields below.
  6. Banner will be displayed and won’t go away no matter what you enter in those fields: existing admin password twice, exiswing password / new password.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"bDdOYZbDIsXS6XtwyaCB","level":2,"time":"2020-04-26T22:17:28+00:00","remoteAddr":"192.168.1.1","user":"user0","app":"appstoreFetcher","method":"GET","url":"/nextcloud/apps/serverinfo/update","message":"Could not connect to appstore: cURL error 28: Operation timed out after 10000 milliseconds with 4530688 out of 4763483 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0","version":"18.0.2.2"}
{"reqId":"IA7LX11s2CLWSLJ1qfmU","level":2,"time":"2020-04-26T22:17:39+00:00","remoteAddr":"192.168.1.1","user":"user0","app":"appstoreFetcher","method":"GET","url":"/nextcloud/apps/serverinfo/update","message":"Could not connect to appstore: cURL error 28: Operation timed out after 10000 milliseconds with 4066688 out of 4763483 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0","version":"18.0.2.2"}

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

<?php
$CONFIG = array (
  'passwordsalt' => '___',
  'secret' => '___',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'xyz.ynh.fr',
  ),
  'datadirectory' => '/home/yunohost.app/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '18.0.2.2',
  'overwrite.cli.url' => 'https://____.ynh.fr',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '__',
  'installed' => true,
  'instanceid' => '__',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'updatechecker' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'integrity.check.disabled' => true,
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => '6379',
    'timeout' => '0.0',
    'password' => '',
  ),
  'logout_url' => 'https://____.ynh.fr/yunohost/sso/?action=logout',
  'maintenance' => false,
);

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

192.168.1.1 - - [26/Apr/2020:22:49:45 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:49:51 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:50:22 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:50:51 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:51:30 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:51:52 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:52:22 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:52:52 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:53:22 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.1.1 - - [26/Apr/2020:22:53:53 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3478 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Firefox/68.0"

How is this issue solved?