Proxmox bind mount and external storage plugin

Nextcloud version : 21.0.1
Operating system and version : Debian 10
Apache version : 2.2.34
PHP version (eg, 7.4): 7.3

The issue you are facing:

Forbidden message when I try to upload in local external storage. Witch is a bind mount in an lxc container (previligied) in proxmox. The www-data user and group are the owners of the mounted folder (same uid and gid as the ones on the host). Can write to the folder in cli with the www-data user.

Steps to replicate it:

  1. Mount folder with proxmox on the container
  2. Add the mounted folder to nextcloud external storage plugin and make the uid and gid of the www-data user match with the ones on the folder.
  3. Try to upload a file in the folder

The output of your Nextcloud log in Admin > Logging:

No log in particular about this 

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

<?php
$CONFIG = array (
  'instanceid' => 'ocp1doe25f5g',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
  ),
  'datadirectory' => '/var/www/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => '',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'memcache.local' => '\OC\Memcache\Redis',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'redis' => [
     'host'     => '/var/run/redis/redis-server.sock',
     'port'     => 0,
     'timeout'  => 1.5,
],
'memcache.locking' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => true,
);

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

No log in particular about this 

Okey so very strange issue, I managed to get that working by setting the particular permission to the folder 0755 by using this specific command, it was not working with the digits.

chmod -R a+rwx,g-w,o-w,ug-s,-t folder_name

Now everything is working, EXECPT writting in the root of the folder, I can write into the subfolder of this folder but not in himself.
I really don’t understand what’s is going on here…
Tried a clean install of nextcloud in a fresh ubuntu server VM but it’s the same problem…

Does someone have an idea ?