Cannot Access External Share on NAS via LXC link

Nextcloud version (eg, 20.0.5): Nextcloud Hub 3 (25.0.3)
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04 within a LXD container
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52-1ubuntu4.2
PHP version (eg, 7.4): PHP 8.1.2-1ubuntu2.10
Running NC in a LXD container on a QNAP NAS using QuTS Hero h5.0.1.2248. LXC V4.14

The issue you are facing:
I have a QNAP NAS with LXD and some shared filed. NextCloud is up and running OK. I have installed External Storage Support 1.17
I created a shared area as a mount point in the LXD that NC can access and use. I can use this area from NC OK via External Access.
However, I really want to map a share from the NAS with files in already accessed by apps on the NAS which I can’t move to NC. To do this you map an LXD share from the NAS storage to a mount point in the LXD.
When I create this mount point I create it in the root directory. So cd / && mkdir NAS && mkdir Test within the LXD to make the share. The share on the NAS is /share/Test. It is mapped by;
lxc config device add NextCloud NASMap2 disk source=/share/Test path=/NAS/Test
I can access the files OK via the NAS and from within the LXD. I can create and delete them at will which is how it works. They are effectivly the same directory /share/Test on the NAS and /NAS/Test from within the LXD.

I set up the share within NC as Test. When I click on it in the NC files app. It fails with ‘This operation is forbidden’ pop up and goes back to the top directory.

I have set all the files from /NAS/ down to be owned by www-data and I have set them to 777 for world RW. Which I can’t do in production but it still won’t access the share and display the files.
Tried setting owner to 33 on NAS, Access to 777,

Is this the first time you’ve seen this error? (Y/N): Yes although I have repeated it to test options.

Steps to replicate it:
Set up shared area in LXD
Access shared area via external storage
Browse to share in Files App. Try to drill down directory.

The output of your Nextcloud log in Admin > Logging:

Went here on Control Panel. Had circle with rotating side for very long time. Nothing was displayed after an hour I just left it. That can’t be good ;(

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

/var/www/organiser.XXX.network/config/config.php

<?php $CONFIG = array ( 'instanceid' => 'XXX', 'passwordsalt' => 'XXX', 'secret' => 'XXX', 'trusted_domains' => array ( 0 => 'organiser.XXX.network', ), 'datadirectory' => '/var/www/organiser.XXX.network/data', 'dbtype' => 'mysql', 'version' => '25.0.3.2', 'overwrite.cli.url' => 'http://organiser.XXX.network', 'dbname' => 'XXX', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'XXX', 'dbpassword' => 'XXX', 'installed' => true, 'default_phone_region' => 'GB', 'overwriteprotocol' => 'https', 'filelocking.enabled' => 'true', 'memcache.local' => '\OC\Memcache\APCu', 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array ( 'dbindex' => 0, 'password' => '', 'timeout' => 1.5, 'host' => 'localhost', 'port' => 6379, ), 'mail_from_address' => 'XXX', 'mail_smtpmode' => 'smtp', 'mail_sendmailmode' => 'smtp', 'mail_domain' => 'XXX.email', 'mail_smtpauthtype' => 'LOGIN', 'mail_smtpauth' => 1, 'mail_smtpsecure' => 'tls', 'mail_smtpport' => 'XXX', 'mail_smtphost' => 'smtp.XXX.com, 'mail_smtpname' => 'XXX@XXX.network, 'mail_smtppassword' => 'XXX', The output of your Apache/nginx/system log in /var/log/____: /var/log/apache2/XXX_error.log This is on single line from the log. What a size. [Tue Jan 24 21:50:18.107282 2023] [php:notice] [pid 21342] [client 172.29.66.42:50550] {"reqId":"ik0ioXY9ZFbLzcurVQXo","level":3,"time":"2023-01-24T21:50:18+00:00","remoteAddr":"172.29.66.42","user":"XXX" ,"app":"richdocuments","method":"GET","url":"/index.php/apps/files/ajax/getstoragestats?dir=%2F","message":"Failed to fetch the Collabora capabilities endpoint: cURL error 35: error:0A00010B: SSL routines::wrong version number (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://organiser.XXX.network/apps/richdocumentscode/proxy.php?req=/hosting/capabilities","userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0","version":"25.0.3.2","exception":{"Exception":"GuzzleHttp\\\\Exception\\\\ConnectException","Message":"cURL error 35: error:0A00010B:SSL routines::wrong version number (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://organiser.XXX.network/apps/richdocumentscode/proxy.php?req=/hosting/capabilities","Code":0, "Trace":[{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":158,"function":"createRejection","class":"GuzzleHttp\\\\Handler\\\\CurlFactory","type":"::"}, {"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":110,"function":"finishError","class":"GuzzleHttp\\\\Handler\\\\CurlFactory","type":"::"}, {"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php","line":47,"function":"finish","class":"GuzzleHttp\\\\Handler\\\\CurlFactory","type":"::"}, {"file":"/var/www/organiser.XXX.network/lib/private/Http/Client/DnsPinMiddleware.php","line":113,"function":"__invoke","class":"GuzzleHttp\\\\Handler\\\\CurlHandler","type":"->"}, {"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\\\Http\\\\Client\\\\{closure}","class":"OC\\\\Http\\\\Client\\\\DnsPinMiddleware", "type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke", "class":"GuzzleHttp\\\\PrepareBodyMiddleware","type":"->"},{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\\\{closure}", "class":"GuzzleHttp\\\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63, "function":"__invoke","class":"GuzzleHttp\\\\RedirectMiddleware","type":"->"},{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function": "GuzzleHttp\\\\{closure}","class":"GuzzleHttp\\\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Client.php", "line":331,"function":"__invoke","class":"GuzzleHttp\\\\HandlerStack","type":"->"},{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer", "class":"GuzzleHttp\\\\Client","type":"->"},{"file":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\\\Client", "type":"->"},{"file":"/var/www/organiser.XXX.network/lib/private/Http/Client/Client.php","line":218,"function":"request","class":"GuzzleHttp\\\\Client","type":"->"}, {"file":"/var/www/organiser.XXX.network/apps/richdocuments/lib/Service/CapabilitiesService.php","line":136,"function":"get","class":"OC\\\\Http\\\\Client\\\\Client","type":"->"}, {"file":"/var/www/organiser.XXX.network/apps/richdocuments/lib/Service/CapabilitiesService.php","line":74,"function":"refetch","class":"OCA\\\\Richdocuments\\\\Service\\\\CapabilitiesService", "type":"->"},{"file":"/var/www/organiser.XXX.network/apps/richdocuments/lib/AppInfo/Application.php","line":80,"function":"getCapabilities","class":"OCA\\\\Richdocuments\\\\Service\\\\CapabilitiesService", "type":"->"},{"file":"/var/www/organiser.XXX.network/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":67,"function":"OCA\\\\Richdocuments\\\\AppInfo\\\\{closure}", "class":"OCA\\\\Richdocuments\\\\AppInfo\\\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/organiser.XXX.network/lib/private/AppFramework/Bootstrap/BootContext.php", "line":51,"function":"injectFn","class":"OC\\\\AppFramework\\\\Bootstrap\\\\FunctionInjector","type":"->"},{"file":"/var/www/organiser.XXX.network/apps/richdocuments/lib/AppInfo/Application.php","line":135, "function":"injectFn","class":"OC\\\\AppFramework\\\\Bootstrap\\\\BootContext","type":"->"},{"file":"/var/www/organiser.XXX.network/lib/private/AppFramework/Bootstrap/Coordinator.php","line":190,"function": "boot","class":"OCA\\\\Richdocuments\\\\AppInfo\\\\Application","type":"->"},{"file":"/var/www/organiser.XXX.network/lib/private/legacy/OC_App.php","line":208,"function":"bootApp","class": "OC\\\\AppFramework\\\\Bootstrap\\\\Coordinator","type":"->"},{"file":"/var/www/organiser.XXX.network/lib/private/legacy/OC_App.php","line":141,"function":"loadApp","class":"OC_App","type":"::"}, {"file":"/var/www/organiser.XXX.network/lib/base.php","line":1027,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/organiser.XXX.network/index.php","line":36, "function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/organiser.XXX.network/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","Line":210,"message": "Failed to fetch the Collabora capabilities endpoint: cURL error 35: error:0A00010B:SSL routines::wrong version number (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://organiser.XXX.network/apps/richdocumentscode/proxy.php?req=/hosting/capabilities","exception":{},"CustomMessage":"Failed to fetch the Collabora capabilities endpoint: cURL error 35: error:0A00010B:SSL routines::wrong version number (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://organiser.XXX.network/apps/richdocumentscode/proxy.php?req=/hosting/capabilities"}} AND /var/log/apache2/error.log [Tue Jan 24 00:00:02.152016 2023] [mpm_prefork:notice] [pid 200] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations [Tue Jan 24 00:00:02.152221 2023] [core:notice] [pid 200] AH00094: Command line: '/usr/sbin/apache2' Device "bonding_masters" does not exist. Device "bonding_masters" does not exist. Device "bonding_masters" does not exist. Device "bonding_masters" does not exist. Device "bonding_masters" does not exist. cat: /sys/class/net/bonding_masters/operstate: Not a directory cat: /sys/class/net/bonding_masters/speed: Not a directory Device "bonding_masters" does not exist. cat: /sys/class/net/bonding_masters/duplex: Not a directory cat: /sys/class/net/bonding_masters/operstate: Not a directory cat: /sys/class/net/bonding_masters/speed: Not a directory cat: /sys/class/net/bonding_masters/duplex: Not a directory Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary. /var/www/organiser.petterson.network/data/nextcloud.log No errors were in this file only; {"reqId":"48zBmM2Q3pE1Y8XZHTBS","level":2,"time":"2023-01-24T20:50:02+00:00","remoteAddr":"","user":"--","app":"OC\\Log\\Rotate","method":"","url":"--","message":"Log file \"/var/www/organiser.XXX.network/data/nextcloud.log\" was over 104857600 bytes, moved to \"/var/www/organiser.XXX.network/data/nextcloud.log.1\"","userAgent":"--","version":"25.0.3.2","data":{"app":"OC\\Log\\Rotate"}} Anyone else doing this in a LXD container on a NAS and trying to sharethe NAS storage within NC. I'm sure it is a access problem due to www-data not being root but I honestly don't have a clue as the 777 settings should have fixed that.