Encryption not possible while maintenance mode

Nextcloud version (eg, 20.0.5): replace me
Operating system and version (eg, Ubuntu 20.04): replace me
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): replace me

The issue you are facing:

I set up a fresh install of a test-instance of Nextcloud. I followed this steps for encryption: Using the occ command — Nextcloud latest Administration Manual latest documentation

I enabled maintenace mode as written: “You must first put your Nextcloud server into maintenance mode”

But when I use the “encryption:encrypt-all” command, I get the error:

In Manager.php line 199:

Default encryption module not loaded

But the default encryption mode is set. If I don’t enable maintenance mode, it works and it is encrypting.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. do not enable maintenance mode and it works

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

$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'xxx',
  'datadirectory' => '/home/users/xxx/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'xx',
  'dbname' => 'xxx',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'maintenance' => false,

So in maintenance mode, you did the encryption:enable and when you asked the status with encryption:enable it says it is enabled?