Unable to add rclone mount as local external storage

Nextcloud version (eg, 20.0.5): 22.1.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.4): 7.4.3

The issue you are facing:

I have used rclone to mount a OneDrive volume at /mnt/onedrive like follows, where UID/GID 33 is the UID and GID for my www-data user.

rclone mount remote:Nextcloud /mnt/onedrive --uid 33 --gid 33
root@localhost:/mnt# ll
total 8
drwxr-xr-x  3 root     root     4096 Aug 31 17:03 ./
drwxr-xr-x 19 root     root     4096 Aug 30 16:42 ../
drwxr-xr-x  1 www-data www-data    0 Aug 31 18:05 onedrive/
root@localhost:/mnt# ll onedrive/
total 1
-rw-r--r-- 1 www-data www-data 5 Aug 31 17:50 file.txt

You can see here the /mnt/onedrive directory is mounted, has what appear to be correct permissions for access and also that there’s a file in the location which also looks to have the correct read/write perms.

However, if as an admin, I try to add this directory as a local mount for external storage, I get a red exclamation mark with no indication of what the problem is:

Screenshot from 2021-09-01 02-09-32

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

Steps to replicate it:

  1. Configure a OneDrive remote with rclone
  2. Mount the remote using the flags mentioned above.
  3. Try to add the mount as a “Local” external storage in Nextcloud as an administrator.

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

<?php
$CONFIG = array (
  'instanceid' => 'oc2on7s7v9hq',
  'passwordsalt' => 'SNIPPED',
  'secret' => 'SNIPPED',
  'trusted_domains' => 
  array (
    0 => 'cloud.my_domain.net',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '22.1.1.2',
  'overwrite.cli.url' => 'https://cloud.my_domain.net/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'SNIPPED',
  'installed' => true,
  'default_phone_region' => 'US',
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
  ),
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'my_domain.net',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
);

There’s nothing meaningful in the Nextcloud or Apache logs during the time period I’m trying to add this, so I won’t bother posting them for now. For clarity, Docker is not in play here, this is a manual installation on top of Ubuntu 20.04, using Redis for caching, MariaDB for the database, Postfix for sendmail, all running on the same system.