Not able to see Rclone mount contents

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 20.0.8
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Where can i find it?
PHP version (eg, 7.4): 7.4.15

The issue you are facing:
So, I have my rclone crypt mount set up on my Ubuntu machine. Rclone command has --allow-other flag so it does allow other users to see rclone’s mount contents. I know it because i have Plex set up too and user Plex see it. But www-data don’t. I have this rclone crypt mounted on /mnt/crypt. So i tried to create dir there via root user. Then i changed owner to www-data via chown. Reloaded site and it doesn’t see the test folder with www-data user as owner neither.

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

Steps to replicate it:

  1. Set up rclone mount to /mnt/ for example
  2. Install External storage support app
  3. See it empty

The output of your Nextcloud log in Admin > Logging:

{"reqId":"xYvsDMFJMsRz89nXianC","level":3,"time":"2021-04-11T20:15:45+00:00","remoteAddr":"192.168.1.29","user":"Pheggas","app":"PHP","method":"PROPFIND","url":"/remote.php/dav/files/Pheggas/","message":{"Exception":"Error","Message":"opendir(/mnt/): failed to open dir: Permission denied at /snap/nextcloud/27089/htdocs/lib/private/Files/Storage/Local.php#132","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"opendir(/mnt/): failed to open dir: Permission denied","/snap/nextcloud/27089/htdocs/lib/private/Files/Storage/Local.php",132,{"path":"*** sensitive parameter replaced ***"}]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/Storage/Local.php","line":132,"function":"opendir","args":["/mnt/"]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/Storage/Common.php","line":877,"function":"opendir","class":"OC\\Files\\Storage\\Local","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/Storage/Wrapper/PermissionsMask.php","line":158,"function":"getDirectoryContent","class":"OC\\Files\\Storage\\Common","type":"->","args":["*** sensitive parameter replaced ***"]},{"function":"getDirectoryContent","class":"OC\\Files\\Storage\\Wrapper\\PermissionsMask","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/Cache/Scanner.php","line":408,"function":"iterator_to_array","args":[{"__class__":"Generator"}]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/Cache/Scanner.php","line":388,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["*** sensitive parameter replaced ***",false,3,319,true,0]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/Cache/Scanner.php","line":340,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["*** sensitive parameter replaced ***",false,3,319,true]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/Cache/Watcher.php","line":106,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["*** sensitive parameter replaced ***",false]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/View.php","line":1349,"function":"update","class":"OC\\Files\\Cache\\Watcher","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/snap/nextcloud/27089/htdocs/lib/private/Files/View.php","line":1389,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->","args":[{"cache":{"__class__":"OC\\Files\\Cache\\Cache"},"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"*** sensitive parameter replaced ***","/Crypt"]},{"file":"/snap/nextcloud/27089/htdocs/apps/dav/lib/Connector/Sabre/Directory.php","line":331,"function":"getFileInfo","class":"OC\\Files\\View","type":"->","args":["/Pheggas/files/Crypt",false]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":805,"function":"getQuotaInfo","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":[]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":96,"function":"Sabre\\DAV\\{closure}","class":"Sabre\\DAV\\CorePlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":809,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->","args":["{DAV:}quota-available-bytes",{"__class__":"Closure"}]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Connector\\Sabre\\Directory"}]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1063,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["propFind",[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Connector\\Sabre\\Directory"}]]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":989,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Connector\\Sabre\\Directory"}]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1678,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["files/Pheggas",["{DAV:}getlastmodified","{DAV:}getetag","{DAV:}getcontenttype","{DAV:}resourcetype","{http://owncloud.org/ns}fileid","And 14 more entries, set log level to debug to see all entries"],1]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1661,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"elementMap":[],"contextUri":"/remote.php/dav/","namespaceMap":{"DAV:":"d","http://sabredav.org/ns":"s","http://owncloud.org/ns":"oc","http://nextcloud.org/ns":"nc"},"classMap":[],"__class__":"Sabre\\Xml\\Writer"},{"__class__":"Generator"},false]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":363,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Generator"},false]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PROPFIND",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/snap/nextcloud/27089/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/snap/nextcloud/27089/htdocs/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/snap/nextcloud/27089/htdocs/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/snap/nextcloud/27089/htdocs/remote.php","line":167,"args":["/snap/nextcloud/27089/htdocs/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/snap/nextcloud/27089/htdocs/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36","version":"20.0.8.1","id":"6073593d19019"}

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

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'instanceid' => 'nope',
  'passwordsalt' => 'nope',
  'secret' => 'nope',
  'trusted_domains' =>
  array (
    0 => '192.168.1.12',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.8.1',
  'overwrite.cli.url' => 'http://192.168.1.12',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nope',
  'dbpassword' => 'nope',
  'installed' => true,
);


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

Don't have one

This is the exact same issue that I am having. I am using a very similar configuration, except that I am receiving the error
“Error while copying file to target location (copied bytes: -1, expected filesize: 348617 )” whenever I try to upload anything thru the Nextcloud web-interface. Nextcloud does not appear to be able to read any already existing files in the locally mounted external storage . . . Very frustrating that no-one has answered this q, such a specific issue

Most users here probably use Nextcloud to keep their data out of the cloud, so this use case is simply not as common I guess. Apart from that, rclone adds additional layer of complexity to the setup and how well it works also depends on the storage backend that is beeing used. Not every feature of rclone works with every storage provider… Overview of cloud storage systems

if you want a stable and reliable environment with your primary storage in the cloud, It is probably best to use something that is natively supported, documented and tested by Nextcloud, such as an S3 compatible backend Configuring Object Storage as Primary Storage — Nextcloud latest Administration Manual latest documentation.

I’ve been working with an S3 compatible object storage for my setup. I was able to figure something out and am now able to mount it and encrypt its contents via rclone crypt. however I’m still running into an issue where mounting the external storage results in high CPU usage for my digital ocean droplet. At first I thought it was because of the storage provider I was using but now I’m not so sure.

Unfortunately, I have no experience with object storage in combination with Nextcloud or rclone mount. But if you click on my link to the admin manual, you will see that Nextcloud can use S3 storage directly. So it shouldn’t be necessary to use an extra layer like rclone for that.

I know that, I just wanted to use an extra layer of encryption. I know that nextcloud has a default encryption module but I wanted to have more control over the encryption keys, I felt it would make it easier if in the future I moved my data somewhere else.